:root {
  --bg: #09090b;
  --bg-2: #0d0d10;
  --surface: #131317;
  --surface-2: #1a1a1f;
  --surface-3: #222228;
  --border: #25252c;
  --border-2: #33333b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #6f6f78;
  --accent: #e6c068;
  --accent-2: #f3d58e;
  --accent-ink: #1b1505;
  --accent-soft: rgba(230, 192, 104, .12);
  --ok: #5fd38d;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 60px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .55);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.w-full { width: 100%; }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--surface-2); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-done { background: rgba(95, 211, 141, .12); color: var(--ok); border-color: rgba(95, 211, 141, .35); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  background: transparent; border: 1px solid var(--border); color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea, .search input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input.is-invalid, .field textarea.is-invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 13px; margin: -4px 0 0; }
.fineprint { color: var(--dim); font-size: 12px; text-align: center; margin: 0; }

/* ---------- Marque ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .22em; font-size: 15px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-2), #b8933f); color: var(--accent-ink);
  font-weight: 900; font-size: 15px; letter-spacing: 0;
}

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-visual {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(230, 192, 104, .16), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(230, 192, 104, .07), transparent 60%),
    var(--bg-2);
  border-right: 1px solid var(--border);
}
.login-visual::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.login-visual > * { position: relative; z-index: 1; }
.login-headline { font-size: clamp(32px, 4vw, 52px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin: 0 0 16px; max-width: 12ch; }
.login-headline em { font-style: normal; color: var(--accent); }
.login-sub { color: var(--muted); max-width: 42ch; margin: 0; font-size: 16px; }
.login-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.login-stats strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.login-stats span { color: var(--dim); font-size: 13px; }
.login-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.02em; }
.login-card > p { color: var(--muted); margin: 0 0 28px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font-size: 13px; padding: 6px 8px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.login-row label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.login-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.link { color: var(--accent); background: none; border: 0; padding: 0; font-size: 13px; }
.link:hover { text-decoration: underline; }
.proto-note { margin-top: 24px; padding: 12px 14px; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); color: var(--dim); font-size: 13px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); border-top-color: var(--accent-ink); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: rgba(9, 9, 11, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px; }
.topnav a:hover { color: var(--text); background: var(--surface); }
.topnav a.is-active { color: var(--text); background: var(--surface-2); }
.topbar-spacer { flex: 1; }
.user { position: relative; }
.avatar-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; border-radius: 999px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border-2); font-weight: 700; font-size: 13px; color: var(--accent);
}
.avatar-name { font-size: 14px; color: var(--muted); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow);
}
.menu-email { padding: 10px 12px; font-size: 13px; color: var(--dim); border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border: 0; background: none; border-radius: 8px; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--surface-2); }

/* ---------- Accueil ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 36px 24px 120px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.hero h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.025em; margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.stat strong { display: block; font-size: 18px; letter-spacing: -.01em; }
.stat span { color: var(--dim); font-size: 12px; }

.resume {
  display: flex; align-items: center; gap: 18px; padding: 16px; margin-bottom: 28px;
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.resume:hover { border-color: var(--border-2); }
.resume-thumb { width: 120px; flex: none; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; }
.resume-txt { flex: 1; min-width: 0; }
.resume-thumb .cover-gen { padding: 8px 10px; justify-content: flex-end; }
.resume-thumb .cover-top { display: none; }
.resume-thumb .cover-title { font-size: 11px; }
.resume-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.resume-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-meta { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.section-title small { color: var(--dim); font-weight: 500; font-size: 14px; margin-left: 6px; }
.search { position: relative; width: min(360px, 100%); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); width: 18px; height: 18px; }
.search input { padding-left: 40px; height: 42px; border-radius: 999px; background: var(--surface); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s; text-align: left; padding: 0;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.card-body { padding: 14px 16px 16px; display: grid; gap: 10px; flex: 1; }
.card-title { font-weight: 650; font-size: 15px; line-height: 1.3; margin: 0; }
.card-meta { font-size: 13px; color: var(--dim); }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #c9a24c, var(--accent-2)); border-radius: inherit; transition: width .4s; }
.progress-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: auto; }
.progress-row .progress { flex: 1; }
.progress-row b { font-weight: 600; min-width: 34px; text-align: right; }
.lock-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lock-pill svg { width: 14px; height: 14px; }

/* Couverture (image ou visuel généré) */
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0c0c0f; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-gen {
  position: absolute; inset: 0; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(120% 90% at 0% 0%, hsla(var(--h), 45%, 30%, .55), transparent 55%),
    radial-gradient(80% 80% at 100% 100%, rgba(230, 192, 104, .14), transparent 60%),
    linear-gradient(160deg, #18181c, #08080a);
}
.cover-gen::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(135deg, #000 10%, transparent 70%);
}
.cover-gen > * { position: relative; }
.cover-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .25em; font-weight: 700; color: rgba(255,255,255,.55); }
.cover-top i { width: 18px; height: 2px; background: var(--accent); display: block; }
.cover-title { font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.02; font-size: clamp(18px, 1.9vw, 24px); max-width: 92%; text-wrap: balance; }
.cover-done { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--ok); color: #05210f; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }

.results { display: grid; gap: 6px; margin-bottom: 28px; }
.result {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.result:hover { border-color: var(--border-2); background: var(--surface-2); }
.result-txt { flex: 1; min-width: 0; }
.result-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-path { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result time, .lesson time { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--dim); border: 1px dashed var(--border-2); border-radius: var(--radius); }

/* ---------- Page formation ---------- */
.course { display: grid; grid-template-columns: 350px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.sidebar {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
  border-right: 1px solid var(--border); background: var(--bg-2); scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.side-head { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-2); z-index: 2; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; }
.side-title { font-size: 17px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; line-height: 1.25; }
.side-progress { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
.side-progress-row { display: flex; justify-content: space-between; }
.side-toggle { display: none; }
.modules { padding: 8px 10px 40px; }
.module + .module { margin-top: 2px; }
.module-btn {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px; background: none; border: 0; border-radius: 10px; text-align: left;
}
.module-btn:hover { background: var(--surface); }
.module-btn .chev { margin-top: 2px; color: var(--dim); transition: transform .2s; width: 18px; height: 18px; }
.module.is-open .module-btn .chev { transform: rotate(90deg); color: var(--accent); }
.module-txt { flex: 1; min-width: 0; }
.module-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.module-meta { font-size: 12px; color: var(--dim); margin-top: 3px; }
.module-ring { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: 2px; }
.module-ring.is-full { color: var(--ok); }
.lessons { display: none; padding: 2px 0 8px 18px; margin-left: 10px; border-left: 1px solid var(--border); }
.module.is-open .lessons { display: block; }
.lesson {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; color: var(--muted); position: relative;
}
.lesson:hover { background: var(--surface); color: var(--text); }
.lesson.is-active { background: var(--surface-2); color: var(--text); }
.lesson.is-active::before { content: ""; position: absolute; left: -19px; top: 8px; bottom: 8px; width: 2px; background: var(--accent); border-radius: 2px; }
.lesson-title { flex: 1; min-width: 0; line-height: 1.35; }
.check {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-2); display: grid; place-items: center; flex: none;
}
.check svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.is-done .check { background: var(--ok); border-color: var(--ok); color: #05210f; }
.is-done .check svg { opacity: 1; }
.kind { width: 14px; height: 14px; color: var(--dim); }

.content { padding: 28px clamp(18px, 4vw, 48px) 120px; max-width: 1000px; width: 100%; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--dim); margin-bottom: 10px; }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; }
.lesson-h1 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.025em; line-height: 1.2; margin: 0 0 20px; }

.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background:
    radial-gradient(60% 80% at 50% 40%, rgba(230, 192, 104, .10), transparent 70%),
    radial-gradient(100% 100% at 0% 100%, hsla(var(--h), 40%, 25%, .35), transparent 60%),
    linear-gradient(180deg, #121216, #060608);
}
.player-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.play {
  width: 78px; height: 78px; border-radius: 50%; border: 0; display: grid; place-items: center; margin: 0 auto 14px;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 10px rgba(230, 192, 104, .12), 0 10px 40px rgba(0,0,0,.6); transition: transform .15s;
}
.play:hover { transform: scale(1.06); }
.play svg { width: 30px; height: 30px; fill: currentColor; stroke: none; margin-left: 4px; }
.player-label { color: var(--muted); font-size: 14px; }
.player-label strong { color: var(--text); }
.player-badge {
  position: absolute; top: 14px; left: 14px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.6); display: flex; gap: 8px; align-items: center;
}
.player-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: block; }
.player-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px; display: flex; align-items: center; gap: 14px; background: linear-gradient(0deg, rgba(0,0,0,.75), transparent); font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255,255,255,.8); }
.player-bar .track { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
.player-bar .track i { display: block; height: 100%; width: 0; background: var(--accent); }
.player-note { position: absolute; top: 14px; right: 14px; font-size: 11px; color: rgba(255,255,255,.55); background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 999px; }
.player.is-text { aspect-ratio: auto; min-height: 220px; }
.player.is-text .player-center { position: static; min-height: 220px; }
.text-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--surface-3); color: var(--accent); }
.text-icon svg { width: 26px; height: 26px; }

