/* ==========================================================================
   MNIT Transfer — Feuille de style "My New IT"
   Charte officielle My New IT : fond #0d0d0d, vert #3DB52C / néon #00ff88,
   typo Syne (titres) + Outfit (UI) + JetBrains Mono (valeurs/terminal).
   Cartes = fenêtres terminal (barre de titre + 3 pastilles + scanline).
   Animations transform/opacity (60fps) + prefers-reduced-motion.
   ========================================================================== */

/* ==========================================================================
   Tokens de design — charte My New IT (valeurs EXACTES)
   ========================================================================== */
:root {
  /* Couleurs de la charte */
  --bg-base:    #0d0d0d;
  --green:      #3DB52C;
  --green-neon: #00ff88;
  --border:     #222222;
  --text:       #e8e8e8;
  --text-muted: #888888;
  --text-faint: #444444;
  --amber:      #f59e0b;
  --cyan:       #06b6d4;

  /* Dérivés utiles */
  --green-soft:  rgba(61, 181, 44, 0.08);
  --green-glow:  rgba(0, 255, 136, 0.35);
  --green-line:  rgba(61, 181, 44, 0.15);
  --danger:      #ff5f56;
  --danger-soft: rgba(255, 95, 86, 0.10);

  /* Pastilles terminal */
  --dot-red:    #ff5f56;
  --dot-yellow: #ffbd2e;
  --dot-green:  #27c93f;

  /* Discord */
  --discord: #5865f2;

  /* Polices */
  --font-display: 'Syne', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui:      'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;

  /* Géométrie */
  --radius:    1rem;
  --radius-sm: 0.6rem;
  --radius-xs: 0.5rem;
  --gap:       clamp(16px, 3vw, 24px);
  --maxw:      900px;

  /* Ombres / courbes */
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9), 0 2px 8px -4px rgba(0, 0, 0, 0.6);
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Reset léger
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

::selection { background: var(--green-soft); color: var(--green-neon); }

/* ==========================================================================
   Décor : grille + glows verts ambiants
   ========================================================================== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}

.bg-glows {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.5;
}
.glow-1 {
  width: 460px; height: 460px;
  top: -140px; left: -100px;
  background: radial-gradient(circle, rgba(61, 181, 44, 0.30), transparent 70%);
  animation: drift1 26s var(--ease) infinite alternate;
}
.glow-2 {
  width: 520px; height: 520px;
  top: 20%; right: -160px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.18), transparent 70%);
  animation: drift2 32s var(--ease) infinite alternate;
}
.glow-3 {
  width: 420px; height: 420px;
  bottom: -180px; left: 30%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12), transparent 70%);
  animation: drift3 30s var(--ease) infinite alternate;
}
@keyframes drift1 { from { transform: translate3d(0,0,0); }       to { transform: translate3d(60px, 40px, 0); } }
@keyframes drift2 { from { transform: translate3d(0,0,0); }       to { transform: translate3d(-70px, 50px, 0); } }
@keyframes drift3 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(40px, -50px, 0) scale(1.1); } }

/* Pile au-dessus du décor. */
.site-header, main, .site-footer { position: relative; z-index: 1; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}

/* ==========================================================================
   En-tête
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.9), rgba(13, 13, 13, 0.5));
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  filter: drop-shadow(0 0 10px var(--green-glow));
  transition: transform 0.5s var(--ease);
}
.brand:hover img { transform: scale(1.06); }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
}
.wordmark .accent { color: var(--green); }

.session {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.user-name {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.user-name b { color: var(--text); font-weight: 600; }
.user-name .badge-admin {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--green-neon);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn {
  --btn-bg: #111111;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--btn-bg);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease),
              border-color 0.25s var(--ease), background 0.25s var(--ease),
              color 0.2s, opacity 0.2s;
  will-change: transform;
}
.btn:hover  { transform: translateY(-1px); color: var(--text); border-color: #333; }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--green);
}

.btn-lg    { padding: 14px 22px; font-size: 1.02rem; }
.btn-sm    { padding: 7px 12px; font-size: 0.84rem; }
.btn-block { width: 100%; }

/* Bouton principal : vert néon sur fond vert léger. */
.btn-primary {
  --btn-bg: var(--green-soft);
  border-color: var(--green);
  color: var(--green-neon);
  font-weight: 600;
}
.btn-primary:hover {
  border-color: var(--green-neon);
  color: var(--green-neon);
  box-shadow: 0 0 0 1px var(--green-line), 0 12px 36px -18px var(--green-glow),
              0 0 18px -4px var(--green-glow);
  background: rgba(61, 181, 44, 0.14);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.5);
}
.btn-primary:disabled:hover { transform: none; box-shadow: none; }

