/* ==========================================================================
   CCNA Révisions — Design System
   Sobre, professionnel, thème clair / sombre. Aucune dépendance externe.
   ========================================================================== */

:root {
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --surface-2:     #f1f5f9;
  --surface-3:     #e8edf3;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --text:          #0f1b2d;
  --text-muted:    #4a5a70;
  --text-faint:    #7c8aa0;

  --primary:       #1657c7;
  --primary-hover: #10469f;
  --primary-soft:  #e8effb;
  --primary-text:  #ffffff;

  --success:       #157347;
  --success-soft:  #e4f4ea;
  --success-border:#9bd4b1;
  --danger:        #c22f2f;
  --danger-soft:   #fbe9e9;
  --danger-border: #eeb0b0;
  --warning:       #a76a09;
  --warning-soft:  #fbf1dd;

  --ring:          rgba(22, 87, 199, .28);
  --shadow-sm:     0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .05);
  --shadow-md:     0 4px 12px rgba(15, 27, 45, .07), 0 2px 4px rgba(15, 27, 45, .04);
  --shadow-lg:     0 16px 36px -14px rgba(15, 27, 45, .18);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --nav-h: 62px;
  --maxw: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0e1420;
    --surface:       #161e2c;
    --surface-2:     #1c2636;
    --surface-3:     #243044;
    --border:        #2a3648;
    --border-strong: #3a4a61;

    --text:          #e6ecf5;
    --text-muted:    #9fadc2;
    --text-faint:    #6f7f96;

    --primary:       #5b93f0;
    --primary-hover: #7aa9f5;
    --primary-soft:  #17263f;
    --primary-text:  #0b1220;

    --success:       #4cc07f;
    --success-soft:  #14261c;
    --success-border:#215436;
    --danger:        #ef6d6d;
    --danger-soft:   #2a1618;
    --danger-border: #57262a;
    --warning:       #e0a63e;
    --warning-soft:  #2a2110;

    --ring:          rgba(91, 147, 240, .35);
    --shadow-sm:     0 1px 2px rgba(0,0,0,.3);
    --shadow-md:     0 4px 14px rgba(0,0,0,.4);
    --shadow-lg:     0 18px 40px -14px rgba(0,0,0,.55);
  }
}

:root[data-theme="dark"] {
  --bg:            #0e1420;
  --surface:       #161e2c;
  --surface-2:     #1c2636;
  --surface-3:     #243044;
  --border:        #2a3648;
  --border-strong: #3a4a61;

  --text:          #e6ecf5;
  --text-muted:    #9fadc2;
  --text-faint:    #6f7f96;

  --primary:       #5b93f0;
  --primary-hover: #7aa9f5;
  --primary-soft:  #17263f;
  --primary-text:  #0b1220;

  --success:       #4cc07f;
  --success-soft:  #14261c;
  --success-border:#215436;
  --danger:        #ef6d6d;
  --danger-soft:   #2a1618;
  --danger-border: #57262a;
  --warning:       #e0a63e;
  --warning-soft:  #2a2110;

  --ring:          rgba(91, 147, 240, .35);
  --shadow-sm:     0 1px 2px rgba(0,0,0,.3);
  --shadow-md:     0 4px 14px rgba(0,0,0,.4);
  --shadow-lg:     0 18px 40px -14px rgba(0,0,0,.55);
}

@property --p { syntax: "<number>"; initial-value: 0; inherits: false; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .5em; }
img { max-width: 100%; }
svg { width: 1em; height: 1em; vertical-align: middle; flex: none; }
::selection { background: var(--ring); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.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; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h); display: flex; align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(8px); -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.02rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; }
.brand__logo svg { width: 19px; height: 19px; }
.nav__spacer { flex: 1; }
.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__link { padding: 7px 12px; border-radius: 8px; color: var(--text-muted); font-weight: 600; font-size: .9rem; }
.nav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__link.is-active { color: var(--primary); background: var(--primary-soft); }

