/* =====================================================================
   Prépa-TCF Canada · Formation en ligne
   Rouge du drapeau, blanc, ardoise. Titres condensés (Archivo), interface
   (IBM Plex Sans), lecture (Literata), données et codes (IBM Plex Mono).
   ===================================================================== */
:root {
  --rouge: #d52b1e;
  --rouge-fonce: #9e1d14;
  --rouge-teinte: #fbeceb;
  --rouge-voile: #fdf6f5;
  --neige: #ffffff;
  --givre: #f3f4f2;
  --ardoise: #1e272c;
  --ardoise-2: #2f3b42;
  --lichen: #5b6864;
  --trait: #dcdfdb;
  --trait-fort: #b8bdb8;
  --sapin: #1f6b45;
  --sapin-teinte: #edf6f0;
  --ambre: #9a6110;
  --ambre-teinte: #fdf6e7;
  --erreur: #a3221a;
  --erreur-teinte: #fdf0ef;
  --or: #c98a12;

  /* Alias utilisés par les composants et les styles en ligne */
  --orange: var(--rouge);
  --orange-dark: var(--rouge-fonce);
  --blue: var(--rouge-fonce);
  --squid: var(--ardoise);
  --text: var(--ardoise);
  --muted: var(--lichen);
  --border: var(--trait);
  --border-strong: var(--trait-fort);
  --green: var(--sapin);
  --green-bg: var(--sapin-teinte);
  --red: var(--erreur);
  --red-bg: var(--erreur-teinte);
  --bg: var(--givre);
  --card: var(--neige);

  --f-titre: "Archivo", "Arial Narrow", sans-serif;
  --f-ui: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --f-lecture: "Literata", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;
  --r: 4px;
  --r-carte: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--f-ui); background: var(--givre); color: var(--ardoise); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--rouge-fonce); text-decoration: underline; text-decoration-color: rgba(158, 29, 20, .3); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--f-titre); font-stretch: 78%; font-weight: 700; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.005em; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; font-stretch: 85%; }
h4 { font-size: 16px; font-stretch: 90%; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }
::selection { background: var(--rouge-teinte); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- En-tête ---------- */
.topbar { background: var(--neige); border-top: 4px solid var(--rouge); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ardoise); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; color: var(--rouge); display: grid; place-items: center; }
.brand-mark .i { width: 26px; height: 26px; }
.brand-name { font-family: var(--f-titre); font-stretch: 78%; font-weight: 800; font-size: 20px; letter-spacing: .01em; }
.brand small { font-size: 13px; color: var(--lichen); font-weight: 400; padding-left: 10px; border-left: 1px solid var(--trait); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ardoise-2); padding: 18px 10px 16px; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--rouge-fonce); }
.nav a.active { color: var(--ardoise); border-bottom-color: var(--rouge); font-weight: 600; }
.account-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 7px 12px; border: 1px solid var(--trait-fort); border-radius: var(--r); color: var(--ardoise); text-decoration: none; white-space: nowrap; }
.account-pill:hover { border-color: var(--ardoise); }
.account-pill.expired { border-color: var(--erreur); color: var(--erreur); }

