/* web/public/styles.css — Slideo · design system moderne (clair + sombre) */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f7fc;
  --grad-1: rgba(109, 94, 252, 0.14);
  --grad-2: rgba(16, 185, 129, 0.10);
  --surface: #ffffff;
  --surface-2: #f2f4fb;
  --surface-3: #e9edf7;
  --border: #e6e9f2;
  --border-strong: #d6dbe9;
  --text: #14161f;
  --text-2: #3c4356;
  --muted: #6b7386;
  --primary: #6d5efc;
  --primary-2: #8b7dff;
  --primary-ink: #ffffff;
  --accent: #10b981;
  --accent-ink: #05372a;
  --danger: #e5484d;
  --warn: #c67b0c;
  --shadow-sm: 0 1px 2px rgba(20, 22, 31, 0.06), 0 1px 3px rgba(20, 22, 31, 0.04);
  --shadow-md: 0 6px 20px rgba(24, 27, 45, 0.08);
  --shadow-lg: 0 24px 60px rgba(31, 26, 79, 0.16);
  --ring: 0 0 0 3px rgba(109, 94, 252, 0.32);
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-xl: 22px;
  --fs: 15px;
}

/* Sombre : auto (système) sauf si l'utilisateur force le clair */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0a0c12;
    --grad-1: rgba(109, 94, 252, 0.20);
    --grad-2: rgba(34, 211, 166, 0.10);
    --surface: #14171f;
    --surface-2: #1b1f2a;
    --surface-3: #232838;
    --border: #262b38;
    --border-strong: #333a4b;
    --text: #eaedf6;
    --text-2: #c3c9d7;
    --muted: #8b93a7;
    --primary: #8778ff;
    --primary-2: #a99cff;
    --accent: #22d3a6;
    --accent-ink: #062b21;
    --danger: #ff6b6b;
    --warn: #f5b455;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.55);
    --ring: 0 0 0 3px rgba(135, 120, 255, 0.4);
  }
}
/* Sombre forcé */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0c12;
  --grad-1: rgba(109, 94, 252, 0.20);
  --grad-2: rgba(34, 211, 166, 0.10);
  --surface: #14171f;
  --surface-2: #1b1f2a;
  --surface-3: #232838;
  --border: #262b38;
  --border-strong: #333a4b;
  --text: #eaedf6;
  --text-2: #c3c9d7;
  --muted: #8b93a7;
  --primary: #8778ff;
  --primary-2: #a99cff;
  --accent: #22d3a6;
  --accent-ink: #062b21;
  --danger: #ff6b6b;
  --warn: #f5b455;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 3px rgba(135, 120, 255, 0.4);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