.theme-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; transition: .16s; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 9px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .94rem; cursor: pointer; transition: background .16s, box-shadow .16s, border-color .16s; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--primary); color: var(--primary-text); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--subtle { background: var(--surface-2); color: var(--text-muted); }
.btn--subtle:hover { background: var(--surface-3); color: var(--text); }
.btn--lg { padding: 13px 24px; font-size: 1rem; }
.btn--block { width: 100%; }

/* ---------- Layout ---------- */
.page { padding-block: 36px 64px; }
.section { margin-top: 44px; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }

/* ---------- Hero ---------- */
.hero { padding-top: 30px; max-width: 760px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 650; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; }
.badge-new { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: .68rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); font-weight: 800; margin: 18px 0 14px; letter-spacing: -.025em; }
.hero h1 .accent { color: var(--primary); }
.hero p.lead { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--text-muted); max-width: 60ch; margin: 0 0 24px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.announce { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); font-size: .9rem; transition: border-color .16s, box-shadow .16s, transform .16s; }
.announce:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.announce__text { font-weight: 600; }
.announce__go { display: inline-flex; color: var(--primary); }
.announce__go svg { width: 16px; height: 16px; }
@media (max-width: 620px) { .announce { border-radius: var(--radius-lg); align-items: flex-start; } }

/* ---------- Track cards ---------- */
.track { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow .16s, border-color .16s, transform .16s; }
.track:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.track__head { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.track__icon { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.track__icon svg { width: 24px; height: 24px; }
.track__label { font-size: .78rem; font-weight: 700; color: var(--primary); letter-spacing: .03em; text-transform: uppercase; }
.track h3 { font-size: 1.18rem; margin: 2px 0 0; color: var(--text); }
.track__desc { color: var(--text-muted); font-size: .93rem; margin: 0 0 16px; flex: 1; }
.track__progress { margin-bottom: 14px; }
.track__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.track__stat { font-size: .84rem; color: var(--text-faint); font-weight: 600; }
.track__go { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 650; font-size: .9rem; }
.track__go svg { width: 16px; height: 16px; }

/* progress bar */
.pbar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pbar__fill { height: 100%; border-radius: 999px; width: 0%; background: var(--primary); transition: width .6s cubic-bezier(.22,1,.36,1); }
.pbar__row { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-faint); margin-bottom: 6px; font-weight: 600; }

/* ---------- Features ---------- */
.feature { display: flex; gap: 13px; align-items: flex-start; }
.feature__ic { flex: none; width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); border: 1px solid var(--border); }
.feature__ic svg { width: 21px; height: 21px; }
.feature h3, .feature h4 { margin: 1px 0 3px; font-size: 1rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.section-head { max-width: 60ch; margin: 0 0 24px; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.section-head p { color: var(--text-muted); margin: 0; }

/* ---------- Module cards ---------- */
.module { display: flex; flex-direction: column; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); transition: box-shadow .16s, border-color .16s, transform .16s; height: 100%; }
.module:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.module__top { display: flex; align-items: center; gap: 11px; }
.module__badge { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.module__badge svg { width: 20px; height: 20px; }
.module h3 { font-size: 1.02rem; margin: 0; color: var(--text); }
.module__desc { color: var(--text-muted); font-size: .89rem; margin: 0; flex: 1; }
.module__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-faint); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: .75rem; font-weight: 650; background: var(--surface-2); color: var(--text-muted); }
.chip svg { width: 13px; height: 13px; }
.chip--done { background: var(--success-soft); color: var(--success); }
.chip--progress { background: var(--warning-soft); color: var(--warning); }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.breadcrumb { display: flex; gap: 7px; align-items: center; color: var(--text-faint); font-size: .84rem; font-weight: 600; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.page-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 4px 0 0; }
.page-head p { color: var(--text-muted); max-width: 62ch; margin: 0; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 18px; box-shadow: var(--shadow-sm); }
.faq__item summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 650; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--text-faint); transition: transform .2s; line-height: 1; }
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { margin: 0 0 16px; color: var(--text-muted); font-size: .93rem; }