.subbar { background: var(--ardoise); color: #d6dbd8; font-size: 13px; }
.subbar-inner { max-width: 1240px; margin: 0 auto; padding: 9px 24px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.subbar strong { color: #fff; }
.subbar a { color: #fff; }

/* ---------- Mise en page ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 72px; }
.page.narrow { max-width: 900px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side-l { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.grid-side-r { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.table-wrap { overflow-x: auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--lichen); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 24px; }
.mb { margin-bottom: 24px; }

.card { background: var(--neige); border: 1px solid var(--trait); border-radius: var(--r-carte); padding: 22px 24px; }
.card h2 { font-size: 22px; }
.card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-bottom: 1px solid var(--trait); margin: -22px -24px 18px; padding: 14px 24px; }
.card-header h2, .card-header h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-header .i { color: var(--rouge); }

.breadcrumb { font-size: 13px; color: var(--lichen); margin-bottom: 14px; }
.breadcrumb a { color: var(--lichen); }
.eyebrow-dark { color: var(--rouge-fonce); font-weight: 600; font-size: 14px; margin-bottom: 6px; }

/* ---------- Accueil : le drapeau comme mise en page ---------- */
.flag-hero { display: grid; grid-template-columns: 1fr 2fr 1fr; background: var(--neige); border-bottom: 1px solid var(--trait); }
.flag-hero .pale { background: var(--rouge); }
.flag-hero .pale-right { display: grid; place-items: center; color: rgba(255, 255, 255, .16); overflow: hidden; }
.flag-hero .pale-right .i { width: 70%; height: auto; aspect-ratio: 1; }
.flag-center { padding: 56px 48px 44px; display: flex; flex-direction: column; gap: 18px; }
.flag-center .leaf-mark { color: var(--rouge); }
.flag-center .leaf-mark .i { width: 34px; height: 34px; }
.flag-center h1 { font-size: clamp(34px, 4.4vw, 56px); font-stretch: 72%; font-weight: 800; line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
.flag-center h1 em { font-style: normal; color: var(--rouge); }
.flag-center .lead { font-size: 17px; color: var(--ardoise-2); max-width: 560px; margin: 0; }
.flag-center .ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.nclc-scale { margin-top: 10px; }
.nclc-scale .scale-title { font-size: 13px; color: var(--lichen); margin-bottom: 10px; }
.nclc-bar { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--ardoise); border-radius: var(--r); overflow: hidden; }
.nclc-bar span { font-family: var(--f-mono); font-size: 13px; text-align: center; padding: 8px 0; border-right: 1px solid var(--trait); color: var(--ardoise-2); }
.nclc-bar span:last-child { border-right: none; }
.nclc-bar span.on { background: var(--rouge); color: #fff; font-weight: 600; border-right-color: var(--rouge-fonce); }
.nclc-bar span.cit { background: var(--givre); }
.nclc-notes { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 8px; font-size: 12px; color: var(--lichen); line-height: 1.3; }
.nclc-notes .n-cit { grid-column: 1 / span 2; }
.nclc-notes .n-ee { grid-column: 4 / span 4; color: var(--rouge-fonce); font-weight: 600; }

.route { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--trait); margin: 8px 0 44px; }
.route > div { padding: 18px 22px 0 0; position: relative; }
.route > div::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--rouge); }
.route .step-n { font-family: var(--f-mono); font-size: 12px; color: var(--rouge-fonce); }
.route h3 { margin: 4px 0 6px; font-size: 18px; }
.route p { margin: 0; font-size: 14px; color: var(--lichen); }
.section-head { display: flex; align-items: baseline; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 28px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--r); padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid var(--trait-fort); background: var(--neige); color: var(--ardoise); text-decoration: none; transition: background .12s, border-color .12s; line-height: 1.2; }
.btn:hover { border-color: var(--ardoise); background: var(--neige); }
.btn-primary { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-primary:hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); }
.btn-dark { background: var(--ardoise); border-color: var(--ardoise); color: #fff; }
.btn-dark:hover { background: var(--ardoise-2); border-color: var(--ardoise-2); }
.btn-danger { border-color: var(--erreur); color: var(--erreur); }
.btn-danger:hover { background: var(--erreur-teinte); border-color: var(--erreur); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ardoise-2); }
.btn-ghost:hover { background: var(--givre); border-color: transparent; }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Étiquettes, barres, alertes ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 3px; background: var(--givre); color: var(--ardoise-2); white-space: nowrap; border: 1px solid transparent; }
.badge-level { font-family: var(--f-mono); background: var(--neige); border-color: var(--trait-fort); color: var(--ardoise); }
.badge-green { background: var(--sapin-teinte); color: var(--sapin); }
.badge-red { background: var(--erreur-teinte); color: var(--erreur); }
.badge-orange { background: var(--rouge-teinte); color: var(--rouge-fonce); }
.badge-outline { background: transparent; border-color: var(--trait-fort); color: var(--lichen); }