.actions { display: flex; align-items: center; gap: 10px; margin: 16px 0 32px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }

.block { margin-top: 28px; }
.block h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.block h2 .count { font-size: 12px; color: var(--dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.desc { color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.desc p { margin: 0 0 8px; }
.desc p:last-child { margin: 0; }
.desc .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fact { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.list { display: grid; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0;
}
a.item:hover, .item:hover { border-color: var(--border-2); background: var(--surface-2); }
.ext {
  width: 42px; height: 42px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(230, 192, 104, .25);
}
.ext.is-link { background: var(--surface-3); color: var(--muted); border-color: var(--border-2); }
.item-txt { flex: 1; min-width: 0; }
.item-title { font-weight: 550; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .btn { height: 36px; padding: 0 14px; font-size: 13px; }
.muted-empty { color: var(--dim); font-size: 14px; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 12px; }

/* ---------- Aide ---------- */
.help-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  height: 50px; padding: 0 20px 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08);
  background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 12px 34px rgba(0,0,0,.6), 0 0 0 6px rgba(230,192,104,.08);
  transition: transform .15s, background .15s;
}
.help-fab:hover { transform: translateY(-2px); background: var(--accent-2); }
.help-fab svg { width: 22px; height: 22px; }
.help-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); animation: fade .2s; }
.help-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(430px, 100%);
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border-2); box-shadow: var(--shadow);
  animation: slide .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.help-head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 22px 16px; }