/* notice / avertissement */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--warning-soft); background: var(--warning-soft); color: var(--text); margin: 22px 0 0; }
.notice--warn { border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.notice__ic { flex: none; color: var(--warning); display: grid; place-items: center; }
.notice__ic svg { width: 20px; height: 20px; }
.notice p { margin: 0; font-size: .9rem; color: var(--text-muted); }
.notice strong { color: var(--warning); }

/* toolbar */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 22px 0 4px; }
.search { position: relative; flex: 1; min-width: 240px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-faint); }
.search input { width: 100%; padding: 11px 14px 11px 40px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: .94rem; transition: border-color .16s, box-shadow .16s; }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* ==========================================================================
   QUIZ
   ========================================================================== */
.quiz-wrap { max-width: 760px; margin-inline: auto; }
.quiz-head { margin-bottom: 16px; }
.quiz-head__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.quiz-head__title { font-size: 1.02rem; font-weight: 700; margin: 0; }
.quiz-head__count { font-size: .84rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.quiz-head__side { display: flex; align-items: center; gap: 10px; }
.quiz-timer { font-family: var(--mono); font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); white-space: nowrap; }
.quiz-timer.is-low { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.quiz-progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.quiz-progress__fill { height: 100%; width: 0%; background: var(--primary); border-radius: 999px; transition: width .4s ease; }

.quiz-stats { display: flex; gap: 10px; margin-bottom: 16px; }
.qstat { flex: 1; text-align: center; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.qstat b { display: block; font-size: 1.1rem; font-weight: 800; }
.qstat span { font-size: .74rem; color: var(--text-muted); font-weight: 600; }
.qstat--ok b { color: var(--success); }
.qstat--ko b { color: var(--danger); }

/* ---------- Choix du mode (entraînement / examen) ---------- */
.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 620px) { .modes { grid-template-columns: 1fr; } }
.mode-card { display: flex; align-items: flex-start; gap: 13px; text-align: left; padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; font: inherit; color: inherit; transition: box-shadow .16s, border-color .16s, transform .16s; }
.mode-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.mode-card.is-on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.mode-card__ic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.mode-card__ic svg { width: 21px; height: 21px; }
.mode-card__body { display: flex; flex-direction: column; gap: 4px; }
.mode-card__title { font-weight: 700; font-size: 1.02rem; }
.mode-card__desc { color: var(--text-muted); font-size: .88rem; line-height: 1.5; }

.exam-opts { margin-bottom: 16px; }
.exam-opts__label { font-weight: 650; font-size: .9rem; margin: 0 0 10px; }
.exam-opts__meta { color: var(--text-muted); font-size: .86rem; margin: 12px 0 14px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip { padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; transition: background .14s, color .14s, border-color .14s; }
.opt-chip:hover { border-color: var(--border-strong); }
.opt-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

.exam-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.exam-nav .qhint { margin: 0; }

.qcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.qtag { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 13px; padding: 4px 10px; border-radius: 6px; font-size: .74rem; font-weight: 650; background: var(--surface-2); color: var(--text-muted); }
.qtag svg { width: 13px; height: 13px; }
.qtext { font-size: 1.14rem; font-weight: 600; margin: 0 0 6px; line-height: 1.5; color: var(--text); }
.qtext code, .qhint code, .mistake code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.qhint { color: var(--text-faint); font-size: .84rem; margin: 8px 0 0; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.qhint svg { width: 15px; height: 15px; }
.qimg { margin: 16px auto; display: block; border-radius: var(--radius); border: 1px solid var(--border); }

.choices { display: grid; gap: 9px; margin-top: 20px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 15px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .96rem; cursor: pointer; transition: border-color .13s, background .13s; }
.choice:hover:not(:disabled) { border-color: var(--primary); background: var(--surface-2); }
.choice__mark { position: relative; flex: none; width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: var(--text-faint); transition: .13s; }
.choice__mark .mk-check { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .13s; }
.choice__mark .mk-check svg { width: 15px; height: 15px; color: #fff; }
.choice__mark .mk-letter { transition: opacity .13s; }
.choice.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.choice.is-selected .choice__mark { background: var(--primary); border-color: var(--primary); }
.choice.correct { border-color: var(--success-border); background: var(--success-soft); }
.choice.correct .choice__mark { background: var(--success); border-color: var(--success); }
.choice.wrong { border-color: var(--danger-border); background: var(--danger-soft); }
.choice.wrong .choice__mark { background: var(--danger); border-color: var(--danger); }
.choice.is-selected .mk-letter, .choice.correct .mk-letter, .choice.wrong .mk-letter { opacity: 0; }
.choice.is-selected .mk-check, .choice.correct .mk-check, .choice.wrong .mk-check { opacity: 1; }
.choice:disabled { cursor: default; }

.qfeedback { margin-top: 20px; padding: 15px; border-radius: 11px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1px solid var(--border); }
.qfeedback.ok { background: var(--success-soft); border-color: var(--success-border); }
.qfeedback.ko { background: var(--danger-soft); border-color: var(--danger-border); }
.qfeedback__txt { font-weight: 700; margin: 0; flex: 1; min-width: 150px; display: flex; align-items: center; gap: 8px; }
.qfeedback.ok .qfeedback__txt { color: var(--success); }
.qfeedback.ko .qfeedback__txt { color: var(--danger); }
.qfeedback__txt svg { width: 19px; height: 19px; }
.kbd { font-family: var(--mono); font-size: .72rem; padding: 2px 6px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-muted); font-weight: 700; }

/* Recap */
.recap { max-width: 760px; margin-inline: auto; }
.recap__score { text-align: center; padding: 30px 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.ring { --p: 0; width: 140px; height: 140px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--ring-color, var(--primary)) calc(var(--p) * 1%), var(--surface-3) 0); transition: --p 1s ease; }
.ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.ring__val { position: relative; font-size: 1.9rem; font-weight: 800; }
.ring__val small { font-size: .95rem; font-weight: 700; color: var(--text-muted); }
.recap__msg { font-size: 1.1rem; font-weight: 700; margin: 4px 0 2px; }
.recap__sub { color: var(--text-muted); margin: 0; }
.recap__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.mistakes { margin-top: 8px; }
.mistakes h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.mistakes h2 svg { width: 18px; height: 18px; color: var(--danger); }
.mistake { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--danger); border-radius: var(--radius); padding: 15px 17px; margin-bottom: 11px; }
.mistake__q { font-weight: 600; margin: 0 0 9px; }
.mistake__line { display: flex; gap: 8px; font-size: .89rem; margin: 4px 0; }
.mistake__line b { flex: none; color: var(--text-muted); font-weight: 600; }
.mistake__given { color: var(--danger); }
.mistake__correct { color: var(--success); }
.empty-good { text-align: center; padding: 22px; color: var(--success); font-weight: 650; background: var(--success-soft); border-radius: var(--radius); border: 1px solid var(--success-border); }

.loader { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.spinner { width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface); }
.footer__inner { max-width: var(--maxw); margin-inline: auto; padding: 30px 20px; display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; justify-content: space-between; }
.footer__brand { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.footer p { margin: 8px 0 0; color: var(--text-faint); font-size: .87rem; max-width: 40ch; }
.footer__links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer__links a { color: var(--text-muted); font-size: .89rem; font-weight: 600; }
.footer__copy { border-top: 1px solid var(--border); }
.footer__copy p { max-width: none; padding: 0 20px 24px; max-width: var(--maxw); margin: 0 auto; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 30px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 9px; font-weight: 600; font-size: .88rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .28s cubic-bezier(.22,1,.36,1); z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(10px); animation: reveal .45s forwards; }
  @keyframes reveal { to { opacity: 1; transform: none; } }
  .fade-in { animation: fade .3s ease; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 560px) {
  .nav__links .nav__link { display: none; }
  .qcard { padding: 18px; }
}
