/* =========================================================================
   EDUF — LMS · styles
   Tokens : DESIGN.md §11, sans ajout. Panneaux blancs à angles droits,
   éléments cliquables en pilule, un seul bouton rouge par écran.
   ========================================================================= */
:root {
  --navy: #031e6c; --navy-deep: #081330; --flag: #002395; --red: #ed2939;
  --red-btn: #d81f31; --red-btn-hover: #c01b2b;
  --paper: #f6f8fd; --white: #ffffff; --tint: #eef3ff; --blue-light: #d9e5ff; --rule: #dbe2f0;
  --ink: #081330; --ink-soft: #464e63; --ink-mid: #3b4d80;
  --ok: #1d7346; --ok-bg: #e2f3e9; --warn: #875600; --warn-bg: #fbefd6; --far: #c01d2c; --far-bg: #fde5e7;
  --error-on-navy: #ffc2c7; --focus: #2d62ff;
  --serif: "Addingtoncf", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Satoshi", Arial, Helvetica, sans-serif;
  --fs-body: 17px; --lh-body: 1.55;
  --fs-h1: clamp(32px, 4.8vw, 52px); --fs-h2: clamp(26px, 3.4vw, 37px); --fs-big: clamp(26px, 3vw, 35px);
  --fs-label: 12px; --ls-label: .1em;
  --radius-pill: 999px; --radius-box: 0;
  --tricolore: linear-gradient(90deg, var(--flag) 0 33.34%, #fff 33.34% 66.67%, var(--red) 66.67%);
  --container: 1080px; --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: var(--fs-body); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; }
body.texte-grand { font-size: 19px; }
h1, h2, h3, h4, p, ul, ol, figure, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; color: var(--navy); text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: 22px; }
h4 { font-size: 17px; font-weight: 700; color: var(--navy); }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tricolore { height: 5px; background: var(--tricolore); }
.label { font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; font-weight: 700; color: var(--ink-mid); }
.muet { color: var(--ink-soft); }
.petit { font-size: 14px; }
.chiffre { font-family: var(--serif); font-weight: 600; font-variant-numeric: tabular-nums; }
.pile > * + * { margin-top: 16px; }
.pile-l > * + * { margin-top: 28px; }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ligne--entre { justify-content: space-between; }
.evitement { position: absolute; left: 8px; top: -60px; background: var(--white); padding: 10px 16px; z-index: 50; }
.evitement:focus { top: 8px; }

