/* ==========================================================================
   Maclink Digital — feuille de style principale
   Tokens sémantiques + composants. Voir design-system/MASTER.md
   ========================================================================== */

/* ---------- Tokens : thème clair (par défaut) ---------- */
:root {
  --brand-900: #002a78;
  --brand-800: #0038a0;
  --brand-700: #0047bb;
  --brand-600: #0356d4;
  --brand-500: #2f7bf0;
  --orange-600: #c9560f;
  --orange-500: #e26a1d;
  --orange-400: #f2873f;

  --bg: #f4f6fb;
  --bg-elev: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --surface-3: #e8edf6;
  --border: #e1e7f0;
  --border-strong: #cbd5e3;
  --text: #0b1324;
  --text-2: #475569;
  --text-3: #5f6e84;
  --primary: #0047bb;
  --primary-hover: #003a99;
  --btn-primary: #0047bb;
  --btn-primary-hover: #003a99;
  --primary-soft: #e8f0fe;
  --primary-soft-2: #d6e4fd;
  --on-primary: #ffffff;
  --accent: #e26a1d;
  --accent-strong: #b4480a;
  --accent-soft: #fdeee3;
  --btn-accent: #d45f14;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --gold: #b7791f;
  --silver: #64748b;
  --bronze: #a0522d;
  --ring: rgba(3, 86, 212, 0.45);
  --scrim: rgba(7, 11, 22, 0.55);
  --glass: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.18), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
  --grad-brand: linear-gradient(135deg, #0038a0 0%, #0356d4 100%);
  --grad-hero: radial-gradient(1200px 500px at 85% -10%, rgba(3, 86, 212, 0.14), transparent 60%),
    radial-gradient(800px 400px at -10% 20%, rgba(226, 106, 29, 0.1), transparent 60%);
  --grid-line: rgba(15, 23, 42, 0.05);

  --font-head: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 200ms;
  --sidebar-w: 268px;
  --topbar-h: 68px;
  --bottomnav-h: 68px;
  --z-sticky: 20;
  --z-nav: 40;
  --z-overlay: 100;
  --z-toast: 1000;
  color-scheme: light;
}