.progress { height: 6px; border-radius: 3px; background: #e6e8e5; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--rouge); transition: width .4s; }
.progress.orange > span { background: var(--rouge-fonce); }
.progress.green > span { background: var(--sapin); }
.progress.red > span { background: var(--erreur); }

.alert { border-radius: var(--r); padding: 12px 16px; border: 1px solid var(--trait); border-left: 3px solid var(--ardoise-2); background: var(--neige); margin: 12px 0; }
.alert .i { color: inherit; margin-right: 4px; }
.alert-warn { border-color: #efdcb4; border-left-color: var(--ambre); background: var(--ambre-teinte); }
.alert-success { border-color: #cfe5d7; border-left-color: var(--sapin); background: var(--sapin-teinte); }
.alert-error { border-color: #f1cfcc; border-left-color: var(--erreur); background: var(--erreur-teinte); }

/* ---------- Statistiques ---------- */
.stat { padding: 16px 20px; }
.stat .label { color: var(--lichen); font-size: 13px; }
.stat .value { font-family: var(--f-titre); font-stretch: 78%; font-size: 30px; font-weight: 700; line-height: 1.15; margin: 2px 0 4px; }
.stat .hint { font-size: 12px; color: var(--lichen); }

/* ---------- Modules ---------- */
.module-card { display: flex; flex-direction: column; gap: 10px; }
.module-card .icon { color: var(--rouge); }
.module-card .icon .i { width: 26px; height: 26px; }
.module-card h3 { margin: 0; font-size: 20px; }
.module-card .meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--lichen); }
.module-card .footer { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.module-card.is-locked { background: #fafbfa; }
.module-card.is-locked .icon { color: var(--trait-fort); }

/* ---------- Cours ---------- */
.course { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.outline { position: sticky; top: 82px; max-height: calc(100vh - 100px); overflow: auto; padding: 0; }
.outline-head { padding: 18px 20px; border-bottom: 1px solid var(--trait); }
.outline-head h3 { margin: 0 0 8px; font-size: 17px; }
.outline-section { border-bottom: 1px solid var(--trait); }
.outline-section > summary { list-style: none; padding: 12px 20px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.outline-section > summary::-webkit-details-marker { display: none; }
.outline-section > summary .i { color: var(--rouge); }
.outline-section.locked > summary { color: var(--lichen); }
.outline-section.locked > summary .i { color: var(--trait-fort); }
.outline-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 20px 8px 30px; font-size: 14px; color: var(--ardoise); text-decoration: none; }
.outline-item:hover { background: var(--rouge-voile); }
.outline-item.active { background: var(--rouge-teinte); box-shadow: inset 3px 0 0 var(--rouge); font-weight: 600; }
.outline-item.disabled { color: var(--lichen); cursor: not-allowed; opacity: .7; }
.outline-item.disabled:hover { background: transparent; }
.outline-item .check { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--trait-fort); margin-top: 3px; display: grid; place-items: center; font-size: 10px; color: #fff; }
.outline-item .check.done { background: var(--sapin); border-color: var(--sapin); }
.outline-item .check.quiz { border-radius: 3px; }
.outline-item .sub { display: block; color: var(--lichen); font-size: 12px; font-weight: 400; }

.lesson-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.prose { font-family: var(--f-lecture); font-size: 17px; line-height: 1.7; max-width: 72ch; }
.prose h2 { font-family: var(--f-titre); font-size: 24px; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--f-titre); font-size: 19px; margin-top: 1.3em; }
.prose p { margin: .7em 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--rouge); }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; font-family: var(--f-ui); font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--trait); padding: 8px 12px 8px 0; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; border-bottom: 2px solid var(--ardoise); }
.prose blockquote { margin: 16px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--rouge); font-style: italic; color: var(--ardoise-2); }
.prose code { font-family: var(--f-mono); font-size: .88em; background: var(--givre); padding: 1px 5px; border-radius: 3px; }
.prose strong { font-weight: 700; }

.example { border-top: 1px solid var(--trait); padding: 16px 0 6px; margin: 4px 0; }
.example h4 { margin: 0 0 4px; color: var(--rouge-fonce); }
.example .prose { font-size: 16px; }
.keypoints { border: 1px solid var(--trait); border-left: 3px solid var(--sapin); border-radius: var(--r); padding: 14px 18px; background: var(--neige); }
.keypoints h4 { margin: 0 0 6px; color: var(--sapin); }
.keypoints ul { margin: 0; padding-left: 1.2em; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--trait); flex-wrap: wrap; }