/* Garantit que l'attribut `hidden` l'emporte sur nos règles display:flex/grid. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs);
  color: var(--text);
  background:
    radial-gradient(1000px 620px at 12% -8%, var(--grad-1), transparent 60%),
    radial-gradient(900px 560px at 105% 4%, var(--grad-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.02em; }
a { color: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.16em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  margin-bottom: 8px;
  backdrop-filter: saturate(1.4) blur(8px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}
.brand__logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 6px 16px rgba(109, 94, 252, 0.4);
}
.brand__logo .icon { width: 20px; height: 20px; vertical-align: 0; }
.brand__name { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}
.badge.is-mock { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.badge.is-real { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle .icon { width: 18px; height: 18px; vertical-align: 0; }
.theme-toggle .icon--sun { display: none; }
.theme-toggle .icon--moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon--sun { display: block; }
  :root:not([data-theme='light']) .theme-toggle .icon--moon { display: none; }
}
[data-theme='dark'] .theme-toggle .icon--sun { display: block; }
[data-theme='dark'] .theme-toggle .icon--moon { display: none; }
[data-theme='light'] .theme-toggle .icon--sun { display: none; }
[data-theme='light'] .theme-toggle .icon--moon { display: block; }

/* ---------- Hero ---------- */
.hero { text-align: center; margin: 18px 0 26px; }
.hero__title { margin: 0 0 10px; font-size: clamp(26px, 5vw, 38px); font-weight: 800; line-height: 1.1; }
.grad {
  background: linear-gradient(100deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__tag { margin: 0 auto; max-width: 52ch; color: var(--muted); font-size: 15px; }

/* ---------- Steps ---------- */
.steps {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}
.step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.step.is-active { color: var(--text); border-color: var(--primary); }
.step.is-active span { background: var(--primary); color: #fff; }
.step.is-done { color: var(--text); }
.step.is-done span { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 560px) {
  .steps { gap: 6px; }
  .step { font-size: 0; padding: 9px; justify-content: center; }
  .step span { width: 24px; height: 24px; }
}

/* ---------- Card & panels ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.panel { padding: 26px; }
@media (max-width: 560px) { .panel { padding: 20px; } }
.panel__title { margin: 0 0 18px; font-size: 18px; font-weight: 700; }

/* ---------- Fields & selects ---------- */
.field { margin-bottom: 22px; }
.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}
.field__label .icon { color: var(--muted); margin-right: 2px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid .field { margin-bottom: 0; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

select {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7386' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:hover { border-color: var(--primary); }
select:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* ---------- Presets ---------- */
.presets { margin-bottom: 22px; }
.presets__row { display: flex; gap: 8px; }
.presets__row select { flex: 1; }

/* ---------- Dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px 20px;
  border: 1.6px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.dropzone:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface-2)); }
.dropzone:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.dropzone.is-drag { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface-2)); transform: scale(1.01); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.dropzone__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.dropzone__icon .icon { width: 26px; height: 26px; vertical-align: 0; }
.dropzone.has-file .dropzone__icon { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dropzone__text strong { display: block; font-size: 15px; }
.dropzone__text span { font-size: 13px; color: var(--muted); }
.dropzone__file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}

/* ---------- Interrupteurs ---------- */
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.toggle input:checked + .toggle__track { background: var(--primary); border-color: var(--primary); }
.toggle input:checked + .toggle__track .toggle__thumb { transform: translateX(18px); }
.toggle input:focus-visible + .toggle__track { box-shadow: var(--ring); }
.toggle__text { display: flex; flex-direction: column; font-size: 14px; }
.toggle__text small { color: var(--muted); font-size: 12px; }

/* ---------- Volet « avancé » ---------- */
.advanced {
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
}
.advanced > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary .icon { color: var(--muted); }
.advanced__chev {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
}
.advanced[open] .advanced__chev { transform: rotate(-135deg); }
.advanced__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 15px 16px;
}

/* ---------- Estimation ---------- */
.estimate {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 13.5px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.estimate .icon { color: var(--accent); }
.estimate b { color: var(--accent); font-weight: 700; }
.estimate small { color: var(--muted); }
.estimate.is-loading { background: var(--surface-2); border-color: var(--border); color: var(--muted); }
.estimate.is-loading .icon { color: var(--muted); }
.estimate.is-paid { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.estimate.is-paid .icon, .estimate.is-paid b { color: var(--warn); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  height: 48px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s, filter 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn .icon { width: 18px; height: 18px; vertical-align: 0; }
.btn--primary {
  width: 100%;
  color: var(--primary-ink);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(109, 94, 252, 0.35);
}
.btn--primary:hover { filter: brightness(1.06); box-shadow: 0 12px 28px rgba(109, 94, 252, 0.42); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; filter: none; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

.iconbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.iconbtn:hover { border-color: var(--primary); color: var(--primary); }
.iconbtn:focus-visible { outline: none; box-shadow: var(--ring); }
.iconbtn.is-danger:hover { border-color: var(--danger); color: var(--danger); }
.iconbtn .icon { width: 17px; height: 17px; vertical-align: 0; }

.linkbtn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 4px;
}
.linkbtn:hover { text-decoration: underline; }

.error { color: var(--danger); font-size: 14px; margin: 0 0 14px; }

/* ---------- Progression ---------- */
.progress {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  background-size: 200% 100%;
  transition: width 0.4s ease;
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer { to { background-position: 200% 0; } }
.progress__meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--muted); }
.progress__meta span:first-child { font-weight: 700; color: var(--text); }
.stages { list-style: none; padding: 0; margin: 22px 0 0; }
.stages li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.stages .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}
.stages li.is-active { color: var(--text); }
.stages li.is-active .dot { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); animation: pulse 1.2s infinite; }
.stages li.is-done { color: var(--text); }
.stages li.is-done .dot { background: var(--accent); border-color: var(--accent); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 4%, transparent); } }

/* ---------- Résultat ---------- */
.result { text-align: center; }
.result__preview { margin: 0 0 18px; }
.result__preview video {
  width: 100%;
  max-height: 46vh;
  border-radius: var(--r);
  background: #000;
  border: 1px solid var(--border);
  display: block;
}
.result__hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.result__icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 12px;
  border-radius: 50%;
}
.result__icon .icon { width: 34px; height: 34px; vertical-align: 0; stroke-width: 2.2; }
.result__icon--ok { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.result__icon--err { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.result--error .panel__title { color: var(--danger); }
.result__meta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px 20px;
  justify-content: center;
  margin: 0 0 18px;
  font-size: 14px;
}
.result__meta dt { color: var(--muted); text-align: right; }
.result__meta dd { margin: 0; font-weight: 600; text-align: left; }
.result__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.result__actions .btn { width: auto; }

.note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  font-size: 13px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--r);
  padding: 11px 14px;
  margin: 0 0 18px;
}
.note .icon { margin-top: 1px; }