.btn-ghost {
  --btn-bg: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); border-color: #333; background: rgba(255, 255, 255, 0.02); }

.btn-danger:hover {
  color: var(--danger);
  border-color: rgba(255, 95, 86, 0.5);
  background: var(--danger-soft);
}

.btn-discord {
  --btn-bg: var(--discord);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.btn-discord:hover { color: #fff; box-shadow: 0 12px 34px -16px var(--discord); filter: brightness(1.08); }

/* ==========================================================================
   Cartes — fenêtres terminal
   ========================================================================== */
main { flex: 1; padding-block: clamp(28px, 6vw, 56px); }

.card {
  position: relative;
  background: rgba(8, 8, 8, 0.95);
  border: 1px solid var(--green-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  overflow: hidden;
  animation: cardIn 0.5s var(--ease) both;
}
.card + .card { margin-top: var(--gap); }

/* Scanline subtile par-dessus la carte. */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.5;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

/* Barre de titre terminal : pastilles + titre mono centré. */
.term-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--green-line);
  background: rgba(0, 0, 0, 0.4);
}
.term-bar .dots { display: inline-flex; gap: 7px; }
.term-bar .dots i {
  width: 11px; height: 11px;
  border-radius: 999px;
  display: inline-block;
}
.term-bar .dots i:nth-child(1) { background: var(--dot-red); }
.term-bar .dots i:nth-child(2) { background: var(--dot-yellow); }
.term-bar .dots i:nth-child(3) { background: var(--dot-green); }
.term-bar .term-title {
  flex: 1 1 auto;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  /* compense la largeur des pastilles pour rester centré */
  margin-right: 39px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-body {
  position: relative;
  z-index: 2;
  padding: clamp(20px, 4vw, 32px);
}
.card-body.center-state {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mt-0 { margin-top: 0; }

/* L'attribut [hidden] doit TOUJOURS masquer : sinon le display de .card / .center-state
   l'emporte et le spinner #loadingState reste affiché après init. NE PAS RETIRER. */
[hidden] { display: none !important; }

/* ==========================================================================
   Titres
   ========================================================================== */
.hero-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text);
}
.hero-sub {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 1.0rem;
}

/* ==========================================================================
   Onglets
   ========================================================================== */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: var(--gap);
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 8, 8, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tab {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  color: var(--green-neon);
  background: var(--green-soft);
  border-color: var(--green-line);
}
.tab:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--green); }

/* ==========================================================================
   Écran de connexion (auth-gate)
   ========================================================================== */