/* ---------- Questions ---------- */
.question { border: 1px solid var(--trait); border-radius: var(--r-carte); padding: 18px 20px; margin-bottom: 16px; background: var(--neige); }
.question-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.question-num { font-family: var(--f-mono); font-size: 12px; color: var(--lichen); }
.question .prompt { font-weight: 600; margin: 10px 0 12px; white-space: pre-line; font-size: 16px; }
.passage { font-family: var(--f-lecture); font-size: 16.5px; line-height: 1.65; white-space: pre-line; background: #fafbfa; border: 1px solid var(--trait); border-left: 3px solid var(--ardoise); padding: 14px 18px; border-radius: var(--r); }
.options { display: grid; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--trait); border-radius: var(--r); padding: 10px 14px; cursor: pointer; background: var(--neige); }
.option:hover { border-color: var(--ardoise-2); }
.option input { margin-top: 4px; accent-color: var(--rouge); }
.option.selected { border-color: var(--rouge); background: var(--rouge-voile); box-shadow: inset 0 0 0 1px var(--rouge); }
.option.correct { border-color: var(--sapin); background: var(--sapin-teinte); box-shadow: inset 0 0 0 1px var(--sapin); }
.option.wrong { border-color: var(--erreur); background: var(--erreur-teinte); box-shadow: inset 0 0 0 1px var(--erreur); }
.option .letter { font-family: var(--f-mono); font-weight: 600; color: var(--lichen); width: 16px; flex: none; }
.explanation { margin-top: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--givre); font-size: 14px; }
.transcript { margin-top: 10px; font-family: var(--f-lecture); font-size: 14px; color: var(--lichen); font-style: italic; }

.audio-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r); border: 1px solid var(--ardoise); background: var(--ardoise); color: #fff; font-weight: 600; cursor: pointer; font-size: 14px; }
.audio-btn:hover { background: var(--ardoise-2); }
.audio-btn[disabled] { opacity: .5; cursor: not-allowed; }
.audio-btn.playing { background: var(--rouge); border-color: var(--rouge); }