/* --- Boutons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 12px 24px; border-radius: var(--radius-pill);
  border: 2px solid var(--navy); background: var(--navy); color: var(--white);
  font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; text-align: center;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.btn:active { transform: translateY(1px); }
.btn--rouge { background: var(--red-btn); border-color: var(--red-btn); }
.btn--rouge:hover { background: var(--red-btn-hover); border-color: var(--red-btn-hover); }
.btn--contour { background: transparent; color: var(--navy); }
.btn--contour:hover { background: var(--tint); color: var(--navy); }
.btn--clair { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn--clair:hover { background: var(--tint); border-color: var(--tint); }
.btn--fantome { background: transparent; border-color: transparent; color: var(--navy); padding-inline: 12px; }
.btn--fantome:hover { background: var(--tint); border-color: var(--tint); }
.btn--petit { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.lien-btn { background: none; border: 0; padding: 0; color: var(--navy); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* --- Structure ------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.laterale { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--white); border-right: 1px solid var(--rule); display: flex; flex-direction: column; }
.laterale__logo { padding: 22px 22px 18px; display: block; }
.laterale__logo img { height: 46px; width: auto; }
.laterale__formation { margin: 0 16px 12px; }
.laterale__formation select { width: 100%; min-height: 44px; border: 1px solid var(--rule); background: var(--tint); padding: 8px 12px; border-radius: var(--radius-pill); font-weight: 700; color: var(--navy); }
.nav { padding: 6px 12px; display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 14px; color: var(--ink-mid); text-decoration: none; font-weight: 500; border-radius: var(--radius-pill); }
.nav a svg { width: 22px; height: 22px; flex: none; }
.nav a:hover { background: var(--tint); color: var(--navy); }
.nav a[aria-current="page"] { background: var(--navy); color: var(--white); font-weight: 700; }
.laterale__pied { margin-top: auto; padding: 16px 22px 22px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-soft); }
.laterale__pied strong { color: var(--ink); display: block; }
.principal { min-width: 0; }
.contenu { max-width: var(--container); margin-inline: auto; padding: 32px max(var(--gutter), 3vw) 64px; }
.entete-mobile { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .laterale { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 0 100vmax rgba(8, 19, 48, 0); }
  .laterale.ouverte { transform: none; box-shadow: 0 0 0 100vmax rgba(8, 19, 48, .45); }
  .entete-mobile { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30; background: var(--white); border-bottom: 1px solid var(--rule); padding: 8px var(--gutter); }
  .entete-mobile img { height: 34px; width: auto; }
  .contenu { padding-top: 20px; }
}

/* --- Bandeaux ------------------------------------------------------------- */
.bandeau { padding: 10px var(--gutter); font-size: 14px; text-align: center; }
.bandeau--demo { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #f0dcb0; }
.bandeau--demo strong { color: var(--warn); }
.alerte { padding: 12px 16px; border-left: 4px solid var(--navy); background: var(--tint); font-size: 15px; }
.alerte--ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.alerte--warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.alerte--far { border-color: var(--far); background: var(--far-bg); color: var(--far); }

/* --- Hero marine ---------------------------------------------------------- */
.hero { position: relative; background: var(--navy); color: var(--white); padding: 32px clamp(20px, 4vw, 44px) 34px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--tricolore); }
.hero h1, .hero h2 { color: var(--white); }
.hero .label { color: var(--blue-light); }
.hero p { color: #dfe7ff; max-width: 62ch; }
.hero__etiquette { display: inline-block; background: var(--red); color: var(--white); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; font-weight: 700; padding: 5px 12px; border-radius: var(--radius-pill); }
.hero__grille { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
@media (max-width: 760px) { .hero__grille { grid-template-columns: 1fr; } }

/* --- Panneaux et grilles -------------------------------------------------- */
.panneau { background: var(--white); border: 1px solid var(--rule); padding: 24px; }
.panneau--teinte { background: var(--tint); border-color: var(--blue-light); }
.panneau h2 { font-size: 26px; }
.panneau__titre { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 240px)), 1fr)); }
.grille-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .grille-2 { grid-template-columns: 1fr; } }
.entete-page { margin-bottom: 24px; }
.entete-page p { color: var(--ink-mid); margin-top: 8px; font-size: 18px; }
.fil { font-size: 14px; margin-bottom: 14px; color: var(--ink-soft); }
.fil a { color: var(--ink-mid); }

/* KPI */
.kpi { background: var(--white); border: 1px solid var(--rule); padding: 18px 20px; }
.kpi__valeur { font-family: var(--serif); font-size: var(--fs-big); font-weight: 600; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__label { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.hero .kpi { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); }
.hero .kpi__valeur { color: var(--white); }
.hero .kpi__label { color: #cdd8f7; }

/* Barres de progression */
.barre { height: 8px; background: var(--blue-light); border-radius: var(--radius-pill); overflow: hidden; }
.barre > span { display: block; height: 100%; background: var(--navy); border-radius: inherit; transition: width .4s; }
.barre--ok > span { background: var(--ok); }
.barre--warn > span { background: var(--warn); }
.barre--far > span { background: var(--far); }
.hero .barre { background: rgba(255, 255, 255, .2); }
.hero .barre > span { background: var(--white); }

/* Étiquettes */
.etiquette { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--rule); background: var(--white); font-size: 13px; font-weight: 500; color: var(--ink-mid); white-space: nowrap; }
.etiquette--ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); font-weight: 700; }
.etiquette--warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); font-weight: 700; }
.etiquette--far { background: var(--far-bg); border-color: transparent; color: var(--far); font-weight: 700; }
.etiquette--marine { background: var(--navy); border-color: var(--navy); color: var(--white); font-weight: 700; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 8px; }
.sur-marine .etiquette { background: transparent; border-color: rgba(255, 255, 255, .4); color: var(--white); }

