/* ==========================================================================
 * CONCOURS SANTÉ — SYSTÈME DE DESIGN PREMIUM & INSTITUTIONNEL
 * EAP Échelle 11 — Infirmier Grade Principal Maroc
 * ========================================================================== */

/* Polices : chargées via <link rel="stylesheet"> dans le <head> de chaque page.
   Un @import ici sérialisait CSS → CSS et retardait le premier rendu.
   Plus Jakarta Sans a été retirée : jamais utilisée, simple repli de Manrope. */

:root {
  /* Charte institutionnelle d'excellence : Vert impérial + Or + Crème */
  --bleu: #0e5d54;
  --bleu-fonce: #0a3f39;
  --vert-imp: #08332e;
  --turquoise: #c79a2e;
  --vert: #1f8a5b;
  --orange: #cf8a2c;
  --rouge: #d24b40;
  --violet: #3f7d72;
  --rose: #b8862b;
  --jaune: #e8c14a;
  
  /* Tokens de surface et de fond (Thème Clair) */
  --fond: #fdfbf7;
  --bg2: #f5f0e6;
  --carte: #ffffff;
  --surf: #ffffff;
  --texte: #1d2b27;
  --ink: #1d2b27;
  --gris: #5c6b66;
  --muted: #5c6b66;
  --line: #e7dfd0;
  
  /* Ombres et rayons */
  --ombre: 0 14px 36px rgba(10, 63, 57, 0.12);
  --shadow-lg: 0 24px 50px rgba(10, 63, 57, 0.18);
  --radius: 18px;
  --radius-lg: 24px;
  --gold: #d4af37;
  --gold2: #c39d2a;
  --cc: #0e5d54;
}

[data-theme="dark"] {
  /* Tokens de surface et de fond (Thème Sombre) */
  --bleu: #12756a;
  --bleu-fonce: #0c4a43;
  --vert-imp: #072722;
  --turquoise: #d4af37;
  --vert: #26a56c;
  --orange: #e09938;
  --rouge: #e55c50;
  --violet: #529d8f;
  --rose: #c9983e;
  --jaune: #f5d061;
  
  --fond: #0c1714;
  --bg2: #111e1a;
  --carte: #15241f;
  --surf: #15241f;
  --texte: #e9efec;
  --ink: #e9efec;
  --gris: #9db2ab;
  --muted: #9db2ab;
  --line: #22332e;
  
  --ombre: 0 14px 36px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 50px rgba(0, 0, 0, 0.65);
  --gold: #e8c14a;
  --gold2: #d4af37;
}

/* Base et Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: 'Manrope', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.65;
  transition: background 0.3s ease, color 0.3s ease;
}
a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
img { max-width: 100%; height: auto; }

/* Typographie Premium */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.serif { font-family: 'Fraunces', Georgia, serif; }

/* ==========================================================================
 * TOPBAR INSTITUTIONNELLE
 * ========================================================================== */
.cs-topbar {
  background: var(--bleu-fonce);
  color: #fff;
  padding: 0.55rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 150;
  position: relative;
}
.cs-topbar a { color: var(--jaune); font-weight: 700; }
.cs-topbar a:hover { text-decoration: underline; color: #fff; }
@media (max-width: 768px) {
  .cs-topbar { justify-content: center; text-align: center; font-size: 0.78rem; padding: 0.45rem 0.9rem; }
  .cs-topbar div:last-child { display: none; }
}

/* ==========================================================================
 * HEADER & NAVIGATION STICKY
 * ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--fond) 85%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease, border-color 0.3s ease;
}
nav {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.4rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--ink);
}
.logo .badge-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(14, 93, 84, 0.25);
}
.logo .wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 1.18rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.logo .wordmark small {
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.navlinks { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.navlinks a {
  padding: 0.5rem 0.95rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  transition: all 0.2s ease;
  position: relative;
}
.navlinks a:hover, .navlinks a.active {
  background: var(--bleu);
  color: #fff;
  transform: translateY(-1px);
}
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--gold);
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}
.burger {
  display: none;
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 0.2rem;
}
@media (max-width: 900px) {
  .navlinks {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
  }
  .navlinks.open { display: flex; }
  .navlinks a { width: 100%; text-align: center; }
  .burger { display: block; }
}
@media (max-width: 480px) {
  nav { padding: 0.6rem 0.9rem; gap: 0.5rem; }
  .logo { gap: 0.5rem; }
  .logo .badge-img { width: 38px; height: 38px; }
  .logo .wordmark { font-size: 0.98rem; }
  .logo .wordmark small { font-size: 0.58rem; }
  .theme-toggle { width: 38px; height: 38px; }
}

/* ==========================================================================
 * HERO SECTION ÉBLOUISSANTE (GLASSMORPHISM)
 * ========================================================================== */
.hero {
  position: relative;
  background: radial-gradient(1200px 520px at 82% -10%, rgba(212, 175, 55, 0.22), transparent 60%),
              linear-gradient(150deg, #0e5d54, #0a3f39 55%, #08332e);
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
  pointer-events: none;
}
.hero-in {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 2.5rem 1.4rem 3.2rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.2rem;
  align-items: center;
}
@media (max-width: 960px) {
  .hero-in { grid-template-columns: 1fr; text-align: center; gap: 2rem; padding: 2.2rem 1.2rem 2.8rem; }
}
.hero .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fdf3d4;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 0.8rem;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.hero h1 em { font-style: normal; color: var(--jaune); }
.hero p.lead {
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin-bottom: 1.4rem;
  line-height: 1.6;
}
@media (max-width: 960px) { .hero p.lead { margin: 0 auto 1.4rem; } }

/* Boutons Premium */
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
@media (max-width: 960px) { .hero-cta { justify-content: center; } }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 14px;
  padding: 0.85rem 1.65rem;
  font-size: 0.98rem;
  transition: all 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary, .btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #3a2e05 !important;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.38);
}
.btn-primary:hover, .btn-gold:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(212, 175, 55, 0.55);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-3px);
}
.btn-line {
  background: transparent;
  color: var(--bleu);
  border: 2px solid var(--bleu);
}
.btn-line:hover { background: var(--bleu); color: #fff; }

/* Stats Bar en temps réel */
.stats { display: flex; gap: 2.5rem; flex-wrap: wrap; }
@media (max-width: 960px) { .stats { justify-content: center; } }
.stat .n { font-size: 1.9rem; font-weight: 800; color: #fff; font-family: 'Fraunces', serif; }
.stat .n span { color: var(--jaune); }
.stat .l { font-size: 0.82rem; color: rgba(255, 255, 255, 0.75); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* Hero Card - Tableau de Bord Interactif */
.hero-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
}
.hero-card h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--jaune);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero-card h4::after {
  content: "EN DIRECT";
  font-size: 0.65rem;
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(46, 213, 115, 0.4);
}
.hc-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.hc-row:last-child { border: none; padding-bottom: 0; }
.hc-ic {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.18);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex: none;
}
.hc-row .t { font-weight: 700; font-size: 0.96rem; color: #fff; margin-bottom: 0.15rem; }
.hc-row .s { font-size: 0.82rem; color: rgba(255, 255, 255, 0.7); font-weight: 500; }

/* BANDEAU VALEUR */
.valueband {
  max-width: 1160px;
  margin: -1.8rem auto 0;
  padding: 0 1.4rem;
  position: relative;
  z-index: 10;
}
.valueband-in {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.3rem 1.4rem;
  text-align: center;
}
.vb { padding: 0.4rem; }
.vb b { display: block; font-size: 1.8rem; color: var(--bleu); font-weight: 800; font-family: 'Fraunces', serif; }
.vb span { font-size: 0.84rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.vb .gold { color: var(--gold); }

/* ==========================================================================
 * SECTIONS & HEADERS
 * ========================================================================== */
section { max-width: 1160px; margin: 0 auto; padding: 2.8rem 1.4rem; }
section.alt { background: var(--bg2); max-width: 100%; }
section.alt .wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.4rem; }
.sec-head { text-align: center; max-width: 680px; margin: 0 auto 2.2rem; }
.kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.kicker:before, .kicker:after { content: "—"; opacity: 0.5; margin: 0 8px; }
.sec-head h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}
.sec-head p { color: var(--muted); margin-top: 0.8rem; font-size: 1.06rem; }

