:root {
  --grad-from:    #1e63ff;            /* bleu WeTransfer */
  --grad-to:      #00c6ff;            /* cyan */
  --accent:       #0a66ff;            /* bouton d'action */
  --accent-hover: #0050d8;
  --panel:        #ffffff;
  --ink:          #16181d;            /* texte foncé dans le panneau */
  --muted:        #6b7280;
  --field:        #f4f6fb;            /* fond des champs */
  --field-border: #d7dce6;
  --line:         #eceef3;            /* séparateurs dans le panneau */
  --danger:       #e5484d;
  --radius:       24px;
  --shadow:       0 24px 60px rgba(8, 30, 80, .28);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to)) fixed;
}

/* ---- Header posé sur le dégradé ---- */
.topbar { padding: 1.25rem 1.75rem; }
.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}

/* ---- Conteneur ---- */
.container {
  max-width: 720px;
  margin: 2.5rem auto 4rem;
  padding: 0 1rem;
}
/* Variante large (page admin) — élargit le conteneur quand il porte un panneau wide */
main:has(.panel.wide) { max-width: 1040px; }

/* ---- Panneau (ex-carte) ---- */
.panel, .card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem;
}
.panel.wide { padding: 2rem 2.25rem; }

h1 {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ---- Champs de formulaire ---- */
input, textarea, button { font: inherit; }
input[type=text], input[type=password], textarea {
  width: 100%;
  margin: .5rem 0;
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 102, 255, .15);
}
textarea { min-height: 5rem; resize: vertical; }

/* ---- Boutons pilule ---- */
button, .button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .8rem 1.6rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
button:hover, .button:hover { background: var(--accent-hover); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { background: var(--accent); opacity: .4; cursor: not-allowed; }
button.danger, .button.danger { background: var(--danger); }
button.danger:hover, .button.danger:hover { background: #c63a3f; }
.button.block { display: block; text-align: center; margin: 1.25rem 0 .5rem; }

/* ---- Lien-action discret (« choisis ») ---- */
.link { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; }

/* ---- Bouton « Se déconnecter » discret ---- */
.logout { float: right; margin: -.25rem 0 0; }
.logout button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--field-border);
  padding: .4rem .9rem;
  font-weight: 500;
}
.logout button:hover { background: var(--field); color: var(--ink); }
.adminlink {
  display: block;
  text-align: right;
  margin-top: 1.5rem;
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
}
.adminlink:hover { color: var(--ink); text-decoration: underline; }

/* ---- Dropzone : gros « + » dans un cercle bleu ---- */
.dropzone {
  border: 2px dashed var(--field-border);
  border-radius: 16px;
  padding: 2.25rem 1.5rem;
  text-align: center;
  margin: 0 0 1.25rem;
  background: var(--field);
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: #eaf1ff; }
.dropzone label { display: block; cursor: pointer; }
.dropzone .dz-title { font-weight: 700; color: var(--ink); margin: 0; }
.dropzone .plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 2.25rem;
  font-weight: 300;
  line-height: 1;
  margin-bottom: .75rem;
}
.dropzone .hint { color: var(--muted); margin: .25rem 0 0; }

/* ---- Listes de fichiers ---- */
.files { list-style: none; padding: 0; margin: 1rem 0; }
.files li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.files a { color: var(--accent); text-decoration: none; font-weight: 600; }
.files a:hover { text-decoration: underline; }
#filelist { list-style: none; padding: 0; margin: 1rem 0 0; text-align: left; }
#filelist li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.size { color: var(--muted); font-size: .9rem; }
.expiry, .usage { color: var(--muted); font-size: .9rem; }

/* ---- Case à cocher ---- */
.check { display: flex; align-items: center; gap: .5rem; margin: .9rem 0; color: var(--muted); }
.check input { width: auto; margin: 0; }

/* ---- Barre de progression ---- */
#progress { margin: 1.25rem 0; }
.bar { height: 12px; background: var(--field); border-radius: 999px; overflow: hidden; }
#barFill {
  height: 100%; width: 100%;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .2s;
}
#progressText { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }

/* ---- Bloc résultat (lien final) ---- */
.result { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.result input { width: 70%; margin-right: .5rem; }

/* ---- Divers ---- */
.error { color: var(--danger); font-weight: 600; }
.message { color: var(--muted); white-space: pre-wrap; margin: 0 0 1rem; }

/* ---- Tableau admin ---- */
table.admin { width: 100%; border-collapse: collapse; margin-top: 1.25rem; font-size: .92rem; }
table.admin th {
  text-align: left; padding: .65rem .6rem;
  border-bottom: 2px solid var(--line);
  color: var(--muted); font-weight: 600;
  text-transform: uppercase; font-size: .72rem; letter-spacing: .04em;
}
table.admin td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin tr:last-child td { border-bottom: 0; }
table.admin a { color: var(--accent); text-decoration: none; }
table.admin a:hover { text-decoration: underline; }
table.admin .logout, table.admin form { float: none; margin: 0; }
table.admin button.danger { padding: .4rem .9rem; }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: rgba(27, 138, 75, .14); color: #137a41; }
.badge.wait { background: var(--field); color: var(--muted); }
table.admin tr.got td { background: rgba(27, 138, 75, .06); }

/* ---- Petits panneaux centrés (connexion / déverrouillage) ---- */
.narrow { max-width: 420px; margin: 0 auto; }

/* ---- Page lien indisponible ---- */
.gone { text-align: center; }
.gone h1 { margin-top: 0; }
.gone-icon { font-size: 3.5rem; line-height: 1; margin-bottom: .5rem; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .container { margin: 1.5rem auto 2.5rem; padding: 0 .75rem; }
  .panel, .card { padding: 1.5rem; border-radius: 18px; }
  .result input { width: 100%; margin: 0 0 .5rem; }
}