.auth-gate h2 {
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.auth-gate p { color: var(--text-muted); margin: 0 auto 18px; max-width: 46ch; }
.auth-gate .lock {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 16px var(--green-glow));
  animation: floaty 4s var(--ease) infinite alternate;
}
@keyframes floaty { from { transform: translateY(-3px); } to { transform: translateY(4px); } }
.auth-gate .btn { margin-top: 4px; }
.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--green-neon);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Dropzone
   ========================================================================== */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 188px;
  padding: 28px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #2c2c2c;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(61, 181, 44, 0.05), transparent 60%),
    rgba(255, 255, 255, 0.01);
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease),
              transform 0.25s var(--ease), box-shadow 0.3s var(--ease);
}
.dropzone::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: radial-gradient(220px 160px at 50% 100%, var(--green-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.dropzone:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}
.dropzone:hover::after { opacity: 0.8; }
.dropzone:focus-visible {
  outline: none;
  border-color: var(--green-neon);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.dropzone.dragover {
  border-color: var(--green-neon);
  border-style: solid;
  background: rgba(61, 181, 44, 0.06);
  transform: scale(1.012);
  box-shadow: 0 0 0 1px var(--green-line), 0 18px 50px -24px var(--green-glow);
}
.dropzone.dragover::after { opacity: 1; }
.dropzone.dragover .dz-icon { transform: translateY(-4px) scale(1.12); }

.dz-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 14px var(--green-glow));
  transition: transform 0.3s var(--ease);
  animation: bobIcon 3.4s var(--ease) infinite alternate;
}
@keyframes bobIcon { from { transform: translateY(-2px); } to { transform: translateY(3px); } }
.dz-title { margin: 4px 0 0; font-weight: 600; font-size: 1.06rem; }
.dz-hint  { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.dz-pick  { color: var(--green-neon); font-weight: 600; }

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

/* ==========================================================================
   Liste de fichiers (compose + download)
   ========================================================================== */
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
  animation: fileIn 0.42s var(--ease) both;
}
@keyframes fileIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.file-row:hover { border-color: #333; background: rgba(255, 255, 255, 0.03); }
.file-row.too-big { border-color: rgba(255, 95, 86, 0.5); background: var(--danger-soft); }
.file-row.removing { animation: fileOut 0.28s var(--ease) forwards; }
@keyframes fileOut { to { opacity: 0; transform: translateX(18px) scale(0.96); } }

.f-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 1.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.f-meta { flex: 1 1 auto; min-width: 0; }
.f-name {
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.f-size { font-size: 0.84rem; color: var(--text-muted); font-family: var(--font-mono); }
.f-warn { color: var(--danger); font-weight: 600; }

.f-remove {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.2s var(--ease), border-color 0.2s;
}
.f-remove:hover { color: var(--danger); border-color: rgba(255, 95, 86, 0.5); background: var(--danger-soft); transform: rotate(90deg); }
.f-remove:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--danger-soft); }

.list-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.list-summary .total { color: var(--green-neon); font-weight: 600; font-family: var(--font-mono); }

/* ==========================================================================
   Notices (avertissements / erreurs)
   ========================================================================== */
.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  animation: cardIn 0.4s var(--ease) both;
}
.notice b { font-weight: 600; }
.notice.warn  { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08);  color: #fcd382; }
.notice.error { border-color: rgba(255, 95, 86, 0.45); background: var(--danger-soft); color: #ff9a93; }

/* ==========================================================================
   Options repliables
   ========================================================================== */
.options {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.01);
  overflow: hidden;
}
.options > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: color 0.2s, background 0.2s;
  user-select: none;
}
.options > summary::-webkit-details-marker { display: none; }
.options > summary::before { content: '⚙'; color: var(--cyan); font-size: 1.05rem; }
.options > summary::after {
  content: '⌄';
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--text-faint);
  transition: transform 0.3s var(--ease);
}
.options[open] > summary::after { transform: rotate(180deg); }
.options > summary:hover { color: var(--text); background: rgba(255, 255, 255, 0.02); }

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 4px 16px 18px;
  animation: optionsIn 0.35s var(--ease) both;
}
@keyframes optionsIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }

input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
input::placeholder { color: var(--text-faint); }
input:focus, select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  background: rgba(0, 0, 0, 0.75);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888888' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

/* Champ mot de passe + actions. */
.pw-field { grid-column: 1 / -1; }
.pw-input-row { display: flex; gap: 8px; align-items: stretch; }
.pw-input-row input { flex: 1 1 auto; }
.icon-btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #111;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--green-neon); border-color: var(--green); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(0.94); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--green-soft); }
.pw-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pw-actions .btn { flex: 1 1 auto; padding: 8px 12px; font-size: 0.86rem; }
.pw-gen.flash { animation: genFlash 0.6s var(--ease); }
@keyframes genFlash {
  0%   { box-shadow: 0 0 0 0 var(--green-glow); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

/* ==========================================================================
   Progression
   ========================================================================== */
.progress-wrap { display: flex; flex-direction: column; gap: 12px; }
.progress-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
#progressLabel { color: var(--text-muted); font-size: 0.9rem; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pct {
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--green-neon);
}