/* ==========================================================================
 * HUB D'ORIENTATION & CARTES
 * ========================================================================== */
.cs-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.6rem; }
.cs-hcard {
  position: relative;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.8rem;
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.cs-hcard:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--bleu));
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.3s ease;
}
.cs-hcard:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.cs-hcard:hover:before { transform: scaleX(1); }
.cs-hcard .ic {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  margin-bottom: 1.4rem;
  background: linear-gradient(135deg, var(--fond), var(--surf));
  border: 1px solid var(--line);
}
.cs-hcard h3 { font-size: 1.25rem; font-weight: 800; color: var(--ink); margin-bottom: 0.5rem; }
.cs-hcard p { font-size: 0.94rem; color: var(--muted); margin-bottom: 1.5rem; flex: 1; }
.cs-hcard .go { font-weight: 700; font-size: 0.88rem; color: var(--gold); display: inline-flex; gap: 6px; align-items: center; }
.cs-hcard .go .arr { transition: 0.25s ease; }
.cs-hcard:hover .go .arr { transform: translateX(6px); }
.cs-badge {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* ==========================================================================
 * TIMELINE / PARCOURS EN 5 ÉTAPES
 * ========================================================================== */
.timeline { max-width: 860px; margin: 0 auto; position: relative; }
.timeline:before {
  content: "";
  position: absolute;
  left: 28px;
  top: 15px;
  bottom: 15px;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--bleu), var(--violet));
  border-radius: 3px;
}
@media (max-width: 768px) { .timeline:before { left: 22px; } }
.step { display: flex; gap: 24px; padding: 16px 0; position: relative; }
.step .num {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  flex: none;
  background: linear-gradient(135deg, var(--bleu), var(--bleu-fonce));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  z-index: 1;
  box-shadow: 0 8px 20px rgba(14, 93, 84, 0.3);
}
@media (max-width: 768px) { .step .num { width: 46px; height: 46px; font-size: 1.1rem; border-radius: 14px; } }
.step .body {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 2.2rem;
  flex: 1;
  transition: all 0.25s ease;
  box-shadow: var(--ombre);
}
.step:hover .body { transform: translateX(6px); border-color: var(--gold); box-shadow: var(--shadow-lg); }
.step .body h4 { font-size: 1.18rem; color: var(--ink); margin-bottom: 0.4rem; }
.step .body p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }
.step .body .step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--bleu);
  text-decoration: none;
}
[data-theme="dark"] .step .body .step-link { color: var(--gold); }
.step .body .step-link:hover { text-decoration: underline; }

/* ==========================================================================
 * MODES D'ENTRAÎNEMENT & QCM
 * ========================================================================== */
.grid { display: grid; gap: 1.4rem; }
.modes { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mode {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--ombre);
  border-top: 5px solid var(--bleu);
  transition: all 0.26s ease;
}
.mode:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.mode .ico { font-size: 2.4rem; margin-bottom: 0.8rem; display: inline-block; transition: 0.26s ease; }
.mode:hover .ico { transform: scale(1.15) rotate(-6deg); }
.mode h3 { color: var(--ink); margin-bottom: 0.5rem; font-size: 1.15rem; }
.mode p { color: var(--muted); font-size: 0.93rem; }
.mode.m1 { border-color: var(--bleu); } .mode.m2 { border-color: var(--vert); }
.mode.m3 { border-color: var(--orange); } .mode.m4 { border-color: var(--violet); }

/* QCM Wrap & Controls */
.qcm-wrap {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 820px;
  margin: auto;
}
@media (max-width: 768px) { .qcm-wrap { padding: 1.5rem; } }
.theme-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.8rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.4rem;
}
.theme-pick button {
  padding: 0.45rem 0.95rem;
  border-radius: 30px;
  border: 1.5px solid var(--bleu);
  background: var(--surf);
  color: var(--bleu);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.84rem;
  transition: all 0.2s ease;
}
[data-theme="dark"] .theme-pick button { border-color: var(--gold); color: var(--gold); }
.theme-pick button:hover, .theme-pick button.sel { background: var(--bleu); color: #fff; }
[data-theme="dark"] .theme-pick button:hover, [data-theme="dark"] .theme-pick button.sel { background: var(--gold); color: #000; }

.len-pick { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; vertical-align: middle; margin: 0.5rem 0; }
.len-pick button {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--turquoise);
  background: var(--surf);
  color: var(--turquoise);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.84rem;
  transition: 0.2s;
}
.len-pick button:hover, .len-pick button.sel { background: var(--turquoise); color: #fff; }
[data-theme="dark"] .len-pick button:hover, [data-theme="dark"] .len-pick button.sel { color: #000; }

.mode-row { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; margin-bottom: 1.5rem; }
.modebtn {
  padding: 0.65rem 1.3rem;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  transition: all 0.2s ease;
  box-shadow: var(--ombre);
}
.modebtn.sim { background: linear-gradient(135deg, var(--orange), var(--rose)); }
.modebtn.err { background: linear-gradient(135deg, var(--bleu), var(--bleu-fonce)); }
.modebtn:hover { transform: translateY(-2px); filter: brightness(1.08); }

.qbar { height: 10px; background: var(--bg2); border-radius: 10px; overflow: hidden; margin-bottom: 1.5rem; }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--bleu)); width: 0; transition: width 0.4s ease; }
.qmeta { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--muted); margin-bottom: 0.8rem; font-weight: 700; }
.qtext { font-size: 1.25rem; font-weight: 800; color: var(--ink); margin-bottom: 1.5rem; line-height: 1.45; }