/* ---------- Tokens : thème sombre ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b16;
    --bg-elev: #0a1020;
    --surface: #0e1526;
    --surface-2: #131c31;
    --surface-3: #1a253e;
    --border: #1f2b45;
    --border-strong: #2c3b5c;
    --text: #eef2fa;
    --text-2: #a9b4ca;
    --text-3: #8d9ab3;
    --primary: #5b9bff;
    --primary-hover: #7eb1ff;
    --btn-primary: #1f63e6;
    --btn-primary-hover: #2f72f2;
    --primary-soft: rgba(91, 155, 255, 0.13);
    --primary-soft-2: rgba(91, 155, 255, 0.22);
    --accent: #f2873f;
    --accent-strong: #f59e5b;
    --accent-soft: rgba(242, 135, 63, 0.14);
    --btn-accent: #d45f14;
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.13);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.13);
    --gold: #f5c451;
    --silver: #cbd5e1;
    --bronze: #e39a6a;
    --ring: rgba(91, 155, 255, 0.55);
    --scrim: rgba(0, 0, 0, 0.62);
    --glass: rgba(10, 16, 32, 0.78);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
    --grad-hero: radial-gradient(1200px 500px at 85% -10%, rgba(47, 123, 240, 0.2), transparent 60%),
      radial-gradient(800px 400px at -10% 20%, rgba(226, 106, 29, 0.12), transparent 60%);
    --grid-line: rgba(255, 255, 255, 0.04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070b16;
  --bg-elev: #0a1020;
  --surface: #0e1526;
  --surface-2: #131c31;
  --surface-3: #1a253e;
  --border: #1f2b45;
  --border-strong: #2c3b5c;
  --text: #eef2fa;
  --text-2: #a9b4ca;
  --text-3: #8d9ab3;
  --primary: #5b9bff;
  --primary-hover: #7eb1ff;
  --btn-primary: #1f63e6;
  --btn-primary-hover: #2f72f2;
  --primary-soft: rgba(91, 155, 255, 0.13);
  --primary-soft-2: rgba(91, 155, 255, 0.22);
  --accent: #f2873f;
  --accent-strong: #f59e5b;
  --accent-soft: rgba(242, 135, 63, 0.14);
  --btn-accent: #d45f14;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.13);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --gold: #f5c451;
  --silver: #cbd5e1;
  --bronze: #e39a6a;
  --ring: rgba(91, 155, 255, 0.55);
  --scrim: rgba(0, 0, 0, 0.62);
  --glass: rgba(10, 16, 32, 0.78);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
  --grad-hero: radial-gradient(1200px 500px at 85% -10%, rgba(47, 123, 240, 0.2), transparent 60%),
    radial-gradient(800px 400px at -10% 20%, rgba(226, 106, 29, 0.12), transparent 60%);
  --grid-line: rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.015em;
  font-weight: 700;
}
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary-soft-2); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: var(--z-toast);
  background: var(--btn-primary); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 16px; color: #fff; }

.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 13px; }
.text-lg { font-size: 18px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-accent { color: var(--accent-strong); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Layout utilitaires ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
@media (min-width: 768px) { .grid, .grid-2, .grid-3, .grid-4 { gap: 20px; } }

/* ---------- Icônes ---------- */
.icon { display: inline-block; vertical-align: -0.22em; width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- Logo (bascule clair/sombre) ---------- */
.logo { display: inline-flex; align-items: center; }
.logo img { height: 40px; width: auto; }
.logo .logo-d { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .logo-l { display: none; }
  :root:not([data-theme="light"]) .logo .logo-d { display: block; }
}
:root[data-theme="dark"] .logo .logo-l { display: none; }
:root[data-theme="dark"] .logo .logo-d { display: block; }

/* ---------- Boutons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap;
  cursor: pointer; text-decoration: none; user-select: none;
  touch-action: manipulation;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 120ms var(--ease);
}
.btn:hover { color: var(--btn-fg); border-color: var(--text-3); }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { --btn-bg: var(--btn-primary); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 6px 16px -6px rgba(0, 71, 187, 0.55); }
.btn-primary:hover { --btn-bg: var(--btn-primary-hover); border-color: transparent; }
.btn-accent { --btn-bg: var(--btn-accent); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 6px 16px -6px rgba(212, 95, 20, 0.55); }
.btn-accent:hover { --btn-bg: #bd520f; border-color: transparent; }
.btn-soft { --btn-bg: var(--primary-soft); --btn-fg: var(--primary); --btn-bd: transparent; }
.btn-soft:hover { --btn-bg: var(--primary-soft-2); border-color: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--surface-2); --btn-fg: var(--text); border-color: transparent; }
.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: transparent; }
.btn-danger:hover { border-color: var(--danger); }
.btn-success { --btn-bg: var(--success-soft); --btn-fg: var(--success); --btn-bd: transparent; }
.btn-success:hover { border-color: var(--success); }
.btn-white { --btn-bg: #fff; --btn-fg: #0038a0; --btn-bd: transparent; }
.btn-white:hover { --btn-bg: #eef3ff; --btn-fg: #0038a0; border-color: transparent; }
.btn-glass { --btn-bg: rgba(255, 255, 255, 0.14); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.28); }
.btn-glass:hover { --btn-bg: rgba(255, 255, 255, 0.22); --btn-fg: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn .spinner { width: 18px; height: 18px; }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn { color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.link-btn:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
@media (min-width: 768px) { .card-pad { padding: 24px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 18px; font-weight: 700; font-family: var(--font-head); }
.card-link { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-brand { background: var(--grad-brand); color: #fff; border: 0; position: relative; overflow: hidden; }
.card-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px 200px at 110% -20%, rgba(226, 106, 29, 0.55), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 22px);
}
.card-brand > * { position: relative; z-index: 1; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge .icon { width: 14px; height: 14px; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-glass { background: rgba(255, 255, 255, 0.16); color: #fff; backdrop-filter: blur(6px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 40px; padding: 8px 14px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .icon { width: 16px; height: 16px; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 16px; }
.label { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.label .req { color: var(--danger); margin-left: 3px; margin-right: auto; }
.label .opt { font-weight: 500; color: var(--text-3); font-size: 13px; }
.help { font-size: 13px; color: var(--text-3); }
.error-text { font-size: 13px; color: var(--danger); display: flex; gap: 6px; align-items: flex-start; font-weight: 500; }
.error-text .icon { width: 16px; height: 16px; margin-top: 1px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1.5px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 0.85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); border-style: dashed; }
.select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { flex: 1; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group .input.has-icon { padding-left: 44px; }
.input-action {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--text-3);
}
.input-action:hover { color: var(--text); background: var(--surface-2); }
.phone-group { display: grid; grid-template-columns: minmax(118px, 38%) 1fr; gap: 8px; }
.pin-input { letter-spacing: 0.5em; font-weight: 700; font-size: 20px; text-align: left; padding-right: 48px; }

.check {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  font-size: 14.5px; color: var(--text-2); line-height: 1.5; padding: 4px 0;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none; width: 24px; height: 24px; margin-top: 0; border-radius: 7px;
  border: 2px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: transparent;
  transition: all var(--dur) var(--ease);
}
.check .box .icon { width: 16px; height: 16px; stroke-width: 3; }
.check input:checked + .box { background: var(--btn-primary); border-color: var(--btn-primary); color: #fff; }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--ring); }
.check input[aria-invalid="true"] + .box { border-color: var(--danger); }

.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 380px; }
.otp input {
  width: 100%; aspect-ratio: 1 / 1.15; min-height: 52px; text-align: center;
  font-size: 24px; font-weight: 700; font-family: var(--font-head);
  border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--surface);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.otp input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.otp input.filled { border-color: var(--primary); background: var(--primary-soft); }
.otp.is-error input { border-color: var(--danger); animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Segmented */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.segmented button {
  min-height: 38px; padding: 6px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: all var(--dur) var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; min-height: 46px; padding: 10px 14px; font-weight: 600; font-size: 15px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.tab .count { font-size: 12px; background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 1px 8px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-3); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Liste (alternative mobile aux tableaux) */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { font-size: 13px; color: var(--text-3); }

/* ---------- Avatars ---------- */
.avatar {
  --size: 40px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--font-head); font-weight: 700; font-size: calc(var(--size) * 0.38);
  color: #fff; background: var(--grad-brand);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { --size: 32px; }
.avatar-lg { --size: 56px; }
.avatar-xl { --size: 88px; }
.av-0 { background: linear-gradient(135deg, #0038a0, #2f7bf0); }
.av-1 { background: linear-gradient(135deg, #c2410c, #f97316); }
.av-2 { background: linear-gradient(135deg, #115e59, #14b8a6); }
.av-3 { background: linear-gradient(135deg, #9d174d, #ec4899); }
.av-4 { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.av-5 { background: linear-gradient(135deg, #14532d, #22c55e); }
.av-6 { background: linear-gradient(135deg, #78350f, #f59e0b); }
.av-7 { background: linear-gradient(135deg, #312e81, #6366f1); }

/* ---------- Progression ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); transition: width 400ms var(--ease); }
.progress.accent > span { background: linear-gradient(90deg, var(--orange-500), var(--orange-400)); }
.progress-sm { height: 6px; }

/* ---------- Statistiques ---------- */
.stat { padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.stat-value { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--text-3); margin-left: 4px; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat-icon.accent { background: var(--accent-soft); color: var(--accent-strong); }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-foot { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
@media (min-width: 768px) { .stat { padding: 20px; } .stat-value { font-size: 28px; } }

/* ---------- Alertes / bannières ---------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14.5px; align-items: flex-start; }
.alert .icon { margin-top: 1px; }
.alert-info { background: var(--primary-soft); border-color: transparent; color: var(--text); }
.alert-info > .icon { color: var(--primary); }
.alert-warning { background: var(--warning-soft); border-color: transparent; }
.alert-warning > .icon { color: var(--warning); }
.alert-success { background: var(--success-soft); border-color: transparent; }
.alert-success > .icon { color: var(--success); }
.alert-danger { background: var(--danger-soft); border-color: transparent; }
.alert-danger > .icon { color: var(--danger); }

.demo-note {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px;
  border: 1.5px dashed var(--accent); background: var(--accent-soft); color: var(--text); font-size: 14px;
}
.demo-note .icon { color: var(--accent-strong); }
.demo-note strong { font-family: var(--font-head); letter-spacing: 0.08em; }

/* ---------- Etats vides / skeleton ---------- */
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-2); }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); margin-bottom: 6px; }
.empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 18px; color: var(--text); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: #0b1324; color: #fff; box-shadow: var(--shadow-lg); font-size: 14.5px; font-weight: 500;
  animation: toast-in 240ms var(--ease);
}
:root[data-theme="dark"] .toast { background: #1d2a46; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #1d2a46; } }
.toast.success .icon { color: #4ade80; }
.toast.error .icon { color: #f87171; }
.toast.info .icon { color: #7eb1ff; }
.toast.out { animation: toast-out 160ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Modales & feuilles ---------- */
.overlay { position: fixed; inset: 0; z-index: var(--z-overlay); background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade-in 180ms var(--ease); backdrop-filter: blur(2px); }
@media (min-width: 640px) { .overlay { align-items: center; padding: 24px; } }
.modal {
  width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  animation: sheet-in 260ms var(--ease); padding-bottom: env(safe-area-inset-bottom);
}
.modal-lg { max-width: 760px; }
@media (min-width: 640px) { .modal { border-radius: 24px; animation: pop-in 220ms var(--ease); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; flex-wrap: wrap; }
.modal-foot .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .modal-foot .btn { flex: 0 0 auto; } }
.grabber { width: 40px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 10px auto 0; }
@media (min-width: 640px) { .grabber { display: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop-in { from { transform: scale(0.96) translateY(8px); opacity: 0; } }

/* ---------- Couvertures générées (formations / catégories) ---------- */
.cover {
  --c1: #0b3c9e; --c2: #2563eb;
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.22) 0 18%, transparent 18.5%),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.1) 0 32%, transparent 32.5%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 16px);
}
.cover .cover-icon { position: absolute; right: 18px; top: 16px; width: 30%; max-width: 72px; height: auto; aspect-ratio: 1; stroke: #fff; opacity: 0.95; stroke-width: 1.5; }
.cat-tech { --c1: #0b3c9e; --c2: #2563eb; }
.cat-marketing { --c1: #b23a0b; --c2: #f97316; }
.cat-business { --c1: #0f4f4a; --c2: #0d9488; }
.cat-beauty { --c1: #8c1545; --c2: #e0327f; }
.cat-couple { --c1: #7a1231; --c2: #e11d48; }
.cat-culture { --c1: #43198a; --c2: #8b5cf6; }
.cat-finance { --c1: #124a28; --c2: #16a34a; }
.cat-growth { --c1: #2a2873; --c2: #6366f1; }
.cat-cooking { --c1: #6f300c; --c2: #d97706; }

/* ---------- Carte formation ---------- */
.course-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); height: 100%; }
.course-card:hover { color: var(--text); }
.course-card .cover { aspect-ratio: 16 / 9; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.course-card .cover .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.course-card .cover-title { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.1; max-width: 75%; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.course-card .body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-card .cat { font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary); }
.course-card h3 { font-size: 17px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card .meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-3); margin-top: auto; }
.course-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-card .meta .icon { width: 15px; height: 15px; }
.lock-pill { position: absolute; right: 12px; bottom: 12px; display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); font-size: 12.5px; font-weight: 600; }
.lock-pill .icon { width: 14px; height: 14px; }

/* ---------- Ebook ---------- */
.ebook-card { display: flex; flex-direction: column; gap: 12px; text-align: left; color: var(--text); width: 100%; }
.book {
  position: relative; aspect-ratio: 3 / 4; border-radius: 6px 14px 14px 6px; padding: 18px 16px 16px 24px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow), inset 6px 0 0 rgba(0, 0, 0, 0.18), inset 8px 0 0 rgba(255, 255, 255, 0.12);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ebook-card:hover .book { transform: translateY(-4px) rotate(-0.6deg); box-shadow: var(--shadow-lg), inset 6px 0 0 rgba(0, 0, 0, 0.18), inset 8px 0 0 rgba(255, 255, 255, 0.12); }
.book .book-brand { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; opacity: 0.85; }
.book { container-type: inline-size; }
.book .book-title { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.12; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@container (max-width: 170px) {
  .book .book-title { font-size: 15.5px; }
  .book .book-icon { width: 26px; height: 26px; margin-top: 10px; }
  .book .book-brand { font-size: 9px; letter-spacing: 0.12em; }
}
.book .book-author { font-size: 12px; opacity: 0.9; font-weight: 500; }
.book .book-icon { width: 34px; height: 34px; stroke: #fff; stroke-width: 1.6; opacity: 0.92; margin: 14px 0 auto; }

/* ==========================================================================
   Coquille applicative (sidebar / topbar / bottom nav)
   ========================================================================== */
.app { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: var(--z-nav);
  background: var(--surface); border-right: 1px solid var(--border);
  display: none; flex-direction: column; padding: 20px 16px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.sidebar > * { flex-shrink: 0; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
/* Écrans peu hauts : menu plus compact avant de devoir défiler */
@media (min-width: 1024px) and (max-height: 820px) {
  .sidebar { padding-top: 14px; padding-bottom: 14px; }
  .sidebar .nav-section { padding-top: 10px; padding-bottom: 4px; }
  .sidebar .nav a, .sidebar .nav button { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
}
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .app-main { margin-left: var(--sidebar-w); }
}
.sidebar .logo { padding: 4px 8px 20px; }
.sidebar .logo img { height: 44px; }
.nav-section { font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; padding: 16px 12px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; font-size: 15px; width: 100%; text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.nav a[aria-current="page"] .icon { stroke-width: 2.2; }
.nav .nav-badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.sidebar-promo { padding: 16px; border-radius: 16px; }
.sidebar-promo p { font-size: 13.5px; opacity: 0.92; margin: 6px 0 12px; }

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky); height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) { .topbar { padding: 0 32px; } }
.topbar .logo img { height: 34px; }
.topbar .page-title { font-size: 20px; font-weight: 700; font-family: var(--font-head); }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar .mobile-logo { display: flex; }
@media (min-width: 1024px) { .topbar .mobile-logo { display: none; } }
.topbar .desk-title { display: none; }
@media (min-width: 1024px) { .topbar .desk-title { display: block; } }
.lang-btn { font-weight: 700; font-size: 13px; letter-spacing: 0.04em; min-width: 44px; }
.user-btn { display: inline-flex; align-items: center; gap: 10px; padding: 4px; padding-right: 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); min-height: 44px; }
.user-btn:hover { border-color: var(--border-strong); }
.user-btn .name { font-weight: 600; font-size: 14px; display: none; }
@media (min-width: 768px) { .user-btn .name { display: inline; } }
.balance-pill { display: none; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 14px; min-height: 40px; }
.balance-pill:hover { color: var(--accent-strong); filter: brightness(0.97); }
.balance-pill .icon { width: 18px; height: 18px; }
@media (min-width: 640px) { .balance-pill { display: inline-flex; } }

.app-content { padding: 20px 16px calc(var(--bottomnav-h) + 32px + env(safe-area-inset-bottom)); max-width: 1280px; margin: 0 auto; }
@media (min-width: 768px) { .app-content { padding: 28px 32px calc(var(--bottomnav-h) + 40px); } }
@media (min-width: 1024px) { .app-content { padding: 32px 40px 56px; } }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 54px; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--text-3);
}
.bottom-nav a[aria-current="page"], .bottom-nav button[aria-expanded="true"] { color: var(--primary); }
.bottom-nav a[aria-current="page"] .ico-wrap { background: var(--primary-soft); }
.bottom-nav .ico-wrap { width: 48px; height: 28px; border-radius: 99px; display: grid; place-items: center; transition: background var(--dur); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(24px, 3.2vw, 32px); }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 60ch; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; }
@media (min-width: 768px) { .section { margin-top: 40px; } .section-head h2 { font-size: 22px; } }

/* Bandeau activation */
.activate-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 20px;
  background: linear-gradient(120deg, #b4480a, #e26a1d 55%, #f2873f); color: #fff; position: relative; overflow: hidden;
}
.activate-banner::after { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, 0.1); }
.activate-banner .ab-icon { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, 0.18); display: grid; place-items: center; flex: none; }
.activate-banner .ab-text { flex: 1 1 260px; position: relative; z-index: 1; }
.activate-banner h3 { font-size: 18px; }
.activate-banner p { opacity: 0.95; font-size: 14.5px; margin-top: 2px; }
.activate-banner .btn { position: relative; z-index: 1; }

/* Feuille "Plus" mobile */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-grid a, .more-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 16px; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px; text-align: center; min-height: 88px; }
.more-grid a:hover, .more-grid button:hover { background: var(--surface-3); color: var(--text); }
.more-grid .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }

/* Menu utilisateur */
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: var(--z-overlay); animation: pop-in 160ms var(--ease); }
.menu-pop a, .menu-pop button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 14.5px; min-height: 44px; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); color: var(--text); }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-pop .danger { color: var(--danger); }

/* ==========================================================================
   Pages publiques (accueil, auth, page parrain)
   ========================================================================== */
.public-header {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.public-header .inner { height: 72px; display: flex; align-items: center; gap: 16px; }
.public-header .logo img { height: 40px; }
.public-nav { display: none; gap: 4px; margin-left: 24px; }
.public-nav a { color: var(--text-2); font-weight: 600; font-size: 15px; padding: 10px 12px; border-radius: 10px; }
.public-nav a:hover { color: var(--text); background: var(--surface-2); }
@media (min-width: 1024px) { .public-nav { display: flex; } }
.public-header .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.hide-sm { display: none !important; }
@media (min-width: 640px) { .hide-sm { display: inline-flex !important; } }
.show-sm { display: inline-flex; }
@media (min-width: 640px) { .show-sm { display: none !important; } }

.hero { position: relative; overflow: hidden; background: var(--grad-hero); padding: 48px 0 64px; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
.hero .inner { position: relative; display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) { .hero { padding: 72px 0 96px; } .hero .inner { grid-template-columns: 1.05fr 1fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-sm); }
.eyebrow .pill { background: var(--accent-soft); color: var(--accent-strong); padding: 2px 10px; border-radius: 99px; font-weight: 700; }
.hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; margin-top: 20px; }
.hero h1 .hl { background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .hl-o { color: var(--accent); }
.hero .lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--text-2); margin-top: 20px; max-width: 54ch; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; }
.hero-proof .n { font-family: var(--font-head); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; }
.hero-proof .l { font-size: 13.5px; color: var(--text-3); }

/* Composition visuelle du hero */
.hero-visual { position: relative; min-height: 420px; }
.hv-card { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); }
.hv-main { inset: 0 8% 14% 0; overflow: hidden; display: flex; flex-direction: column; }
.hv-main .cover { flex: 1; padding: 22px; display: flex; flex-direction: column; justify-content: flex-start; }
.hv-main .cover h3 { font-size: 26px; font-weight: 800; max-width: 70%; }
.hv-main .cover-icon { display: none; }
.hv-main .foot { padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.hv-earn { right: 0; bottom: 0; width: 54%; padding: 18px; }
.hv-rank { right: 2%; top: 8%; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.play-btn { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: #0038a0; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.play-btn .icon { width: 22px; height: 22px; fill: currentColor; margin-left: 3px; }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: 12px; }
.mini-bars span { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--primary-soft-2); }
.mini-bars span.on { background: linear-gradient(180deg, var(--orange-400), var(--orange-500)); }
@media (max-width: 480px) { .hero-visual { min-height: 360px; } .hv-main .cover h3 { font-size: 21px; } }

.band { padding: 64px 0; }
.band-alt { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 1024px) { .band { padding: 96px 0; } }
.band-head { max-width: 680px; margin-bottom: 40px; }
.band-head.center { margin-left: auto; margin-right: auto; }
.band-head .kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-strong); }
.band-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.03em; margin-top: 10px; }
.band-head p { color: var(--text-2); margin-top: 14px; font-size: 17px; }

.cat-tile { display: flex; align-items: center; gap: 14px; padding: 16px; color: var(--text); }
.cat-tile:hover { color: var(--text); }
.cat-tile .ci { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.cat-tile .ci .icon { width: 24px; height: 24px; stroke: #fff; }
.cat-tile h3 { font-size: 16px; }
.cat-tile p { font-size: 13.5px; color: var(--text-3); }

.steps { display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.step { padding: 24px; position: relative; }
.step .num { font-family: var(--font-head); font-size: 56px; font-weight: 800; line-height: 1; color: var(--primary-soft-2); position: absolute; right: 20px; top: 16px; }
.step .si { width: 48px; height: 48px; border-radius: 14px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; margin-bottom: 16px; }
.step h3 { font-size: 19px; }
.step p { color: var(--text-2); margin-top: 8px; font-size: 15px; }

.aff-band { border-radius: 28px; padding: 32px 24px; display: grid; gap: 32px; }
@media (min-width: 1024px) { .aff-band { grid-template-columns: 1.1fr 1fr; padding: 56px; align-items: center; } }
.aff-band h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.aff-band ul { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 12px; }
.aff-band li { display: flex; gap: 12px; align-items: flex-start; }
.aff-band li .icon { color: #ffb482; margin-top: 2px; }
.calc { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px; padding: 24px; backdrop-filter: blur(8px); }
.calc .big { font-family: var(--font-head); font-size: clamp(36px, 5vw, 52px); font-weight: 800; letter-spacing: -0.03em; }
.range { width: 100%; accent-color: #f2873f; height: 32px; cursor: pointer; }

.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; display: flex; justify-content: space-between; gap: 16px; font-weight: 600; font-size: 17px; align-items: center; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform var(--dur) var(--ease); color: var(--text-3); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { padding: 0 0 20px; color: var(--text-2); max-width: 70ch; }

.testi { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.testi blockquote { margin: 0; font-size: 16px; color: var(--text); }
.stars { display: flex; gap: 2px; color: #f5a623; }
.stars .icon { width: 16px; height: 16px; fill: currentColor; }

.pay-strip { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pay-strip span { padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 14px; color: var(--text-2); }

.footer { border-top: 1px solid var(--border); padding: 48px 0 32px; background: var(--surface); }
.footer .cols { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 12px; font-family: var(--font-body); }
.footer a { display: block; color: var(--text-2); padding: 5px 0; font-size: 15px; }
.footer a:hover { color: var(--text); }
.footer .bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text-3); }

/* ---------- Auth (connexion / inscription) ---------- */
.auth { min-height: 100dvh; display: grid; }
@media (min-width: 1024px) { .auth { grid-template-columns: 1fr 1fr; } }
.auth-aside { display: none; position: relative; overflow: hidden; color: #fff; padding: 48px; background: var(--grad-brand); }
@media (min-width: 1024px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 100% 0%, rgba(226, 106, 29, 0.5), transparent 60%), repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 26px); pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .logo-chip { background: #fff; border-radius: 18px; padding: 10px 16px; display: inline-flex; width: fit-content; }
.auth-aside .logo-chip img { height: 44px; width: auto; }
.auth-aside h2 { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; max-width: 14ch; }
.auth-aside .points { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth-aside .points div { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-aside .points .pi { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; flex: none; }
.auth-main { display: flex; flex-direction: column; padding: 20px; background: var(--bg); }
@media (min-width: 768px) { .auth-main { padding: 32px 48px; } }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-top .logo img { height: 38px; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 32px 0; }
.auth-card h1 { font-size: clamp(26px, 4vw, 32px); font-weight: 800; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--text-2); margin-top: 8px; }

.stepper { display: flex; gap: 6px; margin: 24px 0 8px; }
.stepper span { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.stepper span.done::after, .stepper span.current::after { content: ""; position: absolute; inset: 0; background: var(--grad-brand); border-radius: inherit; }
.stepper span.current::after { animation: grow 400ms var(--ease); transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.step-label { font-size: 13px; font-weight: 700; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase; }
.screen { animation: screen-in 280ms var(--ease); }
.screen.back { animation: screen-back 280ms var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes screen-back { from { opacity: 0; transform: translateX(-18px); } }
.sponsor-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--success-soft); border: 1px solid transparent; }
.sponsor-card .icon { color: var(--success); }

.interest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.interest {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 16px;
  border: 1.5px solid var(--border); background: var(--surface); text-align: left; position: relative; min-height: 96px;
  transition: all var(--dur) var(--ease); font-weight: 600; font-size: 14.5px;
}
.interest:hover { border-color: var(--border-strong); }
.interest .ii { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); transition: all var(--dur); }
.interest[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.interest[aria-pressed="true"] .ii { background: var(--btn-primary); color: #fff; }
.interest .tick { position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--btn-primary); color: #fff; display: none; place-items: center; }
.interest .tick .icon { width: 14px; height: 14px; stroke-width: 3; }
.interest[aria-pressed="true"] .tick { display: grid; }

.option-list { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); text-align: left; font-weight: 600; min-height: 56px; transition: all var(--dur); width: 100%; }
.option:hover { border-color: var(--border-strong); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); }
.option .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; display: grid; place-items: center; margin-left: auto; }
.option[aria-pressed="true"] .radio, .option[aria-checked="true"] .radio { border-color: var(--primary); }
.option[aria-pressed="true"] .radio::after, .option[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

.success-mark { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); margin: 0 auto; animation: pop-in 400ms var(--ease); }
.success-mark .icon { width: 44px; height: 44px; stroke-width: 2.4; }

.demo-accounts { display: flex; flex-direction: column; gap: 8px; }
.demo-acc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border-strong); background: var(--surface); text-align: left; width: 100%; min-height: 56px; }
.demo-acc:hover { border-color: var(--primary); background: var(--primary-soft); }
.demo-acc .meta { flex: 1; min-width: 0; font-size: 13.5px; }
.demo-acc .meta strong { display: block; font-size: 14.5px; }

/* ---------- Page parrain (publique) ---------- */
.ref-hero { position: relative; overflow: hidden; color: #fff; padding: 40px 0 88px; }
.ref-hero .bg { position: absolute; inset: 0; background: var(--ref-grad, var(--grad-brand)); }
.ref-hero .bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 260px at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%), repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 24px); }
.ref-hero .inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ref-logo { width: 104px; height: 104px; border-radius: 28px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); font-family: var(--font-head); font-weight: 800; font-size: 36px; color: #0038a0; }
.ref-logo img { width: 100%; height: 100%; object-fit: cover; }
.ref-hero h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 800; letter-spacing: -0.03em; }
.ref-hero p.desc { max-width: 60ch; opacity: 0.95; font-size: 17px; white-space: pre-line; }
.ref-strip { margin-top: -48px; position: relative; }
.ref-strip .card { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.ref-strip .card > div { padding: 18px 8px; }
.ref-strip .card > div + div { border-left: 1px solid var(--border); }
.ref-strip .n { font-family: var(--font-head); font-weight: 800; font-size: 24px; }
.ref-strip .l { font-size: 13px; color: var(--text-3); }
.sticky-cta { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(14px); border-top: 1px solid var(--border); z-index: var(--z-sticky); }
.sticky-cta .inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.ref-grad-blue { --ref-grad: linear-gradient(135deg, #0038a0, #0356d4); }
.ref-grad-orange { --ref-grad: linear-gradient(135deg, #a8420a, #e26a1d); }
.ref-grad-teal { --ref-grad: linear-gradient(135deg, #0f4f4a, #0d9488); }
.ref-grad-violet { --ref-grad: linear-gradient(135deg, #3b1780, #7c3aed); }
.ref-grad-night { --ref-grad: linear-gradient(135deg, #0b1324, #1e2b4a); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 12px; border: 3px solid transparent; background: var(--ref-grad); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.swatch[aria-pressed="true"] { border-color: var(--text); }

/* ==========================================================================
   Pages applicatives
   ========================================================================== */
.welcome { padding: 24px; border-radius: 24px; display: grid; gap: 20px; }
@media (min-width: 768px) { .welcome { grid-template-columns: 1fr auto; align-items: center; padding: 32px; } }
.welcome h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
.welcome p { opacity: 0.92; margin-top: 6px; }
.welcome .wallet-mini { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 18px; padding: 16px 20px; min-width: 240px; backdrop-filter: blur(6px); }
.welcome .wallet-mini .v { font-family: var(--font-head); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.bento { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) { .bento { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.bento .span-2 { grid-column: span 2; }

.continue-card { display: flex; gap: 14px; padding: 14px; align-items: center; color: var(--text); }
.continue-card:hover { color: var(--text); }
.continue-card .cover { width: 96px; height: 72px; border-radius: 12px; flex: none; }
.continue-card .cover .cover-icon { width: 34px; right: 50%; top: 50%; transform: translate(50%, -50%); }
.continue-card h3 { font-size: 15.5px; line-height: 1.3; }

.ref-link-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.ref-link-box code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-brand .ref-link-box { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }
.card-brand .ref-link-box code { color: #fff; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.share-wa { background: #1faa53; color: #fff; }
.share-wa:hover { background: #178a43; color: #fff; }
.share-fb { background: #1877f2; color: #fff; }
.share-fb:hover { background: #0f63d1; color: #fff; }

/* Leaderboard */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.podium .p { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; min-width: 0; }
.podium .block { width: 100%; border-radius: 16px 16px 8px 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 12px 6px; color: #fff; font-family: var(--font-head); font-weight: 800; }
.podium .p1 .block { height: 150px; background: linear-gradient(180deg, #e2a21b, #b7791f); }
.podium .p2 .block { height: 112px; background: linear-gradient(180deg, #94a3b8, #64748b); }
.podium .p3 .block { height: 88px; background: linear-gradient(180deg, #d0875a, #a0522d); }
.podium .block .rank { font-size: 30px; line-height: 1; }
.podium .block .amt { font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.podium .who { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .p1 .avatar { box-shadow: 0 0 0 4px #f5c451; }
.rank-num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-family: var(--font-head); background: var(--surface-2); color: var(--text-2); flex: none; font-size: 14px; }
.rank-num.r1 { background: #fbe7b5; color: #7a4d06; }
.rank-num.r2 { background: #e2e8f0; color: #334155; }
.rank-num.r3 { background: #f6d6c2; color: #7a3413; }
.me-row { background: var(--primary-soft) !important; }
.prize-card { display: grid; gap: 16px; padding: 24px; border-radius: 24px; }
@media (min-width: 768px) { .prize-card { grid-template-columns: auto 1fr auto; align-items: center; } }
.prize-card .trophy { width: 72px; height: 72px; border-radius: 22px; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; }
.prize-card .trophy .icon { width: 36px; height: 36px; color: #ffd27a; }
.countdown { display: flex; gap: 8px; }
.countdown div { background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 12px; padding: 8px 10px; text-align: center; min-width: 58px; }
.countdown b { display: block; font-family: var(--font-head); font-size: 22px; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }

/* Graphique */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--brand-600); transition: opacity var(--dur); }
.chart .bar.zero { fill: var(--surface-3); }
.chart .bar:hover, .chart .bar:focus { fill: var(--accent); outline: none; }
.chart .gridline { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font-body); }
.chart .tip { position: absolute; pointer-events: none; background: #0b1324; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--shadow); }
:root[data-theme="dark"] .chart .bar { fill: #3d86f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart .bar { fill: #3d86f5; } }

/* Lecteur de formation */
.course-hero { border-radius: 24px; padding: 24px; display: grid; gap: 24px; }
@media (min-width: 1024px) { .course-hero { grid-template-columns: 1.4fr 1fr; padding: 36px; align-items: center; } }
.course-hero h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; }
.course-hero .facts { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.course-hero .facts span { display: inline-flex; gap: 6px; align-items: center; }
.course-hero .cover-box { aspect-ratio: 16/10; border-radius: 18px; }
.curriculum .chapter { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.curriculum .chapter + .chapter { margin-top: 12px; }
.curriculum summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; gap: 12px; align-items: center; min-height: 56px; }
.curriculum summary::-webkit-details-marker { display: none; }
.curriculum summary .ch-n { width: 34px; height: 34px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-family: var(--font-head); flex: none; }
.curriculum summary .chev { margin-left: auto; transition: transform var(--dur); color: var(--text-3); }
.curriculum details[open] summary .chev { transform: rotate(180deg); }
.lesson { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); color: var(--text); min-height: 52px; font-size: 15px; }
.lesson:hover { background: var(--surface-2); color: var(--text); }
.lesson .lt { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.lesson .lt .icon { width: 16px; height: 16px; }
.lesson.done .lt { background: var(--success-soft); color: var(--success); }
.lesson.current { background: var(--primary-soft); }
.lesson.locked { color: var(--text-3); }
.lesson .dur { margin-left: auto; font-size: 13px; color: var(--text-3); white-space: nowrap; }

.player-layout { display: grid; gap: 24px; }
@media (min-width: 1100px) { .player-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .player-side { position: sticky; top: calc(var(--topbar-h) + 20px); max-height: calc(100dvh - var(--topbar-h) - 40px); overflow: auto; } }
.video-box { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000; }
.video-box video { width: 100%; height: 100%; object-fit: cover; }
.video-box .poster { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: pointer; border: 0; width: 100%; }
.video-box .poster .play-btn { width: 76px; height: 76px; transition: transform var(--dur) var(--ease); }
.video-box .poster:hover .play-btn { transform: scale(1.06); }
.video-box .poster .play-btn .icon { width: 28px; height: 28px; }
.article { font-size: 17px; line-height: 1.75; max-width: 72ch; }
.article h2 { font-size: 24px; margin: 32px 0 12px; }
.article h3 { font-size: 19px; margin: 24px 0 8px; }
.article p { margin: 0 0 16px; color: var(--text); }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin: 6px 0; }
.article blockquote { margin: 20px 0; padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 12px 12px 0; }
.article .key { padding: 16px 18px; border-radius: 14px; background: var(--primary-soft); margin: 20px 0; }
.locked-panel { position: relative; border-radius: 20px; overflow: hidden; }
.locked-panel .veil { position: absolute; inset: 0; background: linear-gradient(180deg, transparent, var(--bg) 70%); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 24px; text-align: center; gap: 10px; }

/* Activation / paiement */
.pay-layout { display: grid; gap: 24px; }
@media (min-width: 1024px) { .pay-layout { grid-template-columns: 1fr 400px; align-items: start; } }
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.method { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; font-size: 14.5px; min-height: 60px; text-align: left; transition: all var(--dur); }
.method:hover { border-color: var(--border-strong); }
.method[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); }
.method .mi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; font-family: var(--font-head); }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; }
.summary-row + .summary-row { border-top: 1px dashed var(--border); }
.summary-total { font-family: var(--font-head); font-size: 28px; font-weight: 800; }
.benefits { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.benefits li { display: flex; gap: 12px; align-items: flex-start; }
.benefits .bi { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); flex: none; }
.benefits .bi .icon { width: 16px; height: 16px; stroke-width: 2.6; }

/* Portefeuille */
.wallet-card { padding: 24px; border-radius: 24px; }
.wallet-card .v { font-family: var(--font-head); font-size: clamp(34px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tx-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tx-in { background: var(--success-soft); color: var(--success); }
.tx-out { background: var(--danger-soft); color: var(--danger); }
.tx-pay { background: var(--primary-soft); color: var(--primary); }
.tx-bonus { background: var(--accent-soft); color: var(--accent-strong); }
.amount-in { color: var(--success); font-weight: 700; }
.amount-out { color: var(--text); font-weight: 700; }
.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Profil */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.settings-row:last-child { border-bottom: 0; }
.settings-row .sr-t { font-weight: 600; }
.settings-row .sr-d { font-size: 13.5px; color: var(--text-3); }

/* Editeur page parrain */
.editor-layout { display: grid; gap: 24px; }
.editor-layout > * { min-width: 0; }

/* Aperçu en direct de la page de parrainage */
.pv-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pv-title { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 14px; font-weight: 600; color: var(--text-2); }
.pv-bar .segmented button { min-height: 36px; padding: 6px 12px; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.pv-frame { display: flex; flex-direction: column; margin: 0 auto; overflow: hidden; background: var(--bg); box-shadow: var(--shadow-lg); }
.pv-frame.is-mobile { width: 100%; max-width: 380px; border: 10px solid #0b1324; border-radius: 34px; }
.pv-frame.is-desktop { width: 100%; border: 1px solid var(--border-strong); border-radius: 12px; }
.pv-chrome { display: none; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.is-desktop .pv-chrome { display: flex; }
.pv-chrome i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex: none; }
.pv-chrome span { flex: 1; min-width: 0; margin-left: 8px; padding: 3px 10px; border-radius: 6px; background: var(--surface); color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-scroll { height: min(700px, calc(100vh - var(--topbar-h) - 110px)); min-height: 360px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; }
.pv-scroll:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }
/* Ordinateur : la page est rendue à 1280 px puis réduite pour tenir dans le cadre */
.is-desktop .pv-canvas { width: 1280px; zoom: var(--pv-zoom, .5); }
.pv-open, .pv-close { display: none; }

@media (min-width: 1100px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .editor-layout.pv-wide { grid-template-columns: minmax(380px, .85fr) minmax(0, 1.15fr); }
  .editor-preview { position: sticky; top: calc(var(--topbar-h) + 16px); }
}
/* Écrans étroits : l'aperçu s'ouvre en plein écran depuis la barre d'enregistrement */
@media (max-width: 1099px) {
  .pv-open { display: inline-flex; }
  .editor-preview { display: none; }
  .editor-preview.is-open { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: var(--z-overlay); padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); }
  .editor-preview.is-open .pv-close { display: inline-flex; }
  .editor-preview.is-open .pv-frame { flex: 1; min-height: 0; }
  .editor-preview.is-open .pv-scroll { flex: 1; height: auto; min-height: 0; }
  .editor-preview.is-open .pv-frame.is-mobile { border-width: 6px; border-radius: 26px; }
}
.phone-frame { border-radius: 32px; border: 10px solid #0b1324; overflow: hidden; background: var(--bg); box-shadow: var(--shadow-lg); max-width: 380px; margin: 0 auto; }
.phone-frame .pf-scroll { max-height: 620px; overflow: auto; }
.phone-frame .sticky-cta { display: none; }
.phone-frame .ref-hero { padding: 28px 0 64px; }
.phone-frame .ref-hero h1 { font-size: 24px; }
.phone-frame .ref-hero p.desc { font-size: 14px; }
.phone-frame .ref-logo { width: 72px; height: 72px; border-radius: 20px; font-size: 26px; }
.upload-box { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); flex-wrap: wrap; }
.upload-box .ref-logo { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; padding-right: 4px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick .cover { width: 44px; height: 34px; border-radius: 8px; flex: none; }
.pick .cover .cover-icon { width: 18px; right: 50%; top: 50%; transform: translate(50%, -50%); }

/* Admin */
.admin-badge { background: var(--accent); color: #fff; }
.deadline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.deadline.urgent { color: var(--danger); }

/* Grille 2/3 - 1/3 */
.cols-2-1 { display: grid; gap: 16px; }
@media (min-width: 1024px) { .cols-2-1 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; } }

/* Utilitaires responsive */
.only-desktop { display: none; }
@media (min-width: 900px) { .only-desktop { display: block; } .only-mobile { display: none !important; } }

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Impression */
@media print { .sidebar, .topbar, .bottom-nav, .toasts { display: none !important; } .app-main { margin: 0; } }

/* ==========================================================================
   Ajouts version Laravel : onglets et filtres en liens, cases stylisées
   ========================================================================== */
.segmented a { min-height: 38px; padding: 6px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: all var(--dur) var(--ease); }
.segmented a:hover { color: var(--text); }
.segmented a[aria-current="true"], .segmented a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab[aria-current="page"] { color: var(--primary); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
label.interest, label.option, label.method, label.chip, label.swatch { cursor: pointer; }
.interest.is-checked { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.interest.is-checked .ii { background: var(--btn-primary); color: #fff; }
.interest.is-checked .tick { display: grid; }
.option.is-checked, .method.is-checked { border-color: var(--primary); background: var(--primary-soft); }
.option.is-checked .radio { border-color: var(--primary); }
.option.is-checked .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.swatch.is-checked { border-color: var(--text); }
label.interest:focus-within, label.option:focus-within, label.method:focus-within, label.chip:focus-within, label.swatch:focus-within { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.menu-pop form { margin: 0; }
.nav form, form.nav { margin: 0; }

/* ---------- Boîte à outils ---------- */
.tool-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tool-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.tool-top { display: flex; align-items: center; gap: 12px; }
.tool-logo { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center; color: #fff; font: 700 16px/1 var(--font-head); }
.tool-name { font-size: 16.5px; line-height: 1.25; }
.tool-desc { color: var(--text-2); font-size: 14.5px; flex: 1; }
.tool-plats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tool-plats li { font-size: 12px; font-weight: 600; color: var(--text-3); padding: 2px 8px; border-radius: 6px; background: var(--surface-2); }
.tool-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.tool-foot .truncate { min-width: 0; flex: 1; text-align: right; }
.tool-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------- Super administrateur : journal, mises à jour ---------- */
.log-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); align-items: end; }
.log-filter-actions { align-self: end; }
.log-row { border-top: 1px solid var(--border); }
.log-row:first-child { border-top: 0; }
.log-row > summary { display: flex; align-items: center; gap: 12px; padding: 12px 18px; cursor: pointer; list-style: none; }
.log-row > summary::-webkit-details-marker { display: none; }
.log-row > summary:hover { background: var(--surface-2); }
.log-row[open] > summary { background: var(--surface-2); }
.log-ic { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.log-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.log-main strong { font-size: 14.5px; }
.log-subject { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-by { font-size: 12.5px; color: var(--text-3); }
.log-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.log-detail { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; padding: 4px 18px 16px 62px; font-size: 13.5px; }
.log-detail dt { color: var(--text-3); font-weight: 600; }
.log-detail dd { margin: 0; min-width: 0; }
.log-break { overflow-wrap: anywhere; }
.log-meta { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
@media (max-width: 640px) { .log-detail { grid-template-columns: 1fr; padding-left: 18px; } .log-detail dt { margin-top: 6px; } }
.up-drop { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); text-align: center; cursor: pointer; }
.up-drop:hover, .up-drop:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.up-drop-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.up-item { display: grid; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }
.up-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.up-notes { font-size: 14px; white-space: pre-line; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.up-more summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--primary); }
.up-more ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); max-height: 220px; overflow: auto; }
.up-more pre { margin-top: 8px; }
.up-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }
.up-checklist, .up-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.up-checklist li { display: flex; gap: 8px; align-items: flex-start; }
.up-checklist li.ok .icon { color: var(--success); }
.up-checklist li.warn .icon { color: var(--warning); }
.up-checklist li.ko .icon { color: var(--danger); }
.up-how li { padding-left: 14px; position: relative; color: var(--text-2); }
.up-how li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* ---------- Application installable (PWA) ---------- */
.install-head { display: flex; gap: 14px; align-items: center; }
.install-icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow); flex: none; }
.install-perks { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.install-perks li { display: flex; gap: 8px; align-items: center; }
.install-perks .icon { color: var(--primary); }
.install-box [data-for] { display: none; }
.install-box[data-state="prompt"] [data-for="prompt"], .install-box[data-state="ios"] [data-for="ios"], .install-box[data-state="manual"] [data-for="manual"], .install-box[data-state="done"] [data-for="done"] { display: block; }
.install-box[data-state="done"] .install-perks { display: none; }
.install-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.install-kbd { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); color: var(--primary); vertical-align: middle; margin: 0 2px; }
.install-banner { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; margin-bottom: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.install-banner[hidden] { display: none; }
.install-banner img { border-radius: 10px; flex: none; }
.install-banner .grow { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.install-banner strong { font-size: 14.5px; }
.install-banner span { font-size: 12.5px; color: var(--text-3); }
@media (min-width: 1024px) { .install-banner { display: none !important; } }
@media (display-mode: standalone) { .install-banner { display: none !important; } }

/* ---------- Administration : campagnes ---------- */
.cma-card { display: grid; gap: 14px; }
.cma-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cma-link { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.cma-link .truncate { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.cma-funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin: 0; }
.cma-funnel > div { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); position: relative; }
.cma-funnel dt { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.cma-funnel dd { margin: 2px 0 0; font: 800 22px/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.cma-funnel span { font-size: 12px; color: var(--text-3); }

/* ---------- MacLink Zone : navigateur intégré ---------- */
.zb { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h) - var(--bottomnav-h) - 64px - env(safe-area-inset-bottom)); min-height: 440px; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
@media (min-width: 1024px) { .zb { height: calc(100dvh - var(--topbar-h) - 44px); } }
.zb:fullscreen { height: 100dvh; border-radius: 0; border: 0; }
.zb-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.zb-nav { display: flex; gap: 2px; }
.zb-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--text-2); cursor: pointer; }
.zb-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.zb-btn:disabled { opacity: .4; cursor: default; }
.zb-address { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-3); }
.zb-address .icon { flex: none; color: var(--success); }
.zb-brand { flex: none; font-weight: 700; color: var(--primary); }
.zb-sep { flex: none; opacity: .5; }
.zb-address strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); font-weight: 600; }
@media (max-width: 480px) { .zb-brand, .zb-sep { display: none; } }
.zb-tabs { display: flex; gap: 4px; padding: 6px 8px 0; overflow-x: auto; background: var(--surface-2); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.zb-tabs::-webkit-scrollbar { display: none; }
.zb-tab { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 220px; padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; background: none; color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.zb-tab span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.zb-tab[aria-selected="true"] { background: var(--surface); border-color: var(--border); color: var(--text); }
.zb-view { position: relative; flex: 1; min-height: 0; background: #fff; }
.zb-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.zb-state { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: var(--surface); color: var(--text-2); }
.zb-state[hidden] { display: none; }
.zb-state strong { font: 700 18px var(--font-head); color: var(--text); }
.zb-state p { max-width: 40ch; margin: 0; }
.zb-state-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