/* Onglets segmentés */
.onglets { display: inline-flex; gap: 4px; padding: 5px; background: var(--blue-light); border-radius: var(--radius-pill); flex-wrap: wrap; }
.onglets button, .onglets a { min-height: 42px; padding: 8px 22px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-mid); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; }
.onglets [aria-selected="true"], .onglets [aria-current="page"] { background: var(--white); color: var(--navy); box-shadow: 0 1px 3px rgba(8, 19, 48, .12); }

/* --- Cartes de module ----------------------------------------------------- */
.modules { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.carte-module { position: relative; display: flex; flex-direction: column; min-height: 230px; padding: 24px; background: var(--navy); color: var(--white); text-decoration: none; overflow: hidden; transition: transform .15s, background .15s; }
.carte-module:nth-child(5n+2) { background: #0a2a86; }
.carte-module:nth-child(5n+3) { background: var(--flag); }
.carte-module:nth-child(5n+4) { background: #13306f; }
.carte-module:nth-child(5n+5) { background: var(--navy-deep); }
.carte-module:hover { transform: translateY(-2px); }
.carte-module::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--tricolore); opacity: 0; transition: opacity .15s; }
.carte-module:hover::after, .carte-module:focus-visible::after { opacity: 1; }
.carte-module__num { font-family: var(--serif); font-size: 64px; line-height: 1; color: rgba(255, 255, 255, .28); font-weight: 600; }
.carte-module__haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.carte-module h3 { color: var(--white); margin-top: auto; padding-top: 18px; font-size: 23px; }
.carte-module__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: #cdd8f7; margin-top: 10px; }
.carte-module .barre { margin-top: 14px; background: rgba(255, 255, 255, .22); }
.carte-module .barre > span { background: var(--white); }
.carte-module--verrou { background: #5b6584 !important; cursor: default; }
.carte-module--verrou:hover { transform: none; }

/* Liste de leçons */
.lecons { border-top: 1px solid var(--rule); }
.lecon-ligne { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.lecon-ligne:hover { background: var(--tint); }
.lecon-ligne__num { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--rule); font-weight: 700; color: var(--ink-mid); }
.lecon-ligne--faite .lecon-ligne__num { background: var(--ok); border-color: var(--ok); color: var(--white); }
.lecon-ligne__titre { font-weight: 700; color: var(--navy); }

/* --- Fiche (leçon) -------------------------------------------------------- */
.fiche { max-width: 780px; }
.fiche > * + * { margin-top: 22px; }
.fiche h2 { font-size: 26px; margin-top: 34px; }
.fiche p { max-width: 70ch; }
.fiche .intro { font-size: 19px; color: var(--ink-mid); }
.fiche strong { color: var(--navy); }
.bloc-cartes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.bloc-cartes > div { background: var(--navy); color: var(--white); padding: 18px; }
.bloc-cartes h4 { color: var(--white); font-family: var(--serif); font-size: 21px; font-weight: 600; margin-bottom: 6px; }
.bloc-cartes p { color: #dfe7ff; font-size: 15px; }
.bloc-cartes strong { color: var(--white); }
.tableau-defile { position: relative; overflow-x: auto; border: 1px solid var(--rule); background: var(--white); }
table.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { background: var(--navy); color: var(--white); text-align: left; font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; padding: 12px 14px; white-space: nowrap; }
.tableau td { padding: 12px 14px; border-top: 1px solid var(--rule); vertical-align: top; }
.tableau td:first-child { font-weight: 700; color: var(--navy); }
.tableau tbody tr:hover { background: var(--tint); }
.tableau--simple td:first-child { font-weight: 400; color: var(--ink); }
.liste-puces li { position: relative; padding-left: 22px; }
.liste-puces li + li { margin-top: 8px; }
.liste-puces li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; background: var(--navy); }
.citation { border-left: 4px solid var(--red); padding: 6px 0 6px 18px; font-family: var(--serif); font-size: 21px; color: var(--navy); }
.citation cite { display: block; margin-top: 6px; font-family: var(--sans); font-size: 14px; font-style: normal; color: var(--ink-soft); }
.bloc-chiffres { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.bloc-chiffres > div { border: 1px solid var(--rule); background: var(--white); padding: 14px 16px; }
.bloc-chiffres .chiffre { font-size: 30px; color: var(--navy); display: block; line-height: 1.1; }
.bloc-chiffres span:last-child { font-size: 14px; color: var(--ink-soft); }
.encadre { padding: 18px 20px; border: 1px solid var(--rule); background: var(--white); border-left-width: 5px; }
.encadre h4 { font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; margin-bottom: 10px; }
.encadre--retenir { border-left-color: var(--ok); }
.encadre--retenir h4 { color: var(--ok); }
.encadre--pieges { border-left-color: var(--warn); background: #fffaf0; }
.encadre--pieges h4 { color: var(--warn); }
.encadre--situation { border-left-color: var(--navy); background: var(--tint); }
.encadre--situation details { margin-top: 10px; }
.encadre--situation summary { font-weight: 700; color: var(--navy); cursor: pointer; min-height: 32px; }
.encadre--qr dl > div { padding: 10px 0; border-top: 1px solid var(--rule); }
.encadre--qr dl > div:first-child { border-top: 0; padding-top: 0; }
.encadre--qr dt { font-weight: 700; }
.encadre--qr dd { margin: 2px 0 0; color: var(--ink-mid); }
.encadre--qr dd::before { content: "» "; color: var(--red); font-weight: 700; }

/* --- Exercices ------------------------------------------------------------ */
.exo { background: var(--white); border: 1px solid var(--rule); padding: 22px; }
.exo + .exo { margin-top: 16px; }
.exo__type { margin-bottom: 8px; }
.exo__question { font-weight: 700; font-size: 18px; color: var(--ink); margin-bottom: 14px; }
.options { display: grid; gap: 10px; }
.option { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; width: 100%; min-height: 52px; padding: 10px 14px; text-align: left; background: var(--white); border: 2px solid var(--rule); border-radius: 0; font-size: 16px; color: var(--ink); transition: border-color .12s, background .12s; }
.option:hover:not([disabled]) { border-color: var(--navy); background: var(--tint); }
.option__lettre { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--tint); color: var(--navy); font-weight: 700; font-size: 14px; }
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--navy); background: var(--tint); }
.option[aria-pressed="true"] .option__lettre, .option[aria-checked="true"] .option__lettre { background: var(--navy); color: var(--white); }
.option--juste { border-color: var(--ok) !important; background: var(--ok-bg) !important; }
.option--juste .option__lettre { background: var(--ok) !important; color: var(--white) !important; }
.option--fausse { border-color: var(--far) !important; background: var(--far-bg) !important; }
.option--fausse .option__lettre { background: var(--far) !important; color: var(--white) !important; }
.option[disabled] { cursor: default; }
.vf { display: flex; gap: 10px; flex-wrap: wrap; }
.vf .option { width: auto; min-width: 140px; grid-template-columns: 1fr; text-align: center; font-weight: 700; }
.retour { margin-top: 14px; padding: 12px 16px; font-size: 15px; border-left: 4px solid; }
.retour--ok { border-color: var(--ok); background: var(--ok-bg); color: #145233; }
.retour--far { border-color: var(--far); background: var(--far-bg); color: #8c1520; }
.retour strong { color: inherit; }
.exo__actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.assoc { display: grid; gap: 10px; }
.assoc__ligne { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--rule); }
.assoc__ligne--ok { border-color: var(--ok); background: var(--ok-bg); }
.assoc__ligne--far { border-color: var(--far); background: var(--far-bg); }
.assoc__gauche { font-weight: 700; color: var(--navy); }
@media (max-width: 560px) { .assoc__ligne { grid-template-columns: 1fr; } }
select.choix, .champ select { width: 100%; min-height: 44px; padding: 8px 12px; border: 2px solid var(--rule); background: var(--white); border-radius: 0; }
select.choix:focus { border-color: var(--navy); }
.chrono-liste { display: grid; gap: 8px; counter-reset: c; }
.chrono-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid var(--rule); background: var(--white); }
.chrono-item::before { counter-increment: c; content: counter(c); width: 30px; height: 30px; display: grid; place-items: center; background: var(--tint); color: var(--navy); font-weight: 700; border-radius: 50%; font-size: 14px; }
.chrono-item--ok { border-color: var(--ok); background: var(--ok-bg); }
.chrono-item--far { border-color: var(--far); background: var(--far-bg); }
.chrono-item__fleches { display: flex; gap: 4px; }
.chrono-item__fleches button { width: 40px; height: 40px; border: 1px solid var(--rule); background: var(--white); border-radius: 50%; font-size: 18px; line-height: 1; color: var(--navy); }
.chrono-item__fleches button:disabled { opacity: .3; }
.trous { line-height: 2.6; font-size: 18px; }
.trous select { width: auto; min-width: 130px; min-height: 40px; padding: 4px 8px; border: 2px solid var(--navy); background: var(--tint); font-weight: 700; color: var(--navy); margin: 0 4px; }
.trous select.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.trous select.far { border-color: var(--far); background: var(--far-bg); color: var(--far); }

/* --- Examen --------------------------------------------------------------- */
.examen { max-width: 900px; margin-inline: auto; }
.examen-barre { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--white); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.examen-barre::before { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--tricolore); }
.minuteur { font-family: var(--serif); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.minuteur svg { width: 22px; height: 22px; }
.minuteur--alerte { color: var(--error-on-navy); }
.examen-carte { background: var(--white); border: 1px solid var(--rule); padding: clamp(18px, 4vw, 32px); }
.examen-carte__q { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 28px); color: var(--navy); font-weight: 600; line-height: 1.25; margin: 6px 0 22px; }
.examen-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.pastilles { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.pastille { height: 44px; border: 1px solid var(--rule); background: var(--white); font-weight: 700; color: var(--ink-mid); font-size: 14px; position: relative; }
.pastille--repondue { background: var(--navy); border-color: var(--navy); color: var(--white); }
.pastille--courante { outline: 3px solid var(--focus); outline-offset: 1px; }
.pastille--marquee::after { content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.pastille--juste { background: var(--ok); border-color: var(--ok); color: var(--white); }
.pastille--fausse { background: var(--far); border-color: var(--far); color: var(--white); }
.legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
.legende span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--rule); }
.legende .l-rep::before { background: var(--navy); border-color: var(--navy); }
.legende .l-marq::before { background: var(--red); border-radius: 50%; border-color: var(--red); }