.opts { display: grid; gap: 0.8rem; }
.opt {
  padding: 1rem 1.2rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-weight: 600;
  background: var(--surf);
  color: var(--ink);
  position: relative;
}
.opt:hover { border-color: var(--bleu); background: color-mix(in srgb, var(--bleu) 6%, var(--surf)); transform: translateX(6px); }
.opt.sel-opt { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surf)); }
.opt.correct { border-color: var(--vert); background: color-mix(in srgb, var(--vert) 15%, var(--surf)); font-weight: 700; transform: scale(1.01); box-shadow: 0 6px 18px rgba(31,138,91,.18); }
.opt.wrong { border-color: var(--rouge); background: color-mix(in srgb, var(--rouge) 15%, var(--surf)); }
.opt.disabled { pointer-events: none; }

.explain {
  margin-top: 1.2rem;
  padding: 1.2rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bleu) 8%, var(--surf));
  border-left: 5px solid var(--bleu);
  font-size: 0.94rem;
  display: none;
  color: var(--ink);
}
.explain.show { display: block; animation: fadeIn 0.35s ease; }
.explain .src { display: block; margin-top: 0.6rem; font-size: 0.82rem; color: var(--muted); font-style: italic; font-weight: 600; }
.obsolete-note {
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-left: 4px solid #b8860b;
  border-radius: 0 8px 8px 0;
  background: #fff8e1;
  color: #5a4200;
  font-size: 0.85rem;
  line-height: 1.55;
  font-weight: 500;
}
.obsolete-note b { color: #7a5800; }
[data-theme="dark"] .obsolete-note { background: rgba(212,175,55,0.10); border-left-color: var(--gold); color: #e8d9a8; }
[data-theme="dark"] .obsolete-note b { color: var(--gold); }

.qnav { display: flex; justify-content: space-between; margin-top: 1.8rem; }
.qresult { text-align: center; display: none; padding: 2rem 0; }
.qresult.show { display: block; }
.qresult .score { font-size: 3.5rem; font-weight: 800; color: var(--bleu); font-family: 'Fraunces', serif; }
[data-theme="dark"] .qresult .score { color: var(--gold); }

/* Gamebar / Gamification */
.gamebar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu));
  color: #fff;
  border-radius: 16px;
  padding: 0.7rem 1rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--ombre);
}
.gamebar .gchip {
  background: rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
}
.gamebar .gchip b { color: var(--jaune); font-weight: 800; }

/* ==========================================================================
 * THÈMES PRIORITAIRES (BARRES)
 * ========================================================================== */
.prio { max-width: 860px; margin: auto; }
.prow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--ombre);
  padding: 1rem 1.2rem;
  transition: all 0.2s ease;
}
.prow:hover { transform: translateY(-3px); border-color: var(--gold); }
.prow .pn { flex: none; font-weight: 800; color: var(--bleu); width: 1.8rem; text-align: center; font-size: 1.1rem; }
[data-theme="dark"] .prow .pn { color: var(--gold); }
.prow .pmid { flex: 1; }
.prow .pname { font-weight: 800; font-size: 1rem; color: var(--ink); margin-bottom: 0.35rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.prow .ptrend { font-size: 0.7rem; font-weight: 800; padding: 0.12rem 0.5rem; border-radius: 6px; }
.prow .ptrend.up { background: rgba(46, 213, 115, 0.18); color: #2ed573; }
.prow .ptrend.perm { background: rgba(212, 175, 55, 0.18); color: var(--gold); }
.prow .pbar { height: 10px; background: var(--bg2); border-radius: 8px; overflow: hidden; }
.prow .pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--bleu)); border-radius: 8px; }
.prow .ppct { flex: none; font-weight: 800; color: var(--bleu); font-size: 1rem; min-width: 50px; text-align: right; }
[data-theme="dark"] .prow .ppct { color: var(--gold); }

/* ==========================================================================
 * LOIS & ASTUCES MNÉMOTECHNIQUES
 * ========================================================================== */
.lois { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.loi { background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--ombre); transition: 0.26s; }
.loi:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.loi-head { padding: 1.2rem 1.4rem; color: #fff; }
.loi-head h3 { font-size: 1.35rem; color: #fff; }
.loi-body { padding: 1.2rem 1.4rem; color: var(--ink); }
.loi-body ul { list-style: none; }
.loi-body li { padding: 0.4rem 0; border-bottom: 1px dashed var(--line); font-size: 0.94rem; display: flex; gap: 0.5rem; }
.loi-body li:last-child { border: none; }

.astuces { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; max-width: 1160px; margin: auto; }
.astuce { background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--ombre); padding: 1.6rem; border-top: 5px solid var(--gold); transition: 0.25s; }
.astuce:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.astuce .ai { font-size: 2rem; margin-bottom: 0.6rem; }
.astuce h4 { color: var(--ink); margin-bottom: 0.5rem; font-size: 1.1rem; }
.astuce p { font-size: 0.93rem; color: var(--muted); }

/* ==========================================================================
 * CTA FINALE AVANT LE FOOTER
 * ========================================================================== */
.cta {
  width: min(1160px, calc(100% - 2.8rem));
  margin: 2.5rem auto 3rem;
  padding: 3rem 1.5rem;
  text-align: center;
  background: radial-gradient(700px 300px at 82% -20%, rgba(212, 175, 55, 0.2), transparent 60%),
              linear-gradient(150deg, var(--bleu), var(--bleu-fonce));
  border-radius: var(--radius-lg);
  color: #fff;
}
.cta h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}
.cta p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  margin: 0 auto 1.6rem;
  font-size: 1.05rem;
}

/* ==========================================================================
 * FOOTER INSTITUTIONNEL ANONYMISÉ
 * ========================================================================== */