.progress-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-bar {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(92deg, var(--green), var(--green-neon));
  box-shadow: 0 0 18px -2px var(--green-glow);
  transition: width 0.35s var(--ease);
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.progress-bar.indeterminate {
  width: 35% !important;
  animation: indeterminate 1.25s var(--ease) infinite;
}
@keyframes indeterminate {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(330%); }
}

.progress-sub { font-size: 0.84rem; color: var(--text-faint); }
.progress-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.84rem;
  color: var(--text-muted);
}
.meta-chip b { color: var(--text); font-weight: 600; }
.meta-chip .ic { color: var(--cyan); }

/* ==========================================================================
   Résultat (lien final)
   ========================================================================== */
.card.result .card-body { text-align: center; }
.card.result h2 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card.result .sub { color: var(--text-muted); margin: 0 auto 20px; max-width: 50ch; }

.ok-icon {
  --sz: 64px;
  width: var(--sz); height: var(--sz);
  margin: 0 auto 6px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 1.8rem;
  background: radial-gradient(circle at 50% 40%, var(--green-soft), transparent 70%);
  border: 1.5px solid var(--green);
  color: var(--green-neon);
  box-shadow: 0 0 30px -6px var(--green-glow);
  animation: popIn 0.5s var(--ease) both;
}
.ok-icon.error { border-color: rgba(255, 95, 86, 0.5); color: var(--amber); box-shadow: none; }
@keyframes popIn {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.link-box {
  display: flex;
  gap: 8px;
  margin: 0 auto 16px;
  max-width: 560px;
}
.link-box input {
  flex: 1 1 auto;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.6);
}
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.result-pw {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 11px 14px;
  max-width: 560px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.92rem;
  color: var(--text-muted);
  animation: cardIn 0.4s var(--ease) both;
}
.result-pw .pw-val {
  font-weight: 600;
  color: var(--green-neon);
  letter-spacing: 0.02em;
  word-break: break-all;
}
.result-pw .btn { padding: 6px 11px; font-size: 0.82rem; }

/* ==========================================================================
   Panels (Mes envois / Admin)
   ========================================================================== */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}
.section-label.muted { color: var(--text-muted); }
.section-label .term-prompt { color: var(--green); font-weight: 600; }
.section-label .count {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
}
.term-prompt { color: var(--green); }

.empty-state {
  margin: 10px 0 0;
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.01);
}

/* Liste "Mes envois" */
.transfer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.transfer-list.dimmed .transfer-item { opacity: 0.72; }