/* Cartes d'examen blanc (par parcours) */
.carte-examen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 26px; background: var(--navy); color: var(--white); position: relative; overflow: hidden; }
.carte-examen:nth-of-type(2) { background: var(--flag); }
.carte-examen:nth-of-type(3) { background: var(--navy-deep); }
.carte-examen::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--tricolore); background: linear-gradient(180deg, var(--flag) 0 33.34%, #fff 33.34% 66.67%, var(--red) 66.67%); }
.carte-examen h3 { color: var(--white); font-size: 28px; margin: 4px 0 8px; }
.carte-examen p { color: #dfe7ff; max-width: 60ch; }
.carte-examen .label { color: var(--blue-light); }
.carte-examen__meta { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid rgba(255, 255, 255, .3); border-radius: var(--radius-pill); overflow: hidden; font-weight: 700; font-size: 14px; }
.carte-examen__meta span { padding: 8px 14px; display: inline-flex; align-items: center; gap: 6px; }
.carte-examen__meta span + span { border-left: 1px solid rgba(255, 255, 255, .3); }
.carte-examen__meta svg { width: 16px; height: 16px; }
.carte-examen__droite { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 16px; }
.carte-examen--actuelle { box-shadow: inset 0 0 0 3px var(--white); }
@media (max-width: 760px) { .carte-examen { grid-template-columns: minmax(0, 1fr); padding: 22px 18px 22px 24px; } .carte-examen .etiquettes { min-width: 0; } .carte-examen .etiquette { white-space: normal; } .carte-examen__droite { align-items: flex-start; } }

/* Résultats */
.score { display: flex; align-items: baseline; gap: 6px; }
.score__valeur { font-family: var(--serif); font-size: clamp(64px, 9vw, 96px); font-weight: 600; line-height: 1; color: var(--white); }
.score__total { font-family: var(--serif); font-size: 32px; color: #cdd8f7; }
.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-pill); font-weight: 700; }
.verdict--ok { background: var(--ok-bg); color: var(--ok); }
.verdict--far { background: var(--far-bg); color: var(--far); }
.themes-barres { display: grid; gap: 14px; }
.theme-barre__haut { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; margin-bottom: 6px; }
.theme-barre__haut strong { color: var(--navy); }
.correction { border-top: 1px solid var(--rule); }
.correction__item { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.correction__q { font-weight: 700; margin-bottom: 8px; display: flex; gap: 10px; }
.correction__q .pastille { flex: none; width: 36px; height: 36px; display: grid; place-items: center; font-size: 13px; }
.correction__rep { font-size: 15px; padding-left: 46px; }
.correction__rep p + p { margin-top: 4px; }
.rep-ok { color: var(--ok); font-weight: 700; }
.rep-far { color: var(--far); font-weight: 700; text-decoration: line-through; text-decoration-thickness: 1px; }

/* Graphique */
.graphe { width: 100%; height: auto; overflow: visible; }
.graphe text { font-family: var(--sans); font-size: 12px; fill: var(--ink-soft); }
.graphe .axe { stroke: var(--rule); }
.graphe .seuil { stroke: var(--red); stroke-dasharray: 5 4; stroke-width: 1.5; }
.graphe .courbe { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; }
.graphe .aire { fill: var(--navy); opacity: .08; }
.graphe .point { fill: var(--white); stroke: var(--navy); stroke-width: 2.5; }
.graphe .point--ok { stroke: var(--ok); fill: var(--ok); }
.graphe .seuil-label { fill: var(--far); font-weight: 700; }

/* Jauge circulaire */
.jauge { position: relative; width: 150px; height: 150px; flex: none; }
.jauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.jauge circle { fill: none; stroke-width: 12; }
.jauge__fond { stroke: rgba(255, 255, 255, .2); }
.jauge__val { stroke: var(--white); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.jauge__texte { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.jauge__texte .chiffre { font-size: 38px; line-height: 1; color: var(--white); }
.jauge__texte span:last-child { font-size: 12px; color: #cdd8f7; }

/* Flashcards */
.flash { perspective: 1200px; max-width: 560px; margin-inline: auto; }
.flash__carte { position: relative; width: 100%; min-height: 260px; border: 0; padding: 0; background: none; transform-style: preserve-3d; transition: transform .45s; }
.flash__carte.retournee { transform: rotateY(180deg); }
.flash__face { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; padding: 28px; text-align: center; backface-visibility: hidden; border: 1px solid var(--rule); background: var(--white); }
.flash__face--verso { transform: rotateY(180deg); background: var(--navy); color: var(--white); border-color: var(--navy); }
.flash__face .label { color: var(--ink-mid); }
.flash__face--verso .label { color: var(--blue-light); }
.flash__texte { font-family: var(--serif); font-size: clamp(22px, 3vw, 28px); font-weight: 600; color: var(--navy); line-height: 1.25; }
.flash__face--verso .flash__texte { color: var(--white); font-family: var(--sans); font-size: 20px; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .flash__carte { transition: none; } }

/* Frise */
.frise { position: relative; padding-left: 28px; }
.frise::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(180deg, var(--flag), var(--navy) 50%, var(--red)); }
.frise__item { position: relative; padding: 0 0 22px; }
.frise__item::before { content: ""; position: absolute; left: -25px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 3px solid var(--navy); }
.frise__item--prio::before { background: var(--red); border-color: var(--red); }
.frise__annee { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--navy); line-height: 1.1; }
.frise__titre { font-weight: 700; }
.frise__texte { color: var(--ink-soft); font-size: 15px; max-width: 60ch; }

/* Formulaires */
.champ { display: grid; gap: 6px; }
.champ label, .champ .label-champ { font-weight: 700; font-size: 15px; }
.champ input, .champ textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--rule); background: var(--white); border-radius: 0; }
.champ input:focus, .champ textarea:focus, .champ select:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(45, 98, 255, .25); }
.champ .aide { font-size: 13px; color: var(--ink-soft); }
.champs { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.cases { display: grid; gap: 8px; }
.case { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rule); background: var(--white); cursor: pointer; }
.case input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex: none; }
.case--off { opacity: .55; }
.erreur-champ { color: var(--far); font-size: 14px; font-weight: 500; }