footer {
  background: var(--vert-imp);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 3.5rem 1.4rem 2.5rem;
  font-size: 0.92rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
footer b { color: #fff; font-weight: 800; }
footer .foot-links {
  margin-top: 1.2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
footer .foot-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.5rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
footer .foot-btn:hover { background: var(--gold); color: #000; }
footer .foot-bot {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  opacity: 0.65;
}

/* ==========================================================================
 * UTILITAIRES & ANIMATIONS
 * ========================================================================== */
.fade { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade.in { opacity: 1; transform: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

#toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(30px);
  z-index: 9999;
  background: linear-gradient(135deg, var(--vert), var(--bleu));
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 30px;
  font-weight: 800;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: 0.35s ease;
  pointer-events: none;
  font-size: 0.96rem;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: linear-gradient(135deg, var(--rouge), #9a3327); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9998; }

/* ==========================================================================
 * ANNALES & EXAMENS RÉELS
 * ========================================================================== */
.annales-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.exam {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--ombre);
  overflow: hidden;
  border-top: 5px solid var(--bleu);
  transition: all 0.26s ease;
}
.exam:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.exam-h { padding: 1.3rem 1.5rem; background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu)); color: #fff; }
.exam-h .stitre { font-size: 0.82rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.exam-h h3 { font-size: 1.2rem; color: #fff; margin: 0.3rem 0 0; }
.exam-h .sess { display: inline-block; margin-top: 0.6rem; background: rgba(255, 255, 255, 0.18); padding: 0.28rem 0.8rem; border-radius: 20px; font-size: 0.82rem; font-weight: 700; }
.exam-b { padding: 1.2rem 1.5rem; }
.cadre { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.2rem; border-bottom: 1px dashed var(--line); }
.cadre:last-child { border: none; }
.cadre .ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--bleu) 10%, var(--surf)); color: var(--bleu); display: grid; place-items: center; font-size: 1rem; }
.cadre .nom { font-weight: 700; font-size: 0.94rem; flex: 1; color: var(--ink); }
.cadre a.dl, .cadre button.dl { background: var(--vert); color: #fff; padding: 0.4rem 0.85rem; border-radius: 10px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; transition: 0.2s; border: none; cursor: pointer; font-family: inherit; }
.cadre a.dl:hover, .cadre button.dl:hover { filter: brightness(1.1); transform: translateY(-1px); }
.cadre .soon { color: var(--muted); font-size: 0.8rem; font-style: italic; background: var(--bg2); padding: 0.35rem 0.8rem; border-radius: 10px; }
.cadre:has(.docs) { align-items: flex-start; }
.cadre .docs { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.cadre .docs .dl { background: var(--bleu); }
.cadre .docs .dl:hover { filter: brightness(1.15); }

/* ==========================================================================
 * ROADMAP DES 31 COURS (SENTIER)
 * ========================================================================== */
.roadmap { position: relative; max-width: 820px; margin: 2rem auto 0; padding: 0.5rem 0 0; }
.roadmap::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 40px;
  bottom: 40px;
  left: 50%;
  width: 4px;
  margin-left: -2px;
  border-radius: 4px;
  opacity: 0.5;
  background: linear-gradient(to bottom,
    #0e5d54 0%, #0e5d54 39%,
    #b8860b 39%, #b8860b 52%,
    #1c6e8c 52%, #1c6e8c 67%,
    #6b4e9c 67%, #6b4e9c 82%,
    #b5345b 82%, #b5345b 100%);
}
.rm-start, .rm-finish {
  position: relative;
  z-index: 2;
  text-align: center;
  font-weight: 800;
  color: var(--bleu-fonce);
  background: var(--surf);
  border: 2px solid var(--gold);
  display: table;
  margin: 0 auto 1.2rem;
  padding: 0.5rem 1.4rem;
  border-radius: 30px;
  font-size: 0.95rem;
  box-shadow: var(--ombre);
}
[data-theme="dark"] .rm-start, [data-theme="dark"] .rm-finish { color: var(--gold); }
.rm-finish { margin: 1.8rem auto 0; }
.rm-chapter { position: relative; z-index: 1; margin-bottom: 2rem; }
.rm-flag {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 auto 1.4rem;
  background: var(--cc);
  color: #fff;
  border-radius: 30px;
  padding: 0.6rem 1.5rem;
  width: fit-content;
  max-width: 94%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.rm-flagnum { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; }
.rm-flag h3 { font-size: 1rem; margin: 0; font-weight: 800; color: #fff; }
.rm-flag .rm-count { font-size: 0.75rem; opacity: 0.9; font-weight: 700; white-space: nowrap; }
.rm-item { position: relative; z-index: 1; display: block; min-height: 44px; margin-bottom: 0.8rem; text-decoration: none; color: var(--ink); }
.rm-item::after { content: ""; display: table; clear: both; }
.rm-dot {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surf);
  border: 3px solid var(--cc);
  color: var(--cc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.rm-card {
  display: block;
  width: calc(50% - 40px);
  background: var(--surf);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cc);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: var(--ombre);
  transition: all 0.2s ease;
  color: var(--ink);
}
.rm-item:nth-of-type(odd) .rm-card { float: left; }
.rm-item:nth-of-type(even) .rm-card { float: right; border-left: 1px solid var(--line); border-right: 4px solid var(--cc); }
.rm-item:hover .rm-card { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
@media (max-width: 768px) {
  .roadmap::before { left: 24px; }
  .rm-flag { margin-left: 0; justify-content: flex-start; padding-left: 1rem; }
  .rm-dot { left: 24px; }
  .rm-card { float: none !important; width: auto !important; margin-left: 54px; border-left: 4px solid var(--cc) !important; border-right: 1px solid var(--line) !important; }
}

/* ==========================================================================
 * COURS SUPPLÉMENTAIRES (COURS.JSON) & ACCORDÉON
 * ========================================================================== */
#cours-plus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.6rem; margin-top: 1.8rem; }
.cp-card { background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--ombre); overflow: hidden; border-left: 6px solid var(--bleu); display: flex; flex-direction: column; transition: 0.26s; }
.cp-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.cp-c-bleu { border-color: var(--bleu); } .cp-c-vert { border-color: var(--vert); }
.cp-c-orange { border-color: var(--orange); } .cp-c-violet { border-color: var(--violet); }
.cp-c-rose { border-color: var(--rose); } .cp-c-turquoise { border-color: var(--turquoise); }
.cp-c-rouge { border-color: var(--rouge); }
.cp-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.cp-tag { display: inline-block; background: color-mix(in srgb, var(--bleu) 10%, var(--surf)); color: var(--bleu); padding: 0.25rem 0.8rem; border-radius: 8px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; align-self: flex-start; }
.cp-title { color: var(--ink); font-size: 1.18rem; line-height: 1.35; display: flex; gap: 0.5rem; align-items: baseline; font-weight: 800; }
.cp-sub { color: var(--muted); font-size: 0.9rem; font-style: italic; }
.cp-summary { color: var(--ink); font-size: 0.94rem; line-height: 1.6; }
.cp-acc { border-top: 1px dashed var(--line); padding-top: 0.8rem; margin-top: 0.5rem; }
.cp-acc summary { cursor: pointer; font-weight: 800; color: var(--bleu); font-size: 0.92rem; padding: 0.4rem 0; list-style: none; display: flex; align-items: center; gap: 0.4rem; user-select: none; }
[data-theme="dark"] .cp-acc summary { color: var(--gold); }
.cp-acc summary::-webkit-details-marker { display: none; }
.cp-acc summary::after { content: "⌄"; margin-left: auto; transition: 0.2s; font-size: 1.2rem; }
.cp-acc[open] summary::after { transform: rotate(180deg); }
.cp-obj, .cp-les { padding-left: 1.2rem; margin-top: 0.6rem; font-size: 0.9rem; color: var(--ink); line-height: 1.6; }
.cp-les { list-style: none; padding-left: 0; }
.cp-les li { padding: 0.45rem 0; display: flex; align-items: flex-start; gap: 0.5rem; border-bottom: 1px dashed var(--line); }
.cp-les li:last-child { border: none; }
.cp-bullet { color: var(--gold); font-weight: 800; flex: none; }
.cp-lt { flex: 1; }
.cp-dur { color: var(--muted); font-size: 0.8rem; background: var(--bg2); padding: 0.15rem 0.6rem; border-radius: 6px; white-space: nowrap; font-weight: 700; }
.cp-resources { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.cp-res { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; background: var(--bleu); color: #fff; border-radius: 10px; font-size: 0.84rem; font-weight: 700; transition: 0.2s; }
.cp-res:hover { background: var(--bleu-fonce); transform: translateY(-2px); }
.cp-meta { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; font-style: italic; }

/* Fiches & Accordéon */
.acc { max-width: 960px; margin: 0 auto; }
.fiche { background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--ombre); margin-bottom: 1.2rem; overflow: hidden; border-left: 6px solid var(--bleu); transition: 0.25s; }
.fiche.f1 { border-color: var(--turquoise); } .fiche.f2 { border-color: var(--bleu); }
.fiche.f3 { border-color: var(--vert); } .fiche.f4 { border-color: var(--orange); }
.fiche.f5 { border-color: var(--violet); } .fiche.f6 { border-color: var(--rose); } .fiche.f7 { border-color: var(--rouge); }
.fiche-h { display: flex; align-items: center; gap: 1rem; padding: 1.3rem 1.6rem; cursor: pointer; user-select: none; transition: 0.2s; }
.fiche-h:hover { background: color-mix(in srgb, var(--bleu) 5%, var(--surf)); }
.fiche-h .num { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--bleu); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1rem; }
.fiche.f1 .num { background: var(--turquoise); } .fiche.f3 .num { background: var(--vert); }
.fiche.f4 .num { background: var(--orange); } .fiche.f5 .num { background: var(--violet); }
.fiche.f6 .num { background: var(--rose); } .fiche.f7 .num { background: var(--rouge); }
.fiche-h h3 { font-size: 1.15rem; color: var(--ink); margin: 0; }
.fiche-h h3 small { display: block; font-weight: 600; color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.fiche-h .chev { margin-left: auto; font-size: 1.4rem; color: var(--muted); transition: 0.3s ease; }
.fiche.open .chev { transform: rotate(180deg); }
.fiche-c { max-height: 0; overflow: hidden; transition: max-height 0.5s ease; }
.fiche.open .fiche-c { max-height: 5000px; }
.fiche-in { padding: 0 1.6rem 1.8rem; border-top: 1px dashed var(--line); color: var(--ink); }
.fiche-in h4 { color: var(--ink); margin: 1.3rem 0 0.5rem; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.fiche-in p, .fiche-in li { font-size: 0.95rem; line-height: 1.65; margin: 0.35rem 0; }
.fiche-in ul, .fiche-in ol { padding-left: 1.4rem; }
.meta-line { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0; }
.chip { background: color-mix(in srgb, var(--bleu) 10%, var(--surf)); color: var(--bleu); padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }
.chip.green { background: color-mix(in srgb, var(--vert) 12%, var(--surf)); color: var(--vert); }
.chip.orange { background: color-mix(in srgb, var(--orange) 12%, var(--surf)); color: var(--orange); }
.note { background: color-mix(in srgb, var(--jaune) 12%, var(--surf)); border-left: 4px solid var(--jaune); padding: 0.9rem 1.1rem; border-radius: 10px; font-size: 0.92rem; margin: 0.9rem 0; color: var(--ink); }
.accbtn { padding: 0.5rem 1rem; border-radius: 20px; border: 2px solid var(--bleu); background: var(--surf); color: var(--bleu); font-weight: 700; cursor: pointer; font-size: 0.88rem; transition: 0.2s; }
.accbtn:hover { background: var(--bleu); color: #fff; }

/* Bannières CSS élégantes pour fiches et cours additionnels */
img.fiche-banner, img.cp-banner { display: none !important; }
.cp-banner-css, .fiche-banner-css { display: flex; align-items: center; justify-content: center; width: calc(100% + 3.2rem); height: 130px; margin: 0 -1.6rem 1.4rem; border-bottom: 2px solid var(--gold); background: #072b26; position: relative; overflow: hidden; }
.exec-pattern { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 16px 16px; pointer-events: none; }
.cp-banner-css::after, .fiche-banner-css::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(212, 175, 55, 0.18)); pointer-events: none; }
.exec-code, .fiche-banner-css .exec-code { font-family: system-ui, sans-serif; font-weight: 900; font-size: 2.8rem; letter-spacing: 2px; color: rgba(255, 255, 255, 0.18); text-transform: uppercase; transition: 0.4s ease; }
.cp-card:hover .exec-code, .fiche:hover .exec-code { transform: scale(1.08); color: rgba(212, 175, 55, 0.38); }
.cp-bg-bleu { background: linear-gradient(135deg, #062420, #0a3f39); }
.cp-bg-vert { background: linear-gradient(135deg, #0a3f39, #0e5d54); }
.cp-bg-orange { background: linear-gradient(135deg, #1f3d32, #2a5243); }
.cp-bg-violet { background: linear-gradient(135deg, #12352e, #1a4a40); }

/* ==========================================================================
 * NEWSLETTER INSTITUTIONNELLE
 * ========================================================================== */
#newsletter { max-width: 820px; margin: 3rem auto; padding: 0 1.4rem; }
.nl-card { background: linear-gradient(140deg, #0a3f39, #0e5d54 55%, #11756a); color: #fff; border-radius: var(--radius-lg); padding: 2.5rem 2rem; text-align: center; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, 0.15); }
.nl-card::before { content: ""; position: absolute; inset: 0; opacity: 0.5; background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px); background-size: 20px 20px; pointer-events: none; }
.nl-in { position: relative; z-index: 1; max-width: 540px; margin: auto; }
.nl-in .ico { font-size: 2.8rem; margin-bottom: 0.6rem; }
.nl-in h2 { color: #fff; font-size: 1.8rem; margin-bottom: 0.5rem; }
.nl-in p { opacity: 0.92; font-size: 1rem; margin-bottom: 1.5rem; line-height: 1.6; }
.nl-form { display: flex; gap: 0.6rem; flex-wrap: wrap; max-width: 460px; margin: 0 auto; }
.nl-form input { flex: 1; min-width: 220px; padding: 0.9rem 1.2rem; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 0.98rem; outline: none; font-family: inherit; }
.nl-form input::placeholder { color: rgba(255, 255, 255, 0.7); }
.nl-form input:focus { background: rgba(255, 255, 255, 0.22); border-color: var(--jaune); }
.nl-form button { padding: 0.9rem 1.8rem; background: var(--jaune); color: var(--bleu-fonce); border: none; border-radius: 14px; font-weight: 800; cursor: pointer; font-size: 0.98rem; transition: 0.2s; box-shadow: 0 6px 18px rgba(0,0,0,0.2); }
.nl-form button:hover { background: var(--gold); color: #fff; transform: translateY(-2px); }
.nl-privacy { font-size: 0.8rem; opacity: 0.75; margin-top: 1rem; }
.nl-privacy a { color: var(--jaune); font-weight: 700; text-decoration: underline; }
.nl-success { display: none; background: rgba(46, 213, 115, 0.2); border: 2px solid #2ed573; border-radius: 14px; padding: 1.2rem; margin-top: 1.2rem; font-weight: 700; color: #fff; }
.nl-success.show { display: block; animation: fadeIn 0.35s ease; }

/* Tableaux et Boîtes */
.tbl { overflow-x: auto; background: var(--surf); border-radius: var(--radius); box-shadow: var(--ombre); margin-top: 1.4rem; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th { background: var(--bleu); color: #fff; padding: 0.9rem 1rem; text-align: left; font-size: 0.92rem; font-weight: 700; }
td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; color: var(--ink); }
tr:nth-child(even) td { background: var(--bg2); }
.formula { background: #081b26; color: #7fffd4; font-family: 'Courier New', monospace; padding: 1.1rem 1.3rem; border-radius: 14px; margin: 0.8rem 0; font-size: 0.95rem; overflow-x: auto; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.5rem; }
.box { background: var(--surf); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--ombre); }
.box h3 { color: var(--ink); margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.6rem; font-size: 1.18rem; }
.box ul { padding-left: 1.3rem; } .box li { margin: 0.4rem 0; font-size: 0.95rem; color: var(--ink); }
.box ul.clean { list-style: none; padding: 0; }
.box ul.clean li { padding: 0.5rem 0; border-bottom: 1px dashed var(--line); }
.box ul.clean li:last-child { border: none; }



/* ===== Alias de variables (compatibilité topbars cours) ===== */
:root{--vert-fonce:var(--bleu-fonce);--or:var(--gold);}

/* ===== Sous-navigation commune (pages secondaires) ===== */
.cs-subnav{display:flex;flex-wrap:wrap;gap:.3rem;justify-content:center;padding:.5rem 1rem;background:var(--carte);border-bottom:1px solid var(--line);box-shadow:0 2px 10px rgba(10,63,57,.05)}
.cs-subnav a{color:var(--gris);text-decoration:none;font-weight:700;font-size:.83rem;padding:.35rem .8rem;border-radius:20px;transition:background .2s,color .2s;white-space:nowrap}
.cs-subnav a:hover{background:var(--bg2);color:var(--bleu)}
.cs-subnav a.active{background:var(--bleu);color:#fff}

/* ===== Footer principal ===== */
.cs-mainfooter{background:var(--vert-imp);color:#e8efe9;padding:3rem 1.5rem 1rem;margin-top:3rem}
.cs-fgrid{max-width:1150px;margin:0 auto;display:grid;grid-template-columns:1.4fr 1fr 1fr 1fr;gap:2rem}
.cs-fcol h4{color:var(--gold);margin:0 0 .8rem;font-size:.85rem;letter-spacing:1.5px;text-transform:uppercase}
.cs-fcol a{display:block;color:#cfe0d8;text-decoration:none;font-size:.9rem;padding:.22rem 0;transition:color .2s}
.cs-fcol a:hover{color:var(--gold)}
.cs-fbrandcol p{font-size:.85rem;line-height:1.6;color:#b8cfc6;margin:.6rem 0 1rem}
.cs-fbrandcol b{font-size:1.15rem;color:#fff}
.cs-flogo{width:44px;height:44px;border-radius:50%;background:var(--bleu);border:2px solid var(--gold);display:flex;align-items:center;justify-content:center;font-weight:800;color:#fff;margin-bottom:.6rem}
.cs-yt{display:inline-block;background:#c4302b;color:#fff!important;padding:.45rem 1rem;border-radius:10px;font-weight:700;font-size:.85rem;text-decoration:none}
.cs-fbase{max-width:1150px;margin:2rem auto 0;padding-top:1rem;border-top:1px solid rgba(255,255,255,.15);text-align:center;font-size:.8rem;color:#9fbcb2}
@media(max-width:900px){.cs-fgrid{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.cs-fgrid{grid-template-columns:1fr}}

/* ===== Footer collé en bas des pages courtes ===== */
body{display:flex;flex-direction:column;min-height:100vh}
body>*{flex-shrink:0;min-width:0;max-width:100%;width:100%}
/* Les enfants directs du body flex doivent occuper toute la largeur,
   sinon margin:auto les fait passer en fit-content (bandeau de valeur,
   carte flashcard... s'effondrent). Exceptions : elements flottants. */
body>button{width:auto;align-self:center}
body>#toast,body>#confetti,body>#cs-share-btn,body>#cs-share-menu,body>#cs-share-toast{width:auto}
.cs-mainfooter{margin-top:auto}

/* ============================================================
 * Accueil premium — Examens & Bibliothèque en tête de page
 * ============================================================ */

/* Bandeau de statistiques des examens */
.ax-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:.9rem;max-width:1000px;margin:0 auto 1.8rem}
.ax-stat{background:var(--carte);border:1px solid var(--line);border-radius:18px;padding:1.05rem .9rem;text-align:center;box-shadow:var(--ombre);position:relative;overflow:hidden}
.ax-stat::after{content:"";position:absolute;inset:auto 0 0 0;height:3px;background:linear-gradient(90deg,var(--bleu),var(--jaune))}
.ax-stat b{display:block;font-size:1.55rem;color:var(--bleu);font-family:'Fraunces',serif;letter-spacing:.5px}
.ax-stat span{font-size:.8rem;color:var(--gris);font-weight:600;line-height:1.25;display:block;margin-top:.15rem}

/* Bannière épreuve vedette */
.ax-featured{display:flex;align-items:center;justify-content:space-between;gap:1.4rem;flex-wrap:wrap;background:linear-gradient(120deg,var(--bleu-fonce),var(--bleu) 55%,#11756a);color:#fff;border-radius:22px;padding:1.6rem 1.9rem;margin:0 auto 1.8rem;max-width:1000px;box-shadow:var(--ombre);position:relative;overflow:hidden}
.ax-featured::before{content:"";position:absolute;top:-40px;right:-40px;width:190px;height:190px;border-radius:50%;background:radial-gradient(circle,rgba(212,175,55,.35),transparent 70%);pointer-events:none}
.ax-f-badge{display:inline-block;background:rgba(212,175,55,.25);border:1px solid rgba(212,175,55,.55);color:var(--jaune);padding:.28rem .85rem;border-radius:999px;font-size:.78rem;font-weight:800;letter-spacing:.4px;margin-bottom:.55rem}
.ax-f-left h3{color:#fff;font-size:1.35rem;margin:.1rem 0 .35rem;font-family:'Fraunces',serif}
.ax-f-left p{color:rgba(255,255,255,.85);font-size:.92rem;margin:0;max-width:520px}
.ax-f-actions{display:flex;gap:.7rem;flex-wrap:wrap}
.ax-f-actions .btn-line{border-color:rgba(255,255,255,.45);color:#fff}
.ax-f-actions .btn-line:hover{background:rgba(255,255,255,.14);border-color:#fff}

/* Puces de filtre par cadre */
.ax-chips{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center;margin:0 auto 1.5rem;max-width:1000px}
.ax-chip{border:1.5px solid var(--line);background:var(--carte);color:var(--ink);padding:.45rem 1rem;border-radius:999px;font-size:.85rem;font-weight:700;cursor:pointer;transition:.18s;font-family:inherit}
.ax-chip:hover{border-color:var(--bleu);color:var(--bleu);transform:translateY(-1px)}
.ax-chip.on{background:var(--bleu);border-color:var(--bleu);color:#fff;box-shadow:0 6px 16px rgba(14,93,84,.28)}

/* Bouton contour réutilisable (fond clair) */
.btn-line{display:inline-block;padding:.72rem 1.35rem;border-radius:14px;border:1.5px solid var(--bleu);color:var(--bleu);font-weight:800;font-size:.92rem;transition:.2s;background:transparent;text-align:center}
.btn-line:hover{background:var(--bleu);color:#fff;transform:translateY(-2px)}

/* Barre d'outils de la bibliothèque de cours */
.cl-toolbar{display:flex;gap:.7rem;flex-wrap:wrap;justify-content:center;align-items:stretch;max-width:1000px;margin:0 auto 1.8rem}
.cl-toolbar input[type="search"]{flex:1 1 300px;min-width:240px;padding:.8rem 1.15rem;border-radius:14px;border:1.5px solid var(--line);background:var(--carte);color:var(--ink);font-size:.95rem;font-family:inherit;outline:none;transition:.2s;box-shadow:var(--ombre)}
.cl-toolbar input[type="search"]:focus{border-color:var(--bleu);box-shadow:0 0 0 3px rgba(14,93,84,.14)}

/* Liens texte officiel sur les cartes de lois */
.loi-links{display:flex;gap:.45rem;flex-wrap:wrap;margin-top:.75rem;padding-top:.7rem;border-top:1px dashed var(--line)}
.loi-links a{display:inline-block;padding:.32rem .7rem;border-radius:999px;border:1.3px solid var(--line);font-size:.76rem;font-weight:700;color:var(--bleu);transition:.18s;background:var(--carte)}
.loi-links a:hover{background:var(--bleu);border-color:var(--bleu);color:#fff;transform:translateY(-1px)}

/* Mode sombre */
[data-theme="dark"] .ax-stat b{color:var(--jaune)}
[data-theme="dark"] .ax-chip.on{background:var(--gold);border-color:var(--gold);color:#0a3f39}
[data-theme="dark"] .btn-line{border-color:var(--gold);color:var(--gold)}
[data-theme="dark"] .btn-line:hover{background:var(--gold);color:#0a3f39}
[data-theme="dark"] .loi-links a{color:var(--jaune)}
[data-theme="dark"] .loi-links a:hover{background:var(--gold);border-color:var(--gold);color:#0a3f39}

@media(max-width:640px){
  .ax-featured{padding:1.3rem 1.2rem}
  .ax-f-actions{width:100%}
  .ax-f-actions .btn{flex:1;text-align:center}
}

/* ===== Fix : en-têtes colorés des cartes .loi (classes c-*) ===== */
.loi-head.c-bleu   { background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu)); }
.loi-head.c-turq   { background: linear-gradient(135deg, #7c5f1c, var(--turquoise)); }
.loi-head.c-vert   { background: linear-gradient(135deg, #10583b, var(--vert)); }
.loi-head.c-orange { background: linear-gradient(135deg, #8f5e1c, var(--orange)); }
.loi-head.c-violet { background: linear-gradient(135deg, #2b5850, var(--violet)); }
.loi-head.c-rose   { background: linear-gradient(135deg, #7e5c1d, var(--rose)); }

/* ===== Fix mobile : lignes flex qui refusaient de passer à la ligne ===== */
.box .step, .resume .step { flex-wrap: wrap; row-gap: 8px; }

/* ============================================================
 * Portail — Choisis ton parcours (hub multi-formations)
 * ============================================================ */
.portal-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:1.3rem;max-width:1160px;margin:0 auto}
.portal-card{background:var(--carte);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--ombre);display:flex;flex-direction:column;transition:.22s;position:relative}
.portal-card:hover{transform:translateY(-6px);box-shadow:0 22px 48px rgba(10,63,57,.2);border-color:var(--gold)}
.portal-card .pc-band{height:9px;background:linear-gradient(90deg,var(--bleu-fonce),var(--bleu))}
.portal-card .pc-band.b-bleu{background:linear-gradient(90deg,var(--bleu),#1f8ad0)}
.portal-card .pc-band.b-orange{background:linear-gradient(90deg,#8f5e1c,var(--orange))}
.portal-card .pc-band.b-violet{background:linear-gradient(90deg,#2b5850,var(--violet))}
.portal-card .pc-in{padding:1.3rem 1.4rem;flex:1;display:flex;flex-direction:column}
.portal-card .pc-ic{font-size:2rem;margin-bottom:.5rem}
.portal-card .pc-status{align-self:flex-start;background:var(--bg2);color:var(--gris);font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.5px;padding:.2rem .6rem;border-radius:20px;margin-bottom:.55rem}
.portal-card .pc-status.ok{background:color-mix(in srgb,var(--vert) 15%,var(--carte));color:var(--vert)}
.portal-card .pc-status.new{background:var(--jaune);color:var(--bleu-fonce)}
.portal-card h3{color:var(--bleu-fonce);font-size:1.18rem;margin-bottom:.3rem}
.portal-card p{color:var(--gris);font-size:.9rem;flex:1;margin-bottom:.8rem}
.portal-card .pc-cta{color:var(--bleu);font-weight:800;font-size:.9rem}
.portal-card:hover .pc-cta{color:var(--gold)}
[data-theme="dark"] .portal-card h3{color:#fff}
[data-theme="dark"] .portal-card .pc-status.new{background:var(--gold);color:#0a3f39}
[data-theme="dark"] .portal-card .pc-cta{color:var(--jaune)}

/* ==========================================================================
 * STYLES RESTAURÉS (perdus lors de la migration CSS inline → style.css)
 * ========================================================================== */

/* --- Les 31 cours du parcours (section Cours) --- */
.c31cat { margin-top: 1.6rem; }
.c31cat-h {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.06rem;
  color: var(--ink);
  margin: 0 0 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--line);
}
.c31cat-h .b {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--cc, #0e5d54);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.cours31-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 0.6rem; }
.cours31-grid .c31 {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--surf);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cc, #0e5d54);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  transition: 0.15s;
}
.cours31-grid .c31:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.cours31-grid .c31n {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  background: var(--cc, #0e5d54);
  color: #fff;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* --- Cartes mnémotechniques à retourner (section Mémorisation) --- */
.mnemo { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card-flip { perspective: 1000px; height: 170px; cursor: pointer; }
.card-inner { position: relative; width: 100%; height: 100%; transition: transform 0.6s; transform-style: preserve-3d; }
.card-flip.flipped .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.3rem;
  text-align: center;
  box-shadow: var(--ombre);
}
.card-front { background: linear-gradient(135deg, #3f7d72, #0a3f39); color: #fff; }
.card-front .ico { font-size: 2rem; margin-bottom: 0.5rem; }
.card-front h4 { font-size: 1.1rem; color: #fff; }
.card-front small { opacity: 0.85; margin-top: 0.4rem; }
.card-back { background: var(--surf); color: var(--ink); transform: rotateY(180deg); border: 2px solid var(--violet); }
.card-back b { color: var(--violet); }

/* --- Pastilles A1/A2… et P1/P2… dans les encadrés (résumé, planification) --- */
.box .step, .resume .step { gap: 0.6rem; padding: 0.5rem 0; align-items: center; font-weight: 600; color: var(--ink); }
.box .step span, .resume .step span {
  background: var(--turquoise);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* --- Les 4 piliers de la réforme (résumé structuré) --- */
.piliers { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 1.5rem; }
.pil {
  background: var(--surf);
  border-radius: 14px;
  padding: 1.2rem;
  box-shadow: var(--ombre);
  text-align: center;
  border-bottom: 4px solid var(--turquoise);
  transition: transform 0.25s, box-shadow 0.25s;
}
.pil .n { font-size: 1.6rem; font-weight: 800; color: var(--turquoise); }
.pil h4 { color: var(--ink); margin: 0.3rem 0; }
.pil p { font-size: 0.88rem; color: var(--muted); }

/* --- Bandeau dépliant du résumé structuré --- */
.resume-band {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu));
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  text-align: center;
  margin-bottom: 0.4rem;
  border: none;
  border-left: 5px solid var(--gold);
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}
.resume-band:hover { filter: brightness(1.06); }
#resChev { display: inline-block; transition: transform 0.3s; }
.resume.closed #resChev { transform: rotate(180deg); }
.resume.closed #resumeBody { display: none; }

/* --- Badges des cartes de lois (section Textes de loi) --- */
.tag {
  display: inline-block;
  background: color-mix(in srgb, var(--bleu) 10%, var(--surf));
  color: var(--bleu);
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 0.6rem;
}
[data-theme="dark"] .tag { color: #7fe0cd; }

/* --- Filigrane des bannières de fiches/cours --- */
.cp-wm {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.62rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  pointer-events: none;
  z-index: 2;
}

/* --- Boutons déplier/replier des fiches --- */
.cours-intro { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 1.5rem; }

/* --- Textes officiels du BO (cartes de lois AR/FR) --- */
.lawgrid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); max-width: 900px; margin: auto; }
.lawcard {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surf);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  transition: 0.2s;
  box-shadow: var(--ombre);
}
.lawcard:hover { border-color: var(--bleu); transform: translateY(-3px); }
.lawcard .ln {
  flex: none;
  background: linear-gradient(135deg, var(--bleu), var(--bleu-fonce));
  color: #fff;
  font-weight: 800;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.92rem;
  min-width: 54px;
  text-align: center;
}
.lawcard .lt { flex: 1; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.lawcard .lacts { flex: none; display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-end; }
.lawcard .lf {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.28rem 0.6rem;
  border-radius: 7px;
  white-space: nowrap;
  transition: 0.18s;
  border: 1.5px solid transparent;
}
.lawcard .lf.ar { background: color-mix(in srgb, var(--bleu) 10%, var(--surf)); color: var(--bleu); }
.lawcard .lf.fr { background: color-mix(in srgb, var(--gold) 14%, var(--surf)); color: #9a7b1e; border-color: color-mix(in srgb, var(--gold) 45%, var(--surf)); }
.lawcard .lf:hover { filter: brightness(0.97); transform: translateY(-1px); border-color: currentColor; }
[data-theme="dark"] .lawcard .lf.ar { color: #7fe0cd; }
[data-theme="dark"] .lawcard .lf.fr { color: var(--jaune); }

/* --- Cartes-liens (liens utiles) --- */
.linkcard { display: block; cursor: pointer; }
.linkcard:hover { box-shadow: 0 14px 30px rgba(10, 63, 57, 0.2); }
.linkcard .tag { transition: 0.2s; }
.linkcard:hover .tag { background: var(--bleu); color: #fff; }

/* ==========================================================================
 * POLISH GLOBAL — accessibilité & finitions (appliqué à tout le site)
 * ========================================================================== */
/* Navigation clavier : anneau de focus visible aux couleurs de la marque */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

/* Sélection de texte aux couleurs institutionnelles */
::selection { background: var(--bleu); color: #fff; }

/* Titres : équilibrer les retours à la ligne (navigateurs récents) */
h1, h2, h3 { text-wrap: balance; }

/* Barre de défilement thémée (WebKit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--bleu) 55%, var(--fond)) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--bleu) 45%, var(--fond));
  border-radius: 99px;
  border: 2px solid var(--fond);
}
::-webkit-scrollbar-thumb:hover { background: var(--bleu); }

/* Respect du réglage « réduire les animations » du visiteur */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