.transfer-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.012);
  padding: 14px 16px;
  transition: border-color 0.2s, background 0.2s;
  animation: fileIn 0.4s var(--ease) both;
}
.transfer-item:hover { border-color: #333; background: rgba(255, 255, 255, 0.025); }

.ti-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.ti-main { flex: 1 1 240px; min-width: 0; }
.ti-title {
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ti-title .lock-ic { color: var(--amber); font-size: 0.9rem; }
.ti-sub {
  margin-top: 3px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.ti-sub .sep { color: var(--text-faint); margin: 0 4px; }

.ti-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  text-align: right;
}
.ti-countdown {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cyan);
}
.ti-countdown.expiring { color: var(--amber); animation: pulseWarn 1.6s var(--ease) infinite; }
.ti-countdown.expired  { color: var(--text-faint); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.badge.active   { border-color: var(--green-line); background: var(--green-soft); color: var(--green-neon); }
.badge.expired  { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.07); color: #fcd382; }
.badge.exhausted{ border-color: var(--border); background: rgba(255, 255, 255, 0.02); color: var(--text-muted); }

.ti-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.ti-actions .btn { padding: 7px 12px; font-size: 0.84rem; }

/* Liste de fichiers repliable dans un envoi. */
.ti-files {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.ti-files > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 13px;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.ti-files > summary::-webkit-details-marker { display: none; }
.ti-files > summary::after {
  content: '⌄';
  margin-left: auto;
  transition: transform 0.3s var(--ease);
}
.ti-files[open] > summary::after { transform: rotate(180deg); }
.ti-files > summary:hover { color: var(--text); }
.ti-files ul { list-style: none; margin: 0; padding: 0 13px 11px; display: grid; gap: 5px; }
.ti-files li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ti-files li .fn { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-files li .fs { flex: 0 0 auto; }

/* ==========================================================================
   Tableaux de données (admin)
   ========================================================================== */
.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.data-table td.owner { color: var(--text); font-weight: 500; }
.data-table td.muted { color: var(--text-muted); }
.data-table .cell-actions { display: flex; gap: 6px; }
.data-table .btn { padding: 5px 9px; font-size: 0.78rem; }
.data-table .t-title { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cd-cell { font-family: var(--font-mono); }
.cd-cell.expiring { color: var(--amber); }
.cd-cell.expired  { color: var(--text-faint); }
.cd-cell.active   { color: var(--cyan); }

/* ==========================================================================
   Flux d'activité (logs terminal)
   ========================================================================== */
.log-stream {
  margin-top: 12px;
  max-height: 460px;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.8rem;
  line-height: 1.7;
}
.log-line {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1px 0;
}
.log-line .lg-time { color: var(--text-faint); }
.log-line .lg-prompt { color: var(--green); margin: 0 6px; }
.log-line .lg-type { font-weight: 600; }
.log-line .lg-owner { color: var(--text); }
.log-line .lg-token { color: var(--text-muted); }
.log-line .lg-detail { color: var(--text-muted); }
.log-line .lg-ip { color: var(--text-faint); }
/* couleurs par type d'évènement */
.log-line.t-created   .lg-type,
.log-line.t-finalized .lg-type { color: var(--green-neon); }
.log-line.t-download     .lg-type,
.log-line.t-zip_download .lg-type { color: var(--cyan); }
.log-line.t-deleted .lg-type { color: var(--amber); }
.log-line.t-expired .lg-type { color: var(--text-muted); }

/* ==========================================================================
   Page de téléchargement
   ========================================================================== */
.dl-head { margin-bottom: 6px; }
.dl-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.0rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  word-break: break-word;
}

.dl-stats {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 16px 0 4px;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.86rem;
  color: var(--text-muted);
}
.stat b { color: var(--text); font-weight: 600; }
.countdown { color: var(--cyan); }
.countdown.expiring { color: var(--amber); animation: pulseWarn 1.6s var(--ease) infinite; }
@keyframes pulseWarn { 50% { opacity: 0.5; } }

.dl-files { margin-top: 18px; }
.dl-files .file-row { align-items: center; }
.file-dl { flex: 0 0 auto; }
.file-dl[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

.dl-actions { margin-top: 18px; }

.password-block { max-width: 380px; }
.password-block .field { margin-bottom: 4px; }

/* Échelonnement de l'apparition des fichiers. */
.file-row:nth-child(1) { animation-delay: 0.02s; }
.file-row:nth-child(2) { animation-delay: 0.06s; }
.file-row:nth-child(3) { animation-delay: 0.10s; }
.file-row:nth-child(4) { animation-delay: 0.14s; }
.file-row:nth-child(5) { animation-delay: 0.18s; }
.file-row:nth-child(n+6) { animation-delay: 0.22s; }

/* ==========================================================================
   Spinner de chargement
   ========================================================================== */
.spinner {
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 3px solid var(--border);
  border-top-color: var(--green-neon);
  margin: 4px auto;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 20px -6px var(--green-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Pied de page
   ========================================================================== */
.site-footer {
  padding: 22px 0 30px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-faint);
  text-align: center;
}
.site-footer .foot-brand { color: var(--text-muted); }
.site-footer .dot { opacity: 0.6; }

/* ==========================================================================
   Titres de contenu : Outfit (au lieu de Syne 800, jugé trop étiré).
   Syne reste réservé au logo/wordmark (marque My New IT).
   ========================================================================== */
.hero-title,
.dl-title,
.panel-title {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* ==========================================================================
   Transition d'états (compose → progress → result)
   ========================================================================== */
.state-enter { animation: stateEnter 0.45s var(--ease) both; }
@keyframes stateEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
  .options-grid { grid-template-columns: 1fr; }
  .pct { font-size: 1.25rem; }
  .result-actions .btn { width: 100%; }
  .link-box { flex-wrap: wrap; }
  .link-box .btn { width: 100%; }
  .tab span:first-child { display: none; }
  .ti-top { flex-direction: column; }
  .ti-side { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; }
}

/* ==========================================================================
   Accessibilité — réduction des animations
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .glow { animation: none; }
  .progress-bar::after { display: none; }
  .progress-bar.indeterminate { animation: none; }
}

/* ==========================================================================
   Dashboards (Mon dashboard + Admin) — KPIs, graphiques SVG, mise en page
   ========================================================================== */
.dash-head { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin:0 0 18px; }
.dash-head .panel-title { margin:0; }

.kpi-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(158px, 1fr)); gap:12px; margin-bottom:20px; }
.kpi {
  position:relative; display:flex; align-items:center; gap:13px;
  padding:15px 16px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:linear-gradient(180deg, rgba(255,255,255,.022), rgba(0,0,0,.18));
  overflow:hidden; transition:border-color .2s var(--ease), transform .2s var(--ease);
}
.kpi:hover { border-color:var(--green-line); transform:translateY(-2px); }
.kpi::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--green); box-shadow:0 0 14px var(--green-glow); }
.kpi.accent::before { background:var(--green-neon); }
.kpi.warn::before { background:var(--amber); box-shadow:0 0 14px rgba(245,158,11,.45); }
.kpi-ic { font-size:1.55rem; line-height:1; filter:drop-shadow(0 0 6px var(--green-glow)); }
.kpi-body { min-width:0; }
.kpi-val { display:block; font-family:var(--font-ui); font-weight:600; font-size:1.55rem; line-height:1; letter-spacing:-.02em; color:var(--text); }
.kpi-lbl { display:block; font-size:.7rem; text-transform:uppercase; letter-spacing:.07em; color:var(--text-muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.chart-card .card-body { padding-top:18px; }
.chart-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
@media (max-width:620px) { .chart-grid { grid-template-columns:1fr; } }
.chart-block { min-width:0; }
.chart-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:10px; }
.chart-title { font-family:var(--font-ui); font-size:.9rem; font-weight:600; color:var(--text); }
.chart-sub { font-size:.72rem; color:var(--text-muted); font-family:var(--font-mono); }
.chart { height:104px; width:100%; }
.bars { display:block; width:100%; height:100%; }
.bars .bar { fill:var(--green); opacity:.5; transition:opacity .15s; }
.bars .bar:hover { opacity:1; }
.bars .bar-empty { fill:var(--border); opacity:.55; }
.bars .bar-today { fill:var(--green-neon); opacity:.95; }
.chart-axis { display:flex; justify-content:space-between; margin-top:7px; font-size:.64rem; color:var(--text-faint); font-family:var(--font-mono); }

/* ==========================================================================
   Tables responsives — ZÉRO scroll horizontal (cartes empilées < 900px)
   ========================================================================== */
.kpi-lbl { white-space:normal; }   /* libellés KPI : on laisse passer à la ligne plutôt que tronquer */

.table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.data-table { width:100%; border-collapse:collapse; table-layout:auto; }
.data-table th, .data-table td { padding:9px 10px; vertical-align:middle; }
.data-table th { white-space:nowrap; }
.data-table td.t-title, .data-table td.owner { white-space:normal; word-break:break-word; }

@media (max-width:900px) {
  .table-wrap { overflow-x:visible; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display:block; width:100%; }
  /* en-tête masqué (les libellés passent dans data-label) */
  .data-table thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
  .data-table tr {
    border:1px solid var(--border); border-radius:var(--radius-sm);
    padding:6px 13px; margin-bottom:11px;
    background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.15));
  }
  .data-table td {
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:8px 0; border-bottom:1px dashed var(--border);
    text-align:right; white-space:normal; word-break:break-word;
  }
  .data-table td:last-child { border-bottom:0; }
  .data-table td::before {
    content:attr(data-label); flex:0 0 auto; text-align:left;
    color:var(--text-muted); font-size:.72rem; font-weight:500;
    text-transform:uppercase; letter-spacing:.05em;
  }
}
