/* UtsuTransfere — feuille de style (thèmes clair et sombre automatiques). */

:root {
  color-scheme: light dark;
  --bg: #f3f4fa;
  --glow-1: rgba(99, 102, 241, 0.18);
  --glow-2: rgba(168, 85, 247, 0.14);
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --surface-3: #eceef7;
  --text: #161a2d;
  --muted: #5d6480;
  --border: #e2e5f0;
  --border-strong: #cfd3e3;
  --primary: #5b5bf0;
  --primary-soft: rgba(91, 91, 240, 0.1);
  /* Dégradé des boutons et badges : assez foncé pour un texte blanc lisible, même en thème sombre. */
  --accent-1: #5b5bf0;
  --accent-2: #8f45ee;
  --on-primary: #ffffff;
  --success: #15864a;
  --success-soft: rgba(21, 134, 74, 0.12);
  --danger: #cc2a40;
  --danger-soft: rgba(204, 42, 64, 0.1);
  --warning: #8a5000;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --focus: 0 0 0 3px rgba(91, 91, 240, 0.35);
  --shadow: 0 1px 2px rgba(22, 26, 45, 0.05), 0 16px 40px -18px rgba(22, 26, 45, 0.25);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e16;
    --glow-1: rgba(99, 102, 241, 0.22);
    --glow-2: rgba(168, 85, 247, 0.16);
    --surface: #151826;
    --surface-2: #1b1f30;
    --surface-3: #252a42;
    --text: #e9ebf5;
    --muted: #9ba1bb;
    --border: #262b40;
    --border-strong: #363c57;
    --primary: #8080ff;
    --primary-soft: rgba(128, 128, 255, 0.14);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.14);
    --danger: #ff6b7f;
    --danger-soft: rgba(255, 107, 127, 0.13);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.13);
    --focus: 0 0 0 3px rgba(128, 128, 255, 0.45);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 12% -8%, var(--glow-1), transparent 62%),
    radial-gradient(900px 520px at 100% 0%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.icon.inline {
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: -2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ─── En-tête ─────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand strong {
  color: var(--primary);
  font-weight: 700;
}

.brand-logo {
  width: 34px;
  height: 34px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.badge .icon {
  width: 15px;
  height: 15px;
  color: var(--success);
}

/* ─── Mise en page ────────────────────────────────────────────────────── */

.container {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 12px 16px 48px;
}

.card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-title.small {
  font-size: 18px;
}

.card-sub {
  margin-top: 6px;
  color: var(--muted);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 14px;
}

.center {
  text-align: center;
}

.center-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-block: 40px;
  text-align: center;
}

.center-card .card-sub {
  margin-top: 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Zone de dépôt ───────────────────────────────────────────────────── */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 22px;
  padding: 34px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone.is-dragging {
  transform: scale(1.01);
}

.dropzone:focus-within {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 10px 24px -10px var(--accent-1);
  color: var(--on-primary);
}

.dropzone-icon .icon {
  width: 28px;
  height: 28px;
}

.dropzone-title {
  font-size: 17px;
  font-weight: 650;
}

.dropzone-text {
  color: var(--muted);
}

.dropzone .link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dropzone-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dropzone.is-compact {
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
}

.dropzone.is-compact .dropzone-icon {
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 10px;
}

.dropzone.is-compact .dropzone-icon .icon {
  width: 20px;
  height: 20px;
}

.dropzone-add,
.dropzone.is-compact .dropzone-title,
.dropzone.is-compact .dropzone-text,
.dropzone.is-compact .dropzone-hint {
  display: none;
}

.dropzone.is-compact .dropzone-add {
  display: inline;
}

/* ─── Listes de fichiers ──────────────────────────────────────────────── */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  margin: 14px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.file-list.tall {
  max-height: none;
  margin-top: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.file-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.file-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.file-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta,
.item-status {
  color: var(--muted);
  font-size: 13px;
}

.item-status.success {
  color: var(--success);
}

.item-status.error {
  color: var(--danger);
}

.file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

/* ─── Formulaires ─────────────────────────────────────────────────────── */

.options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 22px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

input[type='text'],
input[type='password'],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 64px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--focus);
}

::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.input-group {
  position: relative;
}

.input-group input {
  padding-right: 48px;
}

.input-group .icon-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
}

.form-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ─── Boutons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.link-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 8px 20px -10px var(--accent-1);
  color: var(--on-primary);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.btn.ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn.ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn.danger {
  color: var(--danger);
}

.btn.danger:hover:not(:disabled) {
  border-color: transparent;
  background: var(--danger-soft);
}

.btn.block {
  width: 100%;
  margin-top: 22px;
}

.btn.small {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.btn.small .icon {
  width: 17px;
  height: 17px;
}

.icon-btn {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.link-btn {
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ─── Progression ─────────────────────────────────────────────────────── */

.progress {
  height: 12px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress.small {
  height: 6px;
  margin-top: 8px;
}

.progress-fill {
  position: relative;
  width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.2s ease-out;
}

.progress-fill::after {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.18) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.18) 75%,
    transparent 75%
  );
  background-size: 24px 24px;
  animation: stripes 1s linear infinite;
  content: '';
}

@keyframes stripes {
  to {
    background-position: 24px 0;
  }
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.progress-stats strong {
  color: var(--text);
  font-size: 15px;
}

/* ─── Lien prêt ───────────────────────────────────────────────────────── */

.success-mark,
.state-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
}

.center-card .state-mark {
  margin-bottom: 4px;
}

.success-mark .icon,
.state-mark .icon {
  width: 32px;
  height: 32px;
}

.state-mark {
  background: var(--primary-soft);
  color: var(--primary);
}

.state-mark.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.link-box {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
}

.link-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.link-box input[type='text'] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 14px;
  box-shadow: none;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.done-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 22px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  list-style: none;
}

.done-meta li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.done-meta .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13.5px;
}

.notice .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--success);
}

.notice.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.notice.warning .icon {
  color: currentColor;
}

/* ─── Mes envois ──────────────────────────────────────────────────────── */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.history-item.is-gone {
  opacity: 0.6;
}

.history-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta,
.history-status {
  color: var(--muted);
  font-size: 13px;
}

.history-actions {
  display: flex;
  flex: none;
  gap: 4px;
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ─── Page de téléchargement ──────────────────────────────────────────── */

.password-form {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

.password-form input {
  flex: 1;
  min-width: 0;
}

.sender-message {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--primary-soft);
}

.sender-message figcaption {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.sender-message figcaption .icon {
  width: 16px;
  height: 16px;
}

.sender-message blockquote {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.download-frame {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Points forts ────────────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.feature {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.feature h3 {
  margin-top: 10px;
  font-size: 14px;
}

.feature p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.feature-icon .icon {
  width: 18px;
  height: 18px;
}

.footer {
  padding: 24px 16px 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer a {
  color: inherit;
}

/* ─── Petits écrans ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .topbar {
    padding: 14px 16px;
  }

  .card {
    padding: 20px;
    border-radius: 18px;
  }

  .card-title {
    font-size: 21px;
  }

  .field-row,
  .features {
    grid-template-columns: 1fr;
  }

  .link-box {
    flex-direction: column;
  }

  .download-item {
    flex-wrap: wrap;
  }

  .download-item .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .badge {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