/* ---------- Historique ---------- */
.history {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.history__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.history__head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 16px; }
.history__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
}
.history__list { list-style: none; margin: 0; padding: 0; }
.history__empty { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.hitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.hitem:first-child { border-top: none; }
.hitem__main { flex: 1; min-width: 0; }
.hitem__title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hitem__meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hstate {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.hstate--completed { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.hstate--failed { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.hstate--running, .hstate--queued { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.hitem__actions { display: flex; gap: 6px; flex-shrink: 0; }
.hitem__actions .iconbtn { width: 36px; height: 36px; }
@media (max-width: 520px) { .hitem__meta { white-space: normal; } }

/* ---------- Footer ---------- */
.foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--muted); }
.foot code { font-size: 11px; }

/* ---------- Champs texte ---------- */
.input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--primary); }
.input:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* ---------- Puce utilisateur ---------- */
.userchip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.userchip__avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.userchip__name { font-size: 13px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip__logout {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.userchip__logout:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.userchip__logout .icon { width: 15px; height: 15px; vertical-align: 0; }
@media (max-width: 560px) { .userchip__name { display: none; } }

/* ---------- Puce de crédits ---------- */
.credits-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, color 0.15s;
}
.credits-chip:hover { border-color: var(--primary); color: var(--primary); }
.credits-chip .icon { width: 16px; height: 16px; vertical-align: 0; color: var(--warn); }
.credits-chip.is-low { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.credits-chip.is-low .icon { color: var(--danger); }
.credits-chip__plus {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  font-size: 14px;
  line-height: 1;
}

/* ---------- Fenêtre modale ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 12, 20, 0.55); backdrop-filter: blur(3px); }
.modal__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal__head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 18px; }
.modal__head .icon { color: var(--warn); }
.modal__close { border: none; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal__close:hover { color: var(--text); }
.modal__sub { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.modal__note { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.pack:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface-2)); }
.pack:active { transform: translateY(1px); }
.pack__credits { font-size: 14px; font-weight: 700; }
.pack__eur { font-size: 13px; color: var(--primary); font-weight: 700; }

/* ---------- Écran d'authentification ---------- */
.auth {
  display: flex;
  justify-content: center;
  padding: 24px 0 48px;
}
.auth__card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
}
.auth__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth__brand .brand__logo { width: 34px; height: 34px; }
.auth__brand .brand__logo .icon { width: 18px; height: 18px; }
.auth__brand .brand__name { font-size: 18px; font-weight: 800; }
.auth__title { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.auth__sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth__card .field { margin-bottom: 16px; }
.auth__card .btn--primary { margin-top: 4px; }
.auth__switch { margin: 18px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth__switch .linkbtn { font-size: 13.5px; }

/* ---------- Accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