textarea, input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=email], select {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--trait-fort); border-radius: var(--r); background: var(--neige); color: var(--ardoise);
}
textarea:focus, input:focus, select:focus { outline: 2px solid var(--rouge); outline-offset: -1px; border-color: var(--rouge); }
textarea.writing { min-height: 230px; font-family: var(--f-lecture); font-size: 16.5px; line-height: 1.65; resize: vertical; }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
label.field > small { display: block; color: var(--lichen); margin-top: 5px; }
.wordcount { font-family: var(--f-mono); font-size: 12px; color: var(--lichen); text-align: right; margin-top: 5px; }
.wordcount.ok { color: var(--sapin); }
.wordcount.bad { color: var(--erreur); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.choice { border: 1px solid var(--trait-fort); border-radius: var(--r); padding: 11px 12px; cursor: pointer; background: var(--neige); text-align: left; color: var(--ardoise); }
.choice:hover { border-color: var(--ardoise); }
.choice.selected { border-color: var(--rouge); background: var(--rouge-voile); box-shadow: inset 0 0 0 1px var(--rouge); }
.choice strong { display: block; font-size: 15px; }
.choice span { color: var(--lichen); font-size: 12px; }

/* ---------- Enregistrement oral ---------- */
.recorder { border: 1px solid var(--trait); border-radius: var(--r); padding: 16px; background: #fafbfa; }
.timer { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 600; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rouge); display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.checklist label { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 14px; }
.checklist input { accent-color: var(--rouge); margin-top: 3px; }
.mic-level { height: 5px; border-radius: 3px; background: #e6e8e5; margin-top: 10px; overflow: hidden; }
.mic-level > span { display: block; height: 100%; width: 0; background: var(--sapin); transition: width .08s linear; }

/* ---------- Examen ---------- */
.exam-bar { position: sticky; top: 62px; z-index: 40; background: var(--neige); border-bottom: 1px solid var(--trait); }
.exam-bar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.exam-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.exam-step { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 3px; background: var(--givre); color: var(--lichen); }
.exam-step.current { background: var(--rouge); color: #fff; }
.exam-step.done { background: var(--sapin-teinte); color: var(--sapin); }
.countdown { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 20px; padding: 3px 12px; border-radius: var(--r); background: var(--ardoise); color: #fff; }
.countdown.low { background: var(--erreur); }

/* ---------- Calendrier ---------- */
.day { border: 1px solid var(--trait); border-radius: var(--r); background: var(--neige); overflow: hidden; }
.day-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--trait); font-size: 13px; }
.day-head span { font-family: var(--f-mono); color: var(--lichen); font-size: 12px; }
.day.today { border-color: var(--rouge); box-shadow: inset 0 3px 0 var(--rouge); }
.day ul { list-style: none; margin: 0; padding: 6px 0; }
.day li { display: flex; gap: 8px; align-items: center; padding: 5px 14px; font-size: 13.5px; }
.day li a { color: var(--ardoise); text-decoration: none; }
.day li a:hover { color: var(--rouge-fonce); text-decoration: underline; }
.day li .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--trait-fort); }
.day li.done .dot { background: var(--sapin); }
.day li.done a { color: var(--lichen); text-decoration: line-through; }
.day li .i { color: var(--lichen); }
.week-title { font-family: var(--f-titre); font-stretch: 80%; font-weight: 700; font-size: 17px; margin: 28px 0 12px; }

.timeline-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--trait); align-items: center; }
.timeline-item:last-child { border-bottom: none; }
.timeline-item .kind { width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; border: 1px solid var(--trait); color: var(--rouge); flex: none; }
.timeline-item.done .kind { color: var(--sapin); background: var(--sapin-teinte); border-color: transparent; }
.timeline-item a { color: var(--ardoise); text-decoration: none; }
.timeline-item a:hover { color: var(--rouge-fonce); }
.timeline-item a.btn-primary { color: #fff; }

/* ---------- Certificat ---------- */
.certificate { background: var(--neige); border: 1px solid var(--trait); padding: 14px; border-radius: var(--r-carte); }
.cert-inner { border: 2px solid var(--ardoise); outline: 1px solid var(--rouge); outline-offset: -9px; padding: 46px 48px; position: relative; text-align: center; }
.cert-inner::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, var(--rouge) 25%, var(--neige) 25%, var(--neige) 75%, var(--rouge) 75%); }
.cert-brand { display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-weight: 600; color: var(--ardoise-2); font-size: 13px; }
.cert-brand .brand-mark { width: 20px; height: 20px; }
.cert-brand .brand-mark .i { width: 20px; height: 20px; }
.cert-title { font-family: var(--f-titre); font-stretch: 72%; font-weight: 800; font-size: 40px; margin: 16px 0 4px; color: var(--ardoise); }
.cert-sub { color: var(--lichen); }
.cert-name { font-family: var(--f-lecture); font-size: 38px; font-style: italic; color: var(--ardoise); margin: 16px auto 6px; padding-bottom: 6px; border-bottom: 1px solid var(--trait-fort); display: inline-block; min-width: 50%; }
.cert-verdict { display: inline-block; margin: 18px 0; padding: 9px 22px; border-radius: var(--r); font-family: var(--f-titre); font-stretch: 80%; font-weight: 700; letter-spacing: .04em; font-size: 20px; }
.cert-verdict.pass { background: var(--sapin-teinte); color: var(--sapin); border: 2px solid var(--sapin); }
.cert-verdict.fail { background: var(--erreur-teinte); color: var(--erreur); border: 2px solid var(--erreur); }
.cert-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; }
.cert-score { border: 1px solid var(--trait); border-radius: var(--r); padding: 12px 8px; }
.cert-score .skill { font-size: 12px; color: var(--lichen); }
.cert-score .val { font-family: var(--f-mono); font-size: 24px; font-weight: 600; color: var(--ardoise); }
.cert-score .nclc { font-size: 13px; font-weight: 600; }
.cert-score.ok .nclc { color: var(--sapin); }
.cert-score.ko .nclc { color: var(--erreur); }
.cert-global { display: flex; justify-content: center; gap: 44px; margin: 8px 0 18px; flex-wrap: wrap; }
.cert-global div strong { display: block; font-family: var(--f-titre); font-stretch: 78%; font-size: 32px; color: var(--ardoise); }
.cert-global div span { font-size: 12px; color: var(--lichen); }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 28px; font-size: 12px; color: var(--lichen); text-align: left; gap: 20px; flex-wrap: wrap; }
.cert-foot strong { font-family: var(--f-mono); color: var(--ardoise); font-weight: 600; }
.seal { width: 92px; height: 92px; border-radius: 50%; background: var(--rouge); color: #fff; display: grid; place-items: center; font-family: var(--f-titre); font-stretch: 80%; font-weight: 700; font-size: 13px; text-align: center; line-height: 1.15; box-shadow: 0 0 0 5px var(--neige), 0 0 0 6px var(--rouge); }
.seal.fail { background: var(--givre); color: var(--lichen); box-shadow: 0 0 0 5px var(--neige), 0 0 0 6px var(--trait-fort); }

.weak-item { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.weak-item:last-child { border-bottom: none; }
.crit { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; margin: 5px 0; }
.crit strong { font-family: var(--f-mono); font-weight: 600; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: top; }
table.data th { font-size: 12px; font-weight: 600; color: var(--lichen); border-bottom: 1px solid var(--trait-fort); }

.spinner { width: 18px; height: 18px; border: 2px solid var(--trait); border-top-color: var(--rouge); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { display: grid; place-items: center; min-height: 50vh; gap: 12px; color: var(--lichen); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ardoise); color: #fff; padding: 12px 18px; border-radius: var(--r); border-left: 3px solid var(--rouge); z-index: 100; max-width: 420px; animation: slide .2s ease-out; font-size: 14px; }
@keyframes slide { from { transform: translateY(12px); opacity: 0; } }
footer.site { text-align: center; color: var(--lichen); font-size: 12px; padding: 28px 20px; border-top: 1px solid var(--trait); }
footer.site a { color: var(--lichen); }

/* ---------- États vides et verrous ---------- */
.empty-state { text-align: center; padding: 52px 24px; }
.empty-state .empty-icon { color: var(--rouge); margin-bottom: 10px; }
.empty-state .empty-icon .i { width: 40px; height: 40px; }
.empty-state h2 { font-size: 26px; }
.empty-state p { max-width: 560px; margin: 0 auto 22px; }

/* ---------- Offres, commande, compte ---------- */
.op-orange { color: #e06c00; font-weight: 700; }
.op-mtn { color: #1a1a1a; background: #ffcc00; padding: 0 5px; border-radius: 3px; font-weight: 700; }
.op-whatsapp { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.op-whatsapp:hover { background: #18733e; border-color: #18733e; }
.pricing { align-items: stretch; }
.price-card { display: flex; flex-direction: column; gap: 6px; position: relative; }
.price-card.featured { border-color: var(--rouge); box-shadow: inset 0 4px 0 var(--rouge); }
.price-card .ribbon { position: absolute; top: 14px; right: 16px; color: var(--rouge-fonce); font-size: 12px; font-weight: 600; }
.price-card h3 { font-size: 22px; margin: 0; }
.price-card .price { font-family: var(--f-titre); font-stretch: 75%; font-size: 40px; font-weight: 800; line-height: 1.1; }
.price-card .price span { font-family: var(--f-ui); font-size: 15px; font-weight: 500; color: var(--lichen); }
.price-card .features { list-style: none; padding: 0; margin: 12px 0 18px; flex: 1; }
.price-card .features li { padding: 7px 0 7px 22px; position: relative; font-size: 14px; border-bottom: 1px solid #eef0ed; }
.price-card .features li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; background: var(--rouge); border-radius: 1px; transform: rotate(45deg); }
.price-card .cta .btn { width: 100%; justify-content: center; }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 18px 0; border-top: 2px solid var(--trait); }
.stepper .step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--lichen); padding: 10px 6px 0 0; margin-top: -2px; border-top: 2px solid transparent; }
.stepper .step span { font-family: var(--f-mono); font-size: 12px; }
.stepper .step.current { color: var(--ardoise); border-top-color: var(--rouge); }
.stepper .step.done { color: var(--sapin); border-top-color: var(--sapin); }

.pay-box { border-radius: var(--r); padding: 16px; margin: 10px 0 14px; text-align: center; border: 1px solid var(--trait-fort); background: #fafbfa; }
.op-orange-box { border-top: 3px solid #ff7900; }
.op-mtn-box { border-top: 3px solid #ffcc00; }
.pay-amount { font-family: var(--f-titre); font-stretch: 78%; font-size: 32px; font-weight: 800; }
.pay-number { font-family: var(--f-mono); font-size: 22px; font-weight: 600; letter-spacing: .03em; margin: 4px 0; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.access-code { font-family: var(--f-mono); font-size: 24px; font-weight: 600; letter-spacing: .06em; background: var(--ardoise); color: #fff; padding: 12px 18px; border-radius: var(--r); margin: 16px auto; display: inline-block; word-break: break-all; }
.access-code.small-code { font-size: 14px; padding: 6px 10px; margin: 0; }
.referral-code { font-family: var(--f-mono); font-size: 22px; font-weight: 600; letter-spacing: .05em; color: var(--rouge-fonce); border: 1px dashed var(--rouge); border-radius: var(--r); padding: 10px; text-align: center; margin: 10px 0; background: var(--rouge-voile); }
.upsell { border-left: 3px solid var(--rouge); }
.fact-wide, .pay-logos { font-size: inherit; }

/* ---------- Avis ---------- */
.stars { color: #d3d6d2; letter-spacing: 1px; white-space: nowrap; }
.stars .star.on { color: var(--or); }
.reviews-home { margin-top: 48px; }
.reviews-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.reviews-head h2 { font-size: 28px; }
.reviews-score { text-align: right; }
.reviews-score strong { font-family: var(--f-titre); font-stretch: 78%; font-size: 38px; font-weight: 800; }
.reviews-score > span { color: var(--lichen); margin-right: 8px; }
.review-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.review-card blockquote { margin: 0; font-family: var(--f-lecture); font-size: 16px; line-height: 1.6; flex: 1; }
.review-card figcaption { font-size: 14px; }
.star-input { display: flex; gap: 4px; margin: 6px 0 12px; }
.star-input .star { font-size: 30px; line-height: 1; background: none; border: none; cursor: pointer; color: #d3d6d2; padding: 0 2px; }
.star-input .star.on { color: var(--or); }
.review-nudge { border-left: 3px solid var(--or); }

/* ---------- Onglets et fenêtres ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--trait-fort); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs .tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--lichen); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs .tab:hover { color: var(--ardoise); }
.tabs .tab.active { color: var(--ardoise); border-bottom-color: var(--rouge); }
.tabs .count { background: var(--rouge); color: #fff; border-radius: 3px; font-size: 11px; padding: 0 6px; font-family: var(--f-mono); }
dialog.modal { border: 1px solid var(--trait); border-radius: var(--r-carte); padding: 24px; width: min(520px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(30, 39, 44, .55); }
dialog.modal h2 { font-size: 22px; }

/* ---------- Espace administrateur ---------- */
.adminbar { display: none; background: var(--ardoise); color: #fff; border-top: 4px solid var(--rouge); position: sticky; top: 0; z-index: 50; }
.adminbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 54px; }
.adminbar .brand { color: #fff; }
.adminbar .brand-mark { color: #fff; }
.admin-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 3px; background: rgba(213, 43, 30, .25); color: #ffd9d5; white-space: nowrap; }
.adminbar-note { font-size: 13px; color: #a9b3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.admin-mode .topbar { display: none; }
body.admin-mode .adminbar { display: block; }
body.admin-mode .site-links { display: none; }

/* ---------- Écrans moyens et petits ---------- */
@media (max-width: 1000px) {
  .course { grid-template-columns: 1fr; }
  .course > section { order: -1; }
  .outline { position: static; max-height: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side-l, .grid-side-r { grid-template-columns: 1fr; }
  .flag-hero { grid-template-columns: 24px 1fr 24px; }
  .flag-hero .pale-right .i { display: none; }
  .flag-center { padding: 40px 28px 32px; }
  .route { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .adminbar-note { display: none; }
}
@media (max-width: 900px) {
  .topbar { position: static; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 4px 16px; }
  #account-link { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -10px; }
  .nav a { padding: 10px 10px 9px; }
  .exam-bar { top: 0; }
  .brand small { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .flag-hero { grid-template-columns: 12px 1fr 12px; }
  .flag-center { padding: 30px 18px 26px; }
  .nclc-bar span { font-size: 12px; padding: 7px 0; }
  .nclc-notes { font-size: 11px; }
  .route { grid-template-columns: 1fr; }
  .cert-inner { padding: 30px 16px; }
  .cert-scores { grid-template-columns: repeat(2, 1fr); }
  .cert-name { font-size: 28px; }
  .weak-item { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .card-header { margin: -18px -18px 14px; padding: 12px 18px; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .access-code { font-size: 19px; }
}

@media print {
  .topbar, .adminbar, .subbar, .no-print, footer.site { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .certificate { border: none; padding: 0; }
  .print-break { page-break-before: always; }
  .card { border: 1px solid var(--trait); }
}

/* =====================================================================
   Accueil : bannière en mosaïque (Québec, Montréal, Rocheuses)
   Le liseré rouge à gauche rappelle la bande du drapeau.
   ===================================================================== */
.hero-mosaic { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.15fr); background: var(--neige); border-bottom: 1px solid var(--trait); min-height: 540px; }
.hero-mosaic::before { content: ""; background: var(--rouge); }
.hero-text { padding: 52px 44px 40px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.hero-text h1 { font-size: clamp(36px, 4.2vw, 58px); font-stretch: 72%; font-weight: 800; line-height: 1.02; margin: 0; letter-spacing: -0.01em; }
.hero-text h1 em { font-style: normal; color: var(--rouge); }
.hero-text .lead { font-size: 17px; color: var(--ardoise-2); max-width: 540px; margin: 0; }
.hero-text .ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.mosaic { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; padding: 6px; background: var(--neige); }
.tile { position: relative; margin: 0; overflow: hidden; border-radius: 3px; background: var(--ardoise); }
.tile-main { grid-row: 1 / span 2; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.tile:hover img { transform: scale(1.03); }
.tile figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 16px 12px; color: #fff; background: linear-gradient(transparent, rgba(16, 20, 23, .78)); display: flex; flex-direction: column; line-height: 1.25; }
.tile figcaption strong { font-family: var(--f-titre); font-stretch: 78%; font-size: 20px; font-weight: 700; }
.tile figcaption span { font-size: 12.5px; opacity: .88; }
.tile-main figcaption strong { font-size: 26px; }

/* Bandeau de confiance */
.trust-bar { background: var(--ardoise); color: #fff; }
.trust-inner { max-width: 1240px; margin: 0 auto; padding: 16px 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-item .i { color: #ff8a80; width: 22px; height: 22px; margin-top: 2px; }
.trust-item strong { display: block; font-size: 14px; }
.trust-item span { font-size: 12.5px; color: #b9c3bf; }

/* Mini-test */
.mini-test { margin: 0 0 44px; border-top: 3px solid var(--rouge); }
.mini-test h2 { font-size: 26px; margin-bottom: 4px; }
.mini-test .muted { margin: 0 0 18px; }
.mini-questions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mini-q { border: 0; padding: 0; margin: 0; }
.mini-q legend { font-weight: 600; font-size: 14.5px; margin-bottom: 10px; line-height: 1.45; }
.mini-q legend .badge { margin-right: 4px; }
.mini-options { display: grid; gap: 6px; }
.mini-opt { text-align: left; font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--trait-fort); border-radius: var(--r); background: var(--neige); color: var(--ardoise); cursor: pointer; }
.mini-opt:hover:not([disabled]) { border-color: var(--rouge); background: var(--rouge-voile); }
.mini-opt[disabled] { cursor: default; opacity: .7; }
.mini-opt.good { border-color: var(--sapin); background: var(--sapin-teinte); color: var(--sapin); opacity: 1; font-weight: 600; }
.mini-opt.bad { border-color: var(--erreur); background: var(--erreur-teinte); color: var(--erreur); opacity: 1; }
.mini-result:empty { display: none; }
.mini-verdict { margin-top: 20px; padding: 16px 18px; border-radius: var(--r); background: var(--givre); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mini-verdict strong { font-size: 16px; }
.mini-verdict p { margin: 4px 0 0; color: var(--ardoise-2); font-size: 14px; max-width: 620px; }

/* Questions fréquentes */
.faq { margin-top: 48px; max-width: 860px; }
.faq h2 { font-size: 28px; }
.faq-item { border-bottom: 1px solid var(--trait); }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .i { color: var(--rouge); transition: transform .2s; }
.faq-item[open] summary .i { transform: rotate(45deg); }
.faq-item p { margin: 0 0 18px; color: var(--ardoise-2); max-width: 760px; }
.photo-credits { margin-top: 40px; font-size: 12px; color: var(--lichen); }

/* Bouton d'action fixe (téléphone) */
.sticky-cta { display: none; }

@media (max-width: 1000px) {
  .hero-mosaic { grid-template-columns: 16px minmax(0, 1fr); min-height: 0; }
  .mosaic { grid-column: 1 / -1; grid-template-columns: 1.3fr 1fr; height: 380px; }
  .hero-text { padding: 40px 28px 32px; }
  .trust-inner { grid-template-columns: repeat(2, 1fr); }
  .mini-questions { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero-mosaic { grid-template-columns: 10px minmax(0, 1fr); }
  .hero-text { padding: 28px 18px 24px; }
  .mosaic { height: 260px; padding: 4px; gap: 4px; }
  .tile figcaption { padding: 24px 10px 8px; }
  .tile figcaption strong, .tile-main figcaption strong { font-size: 17px; }
  .tile figcaption span { display: none; }
  .trust-inner { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
  .sticky-cta { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--neige); border-top: 1px solid var(--trait); box-shadow: 0 -4px 14px rgba(30, 39, 44, .08); }
  .sticky-cta .btn-primary { flex: 1; justify-content: center; }
  body:has(.sticky-cta) footer.site { padding-bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) { .tile img { transition: none; } }