.help-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.help-head p { margin: 0; color: var(--muted); font-size: 14px; }
.help-tabs { display: flex; gap: 6px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.help-tab { background: none; border: 0; padding: 10px 4px; margin-right: 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.help-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.help-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
.faq { display: grid; gap: 8px; margin-bottom: 18px; }
.faq details { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; }
.faq summary { list-style: none; cursor: pointer; padding: 14px 40px 14px 16px; font-weight: 600; font-size: 14px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 18px; font-weight: 500; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: 14px; }
.help-context { margin: 0; font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.help-success { text-align: center; padding: 30px 6px; }
.help-success h3 { margin: 14px 0 6px; font-size: 20px; }
.help-success p { color: var(--muted); margin: 0 0 22px; }
.success-badge { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: rgba(95,211,141,.14); color: var(--ok); }
.success-badge svg { width: 30px; height: 30px; stroke-width: 2.4; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 90; max-width: calc(100% - 32px);
  background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow); animation: fade .2s;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { padding: 28px 24px; gap: 28px; border-right: 0; border-bottom: 1px solid var(--border); }
  .login-headline { font-size: 32px; }
  .login-stats { gap: 22px; }
  .login-stats strong { font-size: 20px; }

  .course { display: block; }
  .sidebar { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-head { position: static; }
  .side-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px;
    padding: 11px 14px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; font-weight: 600; font-size: 14px;
  }
  .side-toggle svg { transition: transform .2s; }
  .sidebar.is-expanded .side-toggle svg { transform: rotate(180deg); }
  .sidebar:not(.is-expanded) .modules { display: none; }
  .content { padding-top: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .topnav, .avatar-name { display: none; }
  .page { padding: 24px 16px 110px; }
  .hero { margin-bottom: 20px; }
  .stats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 10px 12px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .resume { gap: 12px; padding: 12px; }
  .resume-thumb { display: none; }
  .resume .btn { height: 40px; padding: 0 14px; }
  .search { width: 100%; }
  .content { padding: 18px 16px 110px; }
  .actions .btn { flex: 1; }
  .actions .spacer { display: none; }
  .item .btn span { display: none; }
  .help-fab { right: 16px; bottom: 16px; height: 46px; }
  .help-panel { width: 100%; border-left: 0; }
  .login-form-wrap { padding: 28px 16px 90px; place-items: start center; }
  .play { width: 62px; height: 62px; }
  .player-label { font-size: 13px; }
}

/* Auth : écrans de confirmation, jauge mot de passe */
.login-card .back { margin-bottom: 18px; }
.sent-box { text-align: center; padding: 8px 0 22px; }
.sent-box h2 { font-size: 20px; margin: 14px 0 6px; }
.sent-box p { color: var(--muted); margin: 0; }
.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* SAV : compte connecté, historique */
.help-who { margin-top: 8px !important; font-size: 13px !important; color: var(--dim) !important; }
.help-who strong { color: var(--accent); font-weight: 600; }
.tickets { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.tickets h3 { font-size: 14px; margin: 0 0 10px; }
.ticket .item-sub { white-space: normal; }
.status-pill { font-size: 11px; font-weight: 600; color: var(--ok); background: rgba(95,211,141,.12); border-radius: 999px; padding: 3px 9px; flex: none; }

/* Filigrane dynamique */
.wm {
  position: absolute; z-index: 3; pointer-events: none; user-select: none; white-space: nowrap;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: rgba(255,255,255,.38);
  text-shadow: 0 1px 2px rgba(0,0,0,.6); transition: left 1.2s ease, top 1.2s ease;
}
.player-note { display: inline-flex; align-items: center; gap: 6px; }
.player-note svg { width: 12px; height: 12px; }

/* Un appareil à la fois */
.login-legal { color: var(--dim); font-size: 12px; margin: 18px 0 0; line-height: 1.5; }
.login-legal .link { font-size: 12px; }
.menu-device { display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px; font-size: 12px; color: var(--dim); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-device svg { width: 16px; height: 16px; }
.kicked { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 100px; background: radial-gradient(700px 400px at 50% 0%, rgba(230,192,104,.10), transparent 60%), var(--bg); }
.kicked-card { width: 100%; max-width: 440px; text-align: center; display: grid; gap: 12px; }
.kicked-icon { width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kicked-icon svg { width: 30px; height: 30px; }
.kicked h1 { font-size: 22px; letter-spacing: -.02em; margin: 0; line-height: 1.25; }
.kicked p { color: var(--muted); margin: 0 0 6px; }
.kicked-device { font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; }

/* Texte des leçons */
.md { color: var(--muted); font-size: 15px; line-height: 1.65; }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 12px; }
.md h3 { color: var(--text); font-size: 17px; margin: 22px 0 8px; letter-spacing: -.01em; }
.md h4 { color: var(--text); font-size: 15px; margin: 18px 0 6px; }
.md strong { color: var(--text); font-weight: 600; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--accent); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.md-link { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(230,192,104,.35); text-underline-offset: 3px; word-break: break-word; }
.md-link:hover { text-decoration-color: var(--accent); }
.md-img { display: block; max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 12px 0; }
.desc .facts { margin-top: 18px; }

/* Lecteur réel (Bunny Stream) */
.player.is-live { background: #000; }
.player.is-live iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Bouton plein écran posé exactement sur celui du lecteur Bunny (Plyr : 32 px, à 10 px des bords,
   5 px quand le lecteur fait moins de 480 px de large ; survol orange #ff7755 comme le lecteur). */
.player.is-live { container-type: inline-size; }
.player-fs {
  position: absolute; right: 10px; bottom: 10px; z-index: 4; width: 32px; height: 32px; padding: 7px; border: 0; border-radius: 4px;
  background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; transition: opacity .2s, background .15s;
}
.player-fs svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.player-fs .fs-out { display: none; }
.player-fs:hover, .player-fs:focus-visible { background: #ff7755; }
@container (max-width: 479px) { .player-fs { right: 5px; bottom: 5px; } }
@media (hover: hover) { .player.is-live:not(:hover):not(:fullscreen):not(.is-fs) .player-fs { opacity: 0; } }
.player.is-live:fullscreen .fs-in, .player.is-live.is-fs .fs-in { display: none; }
.player.is-live:fullscreen .fs-out, .player.is-live.is-fs .fs-out { display: block; }
.player.is-live:fullscreen { border: 0; border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.player.is-live.is-fs { position: fixed; inset: 0; z-index: 200; border: 0; border-radius: 0; aspect-ratio: auto; }
.player.is-live:fullscreen .wm, .player.is-live.is-fs .wm { font-size: 16px; }

/* Démarrage (session en cours de lecture) */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .spinner { width: 28px; height: 28px; border-color: rgba(255,255,255,.12); border-top-color: var(--accent); }
.muted-empty .spinner { display: inline-block; vertical-align: -4px; width: 16px; height: 16px; border-color: rgba(255,255,255,.12); border-top-color: var(--accent); margin-right: 6px; }

.status-pill.is-open { color: var(--accent); background: var(--accent-soft); }
.status-pill.is-off { color: var(--danger); background: rgba(248,113,113,.12); }

/* Admin */
.admin-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: end;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.admin-form .form-error, .admin-form .btn { grid-column: 1 / -1; justify-self: start; }
.admin-tabs { margin-top: 32px; border-bottom: 1px solid var(--border); }
.admin-tabs .count { font-size: 11px; color: var(--accent); margin-left: 4px; }
.admin-search { width: min(420px, 100%); margin-bottom: 12px; }
.admin .item { align-items: flex-start; }
.admin .item-title { white-space: normal; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin .item-sub { white-space: normal; }
.admin .item .avatar { flex: none; }
.item.is-off { opacity: .6; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; max-width: 45%; }
.btn-danger { color: var(--danger) !important; }
.ticket-msg { margin: 8px 0 0; color: var(--text); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-admin.is-done { opacity: .65; }
.row-secret { margin-top: 10px; }
.secret { margin-top: 14px; background: var(--surface); border: 1px solid rgba(230,192,104,.35); border-radius: var(--radius); padding: 16px 18px; }
.secret-head { font-size: 14px; color: var(--muted); }
.secret-head strong { color: var(--text); }
.secret-pw { margin: 8px 0 10px; font-size: 14px; }
.secret-pw code { font-size: 16px; color: var(--accent); background: var(--surface-2); padding: 3px 8px; border-radius: 6px; user-select: all; }
.secret textarea { width: 100%; resize: vertical; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13px; }
.secret-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (max-width: 640px) {
  .admin-form { grid-template-columns: 1fr; }
  .admin .item { flex-wrap: wrap; }
  .row-actions { max-width: none; width: 100%; justify-content: flex-start; }
}
.player-error { background: rgba(0,0,0,.75); z-index: 5; }
