/* ==========================================================================
   DANA Academy - Thème 2.0 : police unique (Inter), mode clair / sombre.
   Chargé après dana.css : ne surcharge que les variables et quelques composants.
   ========================================================================== */
:root {
  --font-display: var(--font);
  color-scheme: light;
}
body { transition: background-color .25s, color .25s; }

/* Titres : sobres et lisibles (fini le serif italique) */
.display, .h2, .hero--inner h1, .lesson-title, .auth__quote, .certificate h1, .error-page .code { font-family: var(--font); font-weight: 800; letter-spacing: -.035em; }
.h2 { font-weight: 750; }
.display em, .h2 em { font-style: normal; font-weight: inherit; color: var(--red); }
.hero__trust strong, .stat strong, .kpi strong, .enroll__price, .result strong, .mini-card strong, .screen__meta b { font-family: var(--font); font-weight: 800; letter-spacing: -.03em; }
.prose h2 { font-family: var(--font); font-weight: 700; }
.certificate .name { font-family: Georgia, "Times New Roman", serif; } /* le certificat garde un ton cérémoniel */
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); }

/* Bouton de thème */
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-d); background: transparent; color: inherit; transition: background .2s, border-color .2s; }
.theme-toggle:hover { background: rgba(127, 127, 127, .16); }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.home-light .theme-toggle { border-color: var(--line); color: var(--text); }
[data-theme="dark"] .home-light .theme-toggle { border-color: var(--line-d); color: #fff; }
@media (max-width: 860px) { .nav__actions .theme-toggle { width: 100%; } }

/* ---------- Mode sombre ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --ink: #07070a;
  --paper: #0d0d12;
  --paper-2: #121219;
  --white: #17171f;
  --text: #ececf2;
  --muted: #a3a3b1;
  --line: #2a2a35;
  --red: #8257ff;
  --red-d: #a58bff;
  --red-soft: rgba(130, 87, 255, .16);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .14);
  --blue: #7aa2ff;
  --blue-soft: rgba(122, 162, 255, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .8);
}
[data-theme="dark"] .btn--primary { color: #fff; }
[data-theme="dark"] .btn--dark { background: #23232d; border: 1px solid var(--line); }
[data-theme="dark"] .btn--dark:hover { background: #2d2d39; }
[data-theme="dark"] .badge--dark { background: #23232d; }
[data-theme="dark"] .section--dark, [data-theme="dark"] .cta { background: #09090d; border: 1px solid var(--line); }
[data-theme="dark"] .hero-light { background: var(--paper); }
[data-theme="dark"] .mini-card { background: var(--white); }
[data-theme="dark"] .hero-light .display { color: var(--text); }
[data-theme="dark"] .hero-light__tags em { background: var(--white); color: var(--text); border-color: var(--line); }
[data-theme="dark"] .home-light .logo-on-dark { display: block; }
[data-theme="dark"] .home-light .logo-on-light { display: none; }
[data-theme="dark"] .home-light .site-header { background: rgba(10, 10, 12, .86); color: #fff; border-bottom-color: var(--line-d); }
[data-theme="dark"] .home-light .burger { color: #fff; border-color: var(--line-d); }
@media (min-width: 861px) {
  [data-theme="dark"] .home-light .nav__link, [data-theme="dark"] .home-light .nav__btn { color: rgba(255, 255, 255, .8); }
  [data-theme="dark"] .home-light .nav__link:hover, [data-theme="dark"] .home-light .nav__btn:hover, [data-theme="dark"] .home-light .nav__link[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .08); }
}
[data-theme="dark"] .note p { color: var(--text); }
[data-theme="dark"] .note--ex { background: rgba(14, 165, 190, .14); border-color: #22b8cf; }
[data-theme="dark"] .note--ex h4 { color: #67d4e4; }
[data-theme="dark"] .note--reflect { background: rgba(167, 139, 250, .14); border-color: #a78bfa; }
[data-theme="dark"] .note--reflect h4 { color: #c4b5fd; }
[data-theme="dark"] .toc-item .dot { background: var(--white); }
[data-theme="dark"] .toc-item.is-active { background: var(--red-soft); }
[data-theme="dark"] .input, [data-theme="dark"] .textarea, [data-theme="dark"] .select { background: var(--paper-2); color: var(--text); }
[data-theme="dark"] .input::placeholder, [data-theme="dark"] .textarea::placeholder { color: var(--muted); }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1c1c25 25%, #262631 37%, #1c1c25 63%); background-size: 400% 100%; }
[data-theme="dark"] .prose pre { background: #0a0a0e; border: 1px solid var(--line); }
[data-theme="dark"] .pricing-table th { background: var(--paper-2); }
[data-theme="dark"] .course-card img, [data-theme="dark"] .post-card img { filter: brightness(.92); }
[data-theme="dark"] .certificate, [data-theme="dark"] .cert-mock { color: #1a1a1f; }
[data-theme="dark"] .alert--warning { background: var(--amber-soft); color: var(--amber); }
[data-theme="dark"] .alert--error { background: var(--red-soft); color: var(--red-d); }
@media print { [data-theme="dark"] body { background: #fff; color: #000; } }

/* ---------- Tableau de bord étudiant ---------- */
.dash-head { padding: 48px 0 96px; }
.dash-head__in { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.dash-head .lead { max-width: 56ch; margin: 0; color: rgba(255, 255, 255, .72); }
.dash-head .eyebrow { margin-bottom: 10px; }
.dash-body { position: relative; z-index: 2; margin-top: -56px; }
.kpi { transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-links li + li { border-top: 1px solid var(--line); }
.quick-links a { display: flex; align-items: center; gap: 12px; padding: 13px 4px; font-weight: 500; color: var(--text); }
.quick-links a:hover { color: var(--red); }
.course-card__body .progress { margin-top: 10px; }
[data-theme="dark"] .mini-card strong, [data-theme="dark"] .mini-card b { color: var(--text); }
[data-theme="dark"] .prose, [data-theme="dark"] .prose p, [data-theme="dark"] .prose li, [data-theme="dark"] .prose h1, [data-theme="dark"] .prose h2, [data-theme="dark"] .prose h3, [data-theme="dark"] .prose h4, [data-theme="dark"] .prose strong, [data-theme="dark"] .prose td, [data-theme="dark"] .prose th { color: var(--text); }
[data-theme="dark"] .prose a { color: var(--red-d); }
[data-theme="dark"] .prose blockquote { color: var(--muted); }
[data-theme="dark"] .prose code { background: var(--paper-2); color: var(--text); }
[data-theme="dark"] .lesson-card, [data-theme="dark"] .lesson-done, [data-theme="dark"] .quiz-q { color: var(--text); }
[data-theme="dark"] .quiz-q p, [data-theme="dark"] .opt { color: var(--text); }
[data-theme="dark"] .explain { background: var(--paper-2); color: var(--text); }
[data-theme="dark"] .result { color: var(--text); }

/* ---------- DANA Academy LAB ---------- */
.lab-path { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; counter-reset: lab; }
.lab-path li { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); font-weight: 600; font-size: 14.5px; }
.lab-path li span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 13px; }
.lab-layout { align-items: start; }
.lab-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 24px 0; }
.lab-facts div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.lab-facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.lab-facts dd { margin: 4px 0 0; font-weight: 600; }
.lab-example { margin-top: 32px; padding: 24px 28px; border-left: 4px solid var(--red); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0; }
.lab-example p { margin: 6px 0 0; color: var(--muted); }
.lab-conditions { position: sticky; top: calc(var(--header-h) + 20px); }
.lab-checks li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.lab-checks li.is-ok svg { color: var(--green); }
.lab-checks li.is-ko svg { color: #e5484d; }
.lab-verdict { margin: 18px 0; padding: 14px 16px; border-radius: var(--radius); font-size: 15px; background: var(--paper-2); }
.lab-verdict--selected { background: var(--green-soft); }
.lab-verdict--waitlist, .lab-verdict--pending { background: var(--amber-soft); }
.lab-verdict--rejected { background: var(--red-soft); }
.lab-form { margin-top: 8px; }
.lab-prod .video { margin-bottom: 14px; }
@media (max-width: 900px) { .lab-path { grid-template-columns: repeat(2, 1fr); } .lab-conditions { position: static; } .lab-facts { grid-template-columns: 1fr; } }
.lab-path--home li { background: rgba(255,255,255,.06); border-color: var(--line-d); color: #fff; }

/* ---------- Menu mobile ----------
   Le flou d'arrière-plan (backdrop-filter) de l'en-tête crée un bloc conteneur : le menu en position fixe
   se calait alors sur les 72 px de l'en-tête au lieu de l'écran, d'où le menu tronqué. */
@media (max-width: 860px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10, 10, 12, .97); }
  .home-light .site-header { background: rgba(255, 255, 255, .98); }
  [data-theme="dark"] .home-light .site-header { background: rgba(10, 10, 12, .97); }
  .nav { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); overscroll-behavior: contain; z-index: 99; visibility: hidden; }
  .nav.is-open { visibility: visible; }
  .nav .nav__link, .nav .nav__btn { color: rgba(255, 255, 255, .9); }
  .nav .nav__link:hover, .nav .nav__btn:hover, .nav .nav__link[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .08); }
  .nav .theme-toggle { width: 100%; border-color: var(--line-d); color: #fff; height: 46px; }
  .nav .nav__actions .btn { justify-content: center; }
}

/* ---------- Champ mot de passe avec oeil ---------- */
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw__toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.pw__toggle:hover { color: var(--text); background: rgba(127, 127, 127, .14); }

/* Le certificat reste identique en mode sombre (c'est un document : fond blanc, encre sombre) */
.certificate { --text: #1a1a1f; --muted: #62626d; --line: #e4e0d9; --ink: #0a0a0c; color: #1a1a1f; }
.certificate h1, .certificate h2, .certificate .name { color: #0a0a0c; }
.btn.is-busy { pointer-events: none; }