/* Connexion */
.connexion { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.connexion__visuel { background: var(--navy); color: var(--white); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.connexion__visuel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--tricolore); }
.connexion__visuel h1 { color: var(--white); }
.connexion__visuel p { color: #dfe7ff; font-size: 19px; max-width: 46ch; }
.connexion__atouts { display: grid; gap: 14px; }
.connexion__atouts li { display: flex; gap: 12px; align-items: flex-start; color: #dfe7ff; }
.connexion__atouts svg { width: 24px; height: 24px; flex: none; color: var(--white); margin-top: 1px; }
.connexion__form { display: grid; place-items: center; padding: 32px var(--gutter); background: var(--paper); }
.connexion__form form, .connexion__form .boite { width: 100%; max-width: 420px; }
.connexion__logo { height: 56px; width: auto; margin-bottom: 26px; }
.logo-blanc { filter: brightness(0) invert(1); height: 48px; width: auto; }
@media (max-width: 860px) { .connexion { grid-template-columns: 1fr; } .connexion__visuel { padding-bottom: 32px; } .connexion__atouts { display: none; } }

/* Fenêtre modale */
dialog.modale { border: 0; padding: 0; max-width: min(640px, calc(100vw - 32px)); width: 100%; background: var(--white); color: var(--ink); }
dialog.modale::backdrop { background: rgba(8, 19, 48, .55); }
.modale__entete { padding: 20px 24px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modale__entete h2 { font-size: 24px; }
.modale__corps { padding: 24px; max-height: 70vh; overflow-y: auto; }
.modale__pied { padding: 16px 24px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Divers */
.vide { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.vide h3 { margin-bottom: 8px; }
.chargement { padding: 80px 20px; text-align: center; color: var(--ink-soft); }
.chargement::before { content: ""; display: block; width: 36px; height: 36px; margin: 0 auto 14px; border: 4px solid var(--blue-light); border-top-color: var(--navy); border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chargement::before { animation: none; } * { scroll-behavior: auto !important; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy-deep); color: var(--white); padding: 12px 20px; border-radius: var(--radius-pill); font-weight: 500; z-index: 60; box-shadow: 0 6px 24px rgba(8, 19, 48, .3); max-width: calc(100vw - 32px); }
.code-copie { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--tint); padding: 14px 16px; border: 1px dashed var(--ink-mid); white-space: pre-wrap; font-size: 14px; word-break: break-word; }
.separateur { height: 1px; background: var(--rule); border: 0; margin: 24px 0; }
.action-suivante { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
@media (max-width: 560px) { .action-suivante { grid-template-columns: 1fr; } }
.liste-simple li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.liste-simple li:last-child { border-bottom: 0; }
.recherche { min-height: 44px; padding: 8px 16px; border: 2px solid var(--rule); border-radius: var(--radius-pill); background: var(--white); min-width: min(100%, 280px); }
.recherche:focus { border-color: var(--navy); outline: none; }

/* Impression d'une fiche (« fiches téléchargeables ») */
@media print {
  body { background: #fff; font-size: 12pt; }
  .laterale, .entete-mobile, .bandeau, .no-print, .exo, .exo__actions, .btn, .fil { display: none !important; }
  .app { display: block; }
  .contenu { padding: 0; max-width: none; }
  .hero { background: #fff !important; color: var(--ink); padding: 0 0 12pt; border-bottom: 2pt solid var(--navy); }
  .hero h1, .hero p, .hero .label { color: var(--navy) !important; }
  .bloc-cartes > div { background: #fff; color: var(--ink); border: 1pt solid var(--navy); }
  .bloc-cartes h4, .bloc-cartes p { color: var(--ink); }
  .encadre, .tableau-defile, .bloc-cartes > div { break-inside: avoid; }
  .tableau th { background: #fff; color: var(--navy); border-bottom: 1.5pt solid var(--navy); }
  .encadre--situation details > * { display: block !important; }
  a { text-decoration: none; color: inherit; }
}
.cases { border: 0; padding: 0; margin: 0; min-width: 0; }
