/* =========================================================
   EduSupVirtuelle — feuille de styles
   Identité : bleu marine #002352, bleu #0066d4, orange #ff6b00 (couleurs du logo),
   police Plus Jakarta Sans (la même que la salle de visio).
   ========================================================= */

:root {
  --fond: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --texte: #0f1b33;
  --texte-doux: #56627a;
  --bordure: #e2e7f0;
  --marque-edu: #002352;
  --marque-sup: #0066d4;
  --marque-virtuelle: #ff6b00;
  --accent: #0066d4;
  --accent-fort: #0052ab;
  --accent-doux: #e8f1fd;
  --orange: #ff6b00;
  --orange-doux: #fff1e6;
  --succes: #138a59;
  --succes-doux: #e2f6ec;
  --attention: #b26a00;
  --attention-doux: #fff4de;
  --danger: #c0352b;
  --danger-doux: #fdebe9;
  --rayon: 16px;
  --rayon-sm: 10px;
  --ombre: 0 1px 2px rgb(15 27 51 / 5%), 0 8px 24px -8px rgb(15 27 51 / 12%);
  --ombre-forte: 0 2px 4px rgb(15 27 51 / 6%), 0 24px 48px -16px rgb(0 35 82 / 28%);
  --police: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --entete-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0a1222;
    --surface: #111c33;
    --surface-2: #17243f;
    --texte: #e8eef9;
    --texte-doux: #a3b0c8;
    --bordure: #24324f;
    --marque-edu: #e8eef9;
    --marque-sup: #5aa2ff;
    --marque-virtuelle: #ff8a3d;
    --accent: #6eaeff;
    --accent-fort: #8fc0ff;
    --accent-doux: #16294a;
    --orange: #ff8a3d;
    --orange-doux: #3a2312;
    --succes: #5fd3a0;
    --succes-doux: #12332a;
    --attention: #f2b75c;
    --attention-doux: #3a2b12;
    --danger: #ff8a80;
    --danger-doux: #3d1d1b;
    --ombre: 0 1px 2px rgb(0 0 0 / 30%);
    --ombre-forte: 0 24px 48px -16px rgb(0 0 0 / 60%);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--entete-h) + 16px); }

body {
  margin: 0;
  /* Pied de page toujours en bas, même sur une page courte */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.65 var(--police);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.02em; }
h2 { font-size: 1.75rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.4em; }
h2:focus, main:focus { outline: none; }
p { margin: 0 0 1em; }
a { color: var(--accent); }

.aller-contenu { position: absolute; left: -9999px; }
.aller-contenu:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; box-shadow: var(--ombre); }

/* ------------------------------------------------------------ En-tête */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--bordure);
}

.entete-int {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  height: var(--entete-h);
  margin: 0 auto;
  padding: 0 24px;
}

.marque { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.marque:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.logo { width: 44px; height: 44px; flex: none; }
.nom-marque { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.m-edu { color: var(--marque-edu); }
.m-sup { color: var(--marque-sup); }
.m-virtuelle { color: var(--marque-virtuelle); }

/* Le bleu marine de l'emblème disparaîtrait sur fond sombre : on lui donne un support clair. */
@media (prefers-color-scheme: dark) {
  .logo, .pied-marque img { background: #fff; border-radius: 10px; padding: 3px; }
}

.nav-principale { display: flex; align-items: center; gap: 6px; }

.nav-principale a, .nav-principale button {
  font: inherit;
  font-size: .93rem;
  font-weight: 600;
  color: var(--texte-doux);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, background .15s;
}

.nav-principale a:hover, .nav-principale button:hover { color: var(--texte); background: var(--surface-2); }
.nav-principale a:focus-visible, .nav-principale button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.nav-principale .btn-entete {
  color: #fff;
  background: linear-gradient(135deg, #ff7a1a, #f05a00);
  box-shadow: 0 6px 16px -6px rgb(240 90 0 / 60%);
  margin-left: 6px;
}

.nav-principale .btn-entete:hover { color: #fff; background: linear-gradient(135deg, #ff8a33, #e05300); }

.barre-etapes:has(.etapes:empty) { display: none; }
.barre-etapes { border-top: 1px solid var(--bordure); }

.etapes {
  display: flex;
  justify-content: center;
  gap: 8px;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  font-size: .85rem;
}

.etapes li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--texte-doux);
  font-weight: 600;
}

.etapes .num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bordure);
  font-size: .75rem;
  font-weight: 700;
}

.etapes .en-cours { background: var(--accent-doux); color: var(--accent); }
.etapes .en-cours .num { background: var(--accent); color: #fff; }
.etapes .faite { color: var(--succes); }
.etapes .faite .num { background: var(--succes); color: #fff; }

/* ------------------------------------------------------------ Vitrine (accueil) */

#vitrine:empty { display: none; }

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 500px at 85% -10%, rgb(255 107 0 / 28%), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgb(0 102 212 / 45%), transparent 60%),
    linear-gradient(160deg, #001a3d 0%, #002352 45%, #003b80 100%);
}

/* Trame de points discrète */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / 9%) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  pointer-events: none;
}

.hero-int {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 96px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: #cfe2ff;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 22px;
}

.hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgb(255 107 0 / 25%); font-style: normal; }

.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -.035em;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #ff9a4d, #ff6b00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-texte { font-size: 1.15rem; color: #c9d6ee; max-width: 560px; margin-bottom: 30px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  border: 0;
  border-radius: 12px;
  padding: 15px 24px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s;
}

.btn-hero:hover { transform: translateY(-2px); }
.btn-hero:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn-hero-orange { color: #fff; background: linear-gradient(135deg, #ff7a1a, #f05a00); box-shadow: 0 12px 28px -10px rgb(255 107 0 / 70%); }
.btn-hero-clair { color: #fff; background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 25%); }
.btn-hero-clair:hover { background: rgb(255 255 255 / 16%); }

.hero-chiffres {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid rgb(255 255 255 / 12%);
}

.hero-chiffres div { display: flex; flex-direction: column; }
.hero-chiffres strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.hero-chiffres span { font-size: .88rem; color: #9fb3d6; }

/* Aperçu animé d'un tableau de bord de simulation */
.apercu {
  position: relative;
  color: var(--texte);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 40px 80px -24px rgb(0 0 0 / 55%);
  padding: 22px;
  transform: rotate(1.2deg);
  animation: flotter 7s ease-in-out infinite;
}

@keyframes flotter { 50% { transform: rotate(1.2deg) translateY(-10px); } }

.apercu-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.apercu-entete strong { font-size: .95rem; }
.apercu-pastille { font-size: .72rem; font-weight: 700; color: var(--accent); background: var(--accent-doux); border-radius: 999px; padding: 3px 10px; }
.apercu-jauge { margin-bottom: 12px; }
.apercu-jauge div:first-child { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 600; color: var(--texte-doux); }
.apercu-barre { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 5px; }
.apercu-barre i { display: block; height: 100%; border-radius: 999px; background: var(--c); width: var(--v); animation: remplir 2.4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes remplir { from { width: 8%; } }

.apercu-decision {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--succes-doux);
  color: var(--succes);
  font-size: .88rem;
  font-weight: 700;
}

.apercu-decision b { margin-left: auto; font-size: 1rem; }

.apercu-flottant {
  position: absolute;
  left: -34px;
  bottom: -26px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  color: var(--texte);
  border-radius: 14px;
  box-shadow: var(--ombre-forte);
  padding: 10px 14px;
  font-size: .85rem;
  font-weight: 600;
  transform: rotate(-2deg);
}


/* Sections de la vitrine */
.section { max-width: 1200px; margin: 0 auto; padding: 80px 24px 0; }
.section-tete { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.section-tete h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-tete p { color: var(--texte-doux); font-size: 1.05rem; }

.surtitre {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: .7em;
}

.etapes-vitrine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: etape; }

.etape-vitrine {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 28px;
}

.etape-vitrine::before {
  counter-increment: etape;
  content: counter(etape);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--marque-sup), #002f6c);
}

.etape-vitrine h3 { margin-top: 0; }
.etape-vitrine p { color: var(--texte-doux); margin: 0; }

.atouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.atout {
  display: flex;
  flex-direction: column;
  border-radius: var(--rayon);
  padding: 30px;
  color: #fff;
  overflow: hidden;
  position: relative;
  min-height: 250px;
}

.atout::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgb(255 255 255 / 8%); }
.atout-icone { margin-bottom: 18px; }
.atout h3 { margin: 0 0 8px; font-size: 1.25rem; }
.atout p { color: rgb(255 255 255 / 82%); flex: 1; }
.atout-a { background: linear-gradient(150deg, #003b80, #002352); }
.atout-b { background: linear-gradient(150deg, #ff7a1a, #c84a00); }
.atout-c { background: linear-gradient(150deg, #0a7ae6, #0052ab); }

.atout-lien {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: rgb(255 255 255 / 14%);
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
}

.atout-lien:hover { background: rgb(255 255 255 / 24%); }
.atout-lien:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ------------------------------------------------------------ Mise en page */

.mise-en-page {
  flex: 1 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-content: start;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.carte {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 32px;
  margin-bottom: 22px;
}

.carte > h3:first-child { margin-top: 0; }
.lead { font-size: 1.1rem; color: var(--texte-doux); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  padding: 13px 24px;
  cursor: pointer;
  margin-top: 14px;
  transition: transform .15s, box-shadow .15s, filter .15s;
}

.btn-principal {
  background: linear-gradient(135deg, var(--marque-sup), #0050b0);
  color: #fff;
  box-shadow: 0 10px 22px -10px rgb(0 102 212 / 70%);
}

.btn-principal:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-secondaire { background: var(--surface); color: var(--texte); border: 1px solid var(--bordure); }
.btn-secondaire:hover { border-color: var(--accent); color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.lien-retour {
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 14px;
  cursor: pointer;
}

.lien-retour:hover { text-decoration: underline; }

/* ------------------------------------------------------------ Catalogue */

/* Sans module chargé, le tableau de bord est masqué et le contenu occupe toute la largeur. */
.mise-en-page.sans-tdb { grid-template-columns: 1fr; }
.sans-tdb .tableau-de-bord { display: none; }
body.accueil .mise-en-page { padding-top: 80px; }

.catalogue-intro { text-align: center; max-width: 680px; margin: 0 auto 28px; }
.catalogue-intro h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.catalogue-intro .lead { margin: 0; }

.filtres { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 32px; }

.filtre {
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--texte-doux);
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all .15s;
}

.filtre:hover { border-color: var(--accent); color: var(--accent); }
.filtre.actif { background: var(--texte); border-color: var(--texte); color: var(--surface); }
.filtre:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* L'attribut hidden doit l'emporter sur display: flex des cartes. */
.module[hidden] { display: none; }

.catalogue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.module {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 0 24px 22px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

/* Bandeau coloré de la discipline */
.module::before {
  content: "";
  display: block;
  height: 86px;
  margin: 0 -24px 0;
  background:
    radial-gradient(160px 90px at 85% 10%, rgb(255 255 255 / 30%), transparent 70%),
    linear-gradient(135deg, var(--couleur-module), color-mix(in srgb, var(--couleur-module) 55%, #001a3d));
}

.module:hover { transform: translateY(-4px); box-shadow: var(--ombre-forte); border-color: color-mix(in srgb, var(--couleur-module) 45%, var(--bordure)); }
.module:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.module-icone {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 18px -8px rgb(0 0 0 / 35%);
}

.module-discipline {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--couleur-module);
  margin-top: 6px;
}

@media (prefers-color-scheme: dark) {
  .module-discipline { color: color-mix(in srgb, var(--couleur-module) 55%, #fff); }
}

.module-titre { font-size: 1.18rem; line-height: 1.3; letter-spacing: -.01em; }
.module-role { font-size: .9rem; font-weight: 600; color: var(--texte-doux); }

.module-accroche {
  font-size: .9rem;
  color: var(--texte-doux);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--texte-doux);
  border-top: 1px solid var(--bordure);
  padding-top: 14px;
  margin-top: 8px;
}

.module-jouer { font-weight: 700; color: var(--accent); transition: transform .2s; }
.module:hover .module-jouer { transform: translateX(4px); }

/* ------------------------------------------------------------ Agent de génération */

.agent-carte {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  border: 0;
  background:
    radial-gradient(500px 200px at 100% 0%, rgb(255 255 255 / 18%), transparent 70%),
    linear-gradient(135deg, #ff7a1a, #c84a00);
  margin-bottom: 32px;
}

.agent-carte > div { flex: 1 1 320px; }
.agent-carte h3 { margin-top: 0; font-size: 1.35rem; }
.agent-carte p:last-child { margin-bottom: 0; color: rgb(255 255 255 / 88%); }
.agent-carte .surtitre { color: #ffe1c7; }
.agent-carte .btn { margin-top: 0; background: #fff; color: #c84a00; box-shadow: 0 10px 22px -10px rgb(0 0 0 / 40%); }
.agent-carte .badge-ia { background: #fff; color: #c84a00; }

.champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 22px 0;
}

/* Libellé et mention « (facultatif) » sur la même ligne, champ en dessous */
.champs label { display: block; font-weight: 600; font-size: .95rem; }
.champs label > input, .champs label > select, .champs label > textarea { display: block; width: 100%; margin-top: 7px; }
.champs em { font-weight: 400; color: var(--texte-doux); }
.champ-large { grid-column: 1 / -1; }

.champs input,
.champs select,
textarea {
  font: inherit;
  font-weight: 400;
  color: inherit;
  background: var(--surface);
  border: 1.5px solid var(--bordure);
  border-radius: var(--rayon-sm);
  padding: 11px 14px;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; }

.champs input:focus,
.champs select:focus,
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-doux); }

.case { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; background: var(--surface-2); border-radius: var(--rayon-sm); padding: 14px 16px; }
.case input { margin-top: 5px; accent-color: var(--accent); width: 18px; height: 18px; }

.generation { text-align: center; padding: 64px 32px; }
.generation::before {
  content: "";
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 4px solid var(--accent-doux);
  border-top-color: var(--orange);
  animation: tourner 1s linear infinite;
}

@keyframes tourner { to { transform: rotate(360deg); } }

.genere-info {
  background: var(--attention-doux);
  border-radius: var(--rayon-sm);
  padding: 16px 18px;
  margin: 22px 0 4px;
  font-size: .92rem;
}

.genere-info p { margin-bottom: 8px; }
.genere-info details { margin-bottom: 8px; }
.genere-info summary { cursor: pointer; font-weight: 600; }
.genere-info ul { margin: 8px 0 0; padding-left: 1.2em; }
.genere-info a { color: var(--accent); overflow-wrap: anywhere; }
.genere-info .btn { margin-top: 4px; padding: 9px 16px; font-size: .9rem; }

/* ------------------------------------------------------------ Accueil d'un module */

.intro { position: relative; overflow: hidden; }
.intro::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--marque-sup), var(--orange)); }
.intro h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

.fiche-role {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.fiche-role div { background: var(--surface-2); border-radius: var(--rayon-sm); padding: 14px 16px; }
.fiche-role dt { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-doux); }
.fiche-role dd { margin: 2px 0 0; font-weight: 700; }

.objectifs { list-style: none; padding: 0; }
.objectifs li { position: relative; padding-left: 30px; margin-bottom: .55em; }
.objectifs li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--succes-doux); }
.objectifs li::after { content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 12px; background: var(--succes); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5' /%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5' /%3E%3C/svg%3E") center / contain no-repeat; }

.consigne {
  border-left: 4px solid var(--accent);
  background: var(--accent-doux);
  padding: 14px 18px;
  border-radius: 0 var(--rayon-sm) var(--rayon-sm) 0;
}

/* ------------------------------------------------------------ Étape */

.donnees {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 22px 0 4px;
}

.donnee {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-radius: var(--rayon-sm);
  padding: 14px 16px;
}

.donnee-valeur { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; color: var(--marque-sup); }
.donnee-label { font-size: .85rem; color: var(--texte-doux); }
.donnee-note { font-size: .78rem; font-weight: 600; color: var(--attention); }

.evenements h3 { margin-top: 1.4em; }

.evenement {
  background: var(--attention-doux);
  border-left: 4px solid var(--attention);
  border-radius: 0 var(--rayon-sm) var(--rayon-sm) 0;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.evenement p { margin: 0; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
legend h3 { margin-top: 0; font-size: 1.3rem; }

.choix-liste { display: grid; gap: 12px; }

.choix {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--bordure);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}

.choix:hover { border-color: var(--accent); box-shadow: var(--ombre); transform: translateY(-1px); }
.choix:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); box-shadow: 0 0 0 3px var(--accent-doux); }
.choix:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.choix input { position: absolute; opacity: 0; pointer-events: none; }

.choix-lettre {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 800;
  color: var(--texte-doux);
}

.choix:has(input:checked) .choix-lettre { background: var(--accent); color: #fff; }

.choix-texte { display: flex; flex-direction: column; gap: 4px; }
.choix-texte strong { font-size: 1.03rem; }
.choix-texte span { color: var(--texte-doux); font-size: .95rem; }

.justification { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; font-weight: 600; }
.justification em { font-weight: 400; color: var(--texte-doux); }

/* ------------------------------------------------------------ Feedback */

.feedback { position: relative; overflow: hidden; }
.feedback::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--couleur-niveau); }
.feedback-excellent { --couleur-niveau: var(--succes); --fond-niveau: var(--succes-doux); }
.feedback-moyen { --couleur-niveau: var(--attention); --fond-niveau: var(--attention-doux); }
.feedback-faible { --couleur-niveau: var(--danger); --fond-niveau: var(--danger-doux); }

.verdict {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: var(--fond-niveau);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 6px 0 8px;
}

.verdict h2 { margin: 0; color: var(--couleur-niveau); font-size: 1.5rem; }

.points {
  background: var(--surface);
  color: var(--couleur-niveau);
  font-weight: 800;
  font-size: 1.25rem;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--ombre);
}

.points small { font-weight: 500; font-size: .8rem; }

.effets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
}

.effets li {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .9rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 4px 5px 4px 14px;
}

.delta {
  font-weight: 800;
  font-size: .82rem;
  border-radius: 999px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}

.delta-hausse { background: var(--succes-doux); color: var(--succes); }
.delta-baisse { background: var(--danger-doux); color: var(--danger); }
.delta-neutre { background: var(--surface-2); color: var(--texte-doux); }

.modificateur {
  font-size: .95rem;
  font-style: italic;
  background: var(--surface-2);
  padding: 12px 16px;
  border-radius: var(--rayon-sm);
}

.concept {
  position: relative;
  background: linear-gradient(135deg, var(--accent-doux), color-mix(in srgb, var(--accent-doux) 60%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 14px;
  padding: 18px 20px 18px 58px;
  margin: 22px 0 8px;
}

.concept::before { content: ""; position: absolute; left: 18px; top: 17px; width: 24px; height: 24px; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5' /%3E%3Cpath d='M9 18h6' /%3E%3Cpath d='M10 22h4' /%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5' /%3E%3Cpath d='M9 18h6' /%3E%3Cpath d='M10 22h4' /%3E%3C/svg%3E") center / contain no-repeat; }
.concept p:last-child { margin: 0; }
.concept-titre { font-weight: 800; color: var(--accent); }

/* ------------------------------------------------------------ Analyse IA */

.analyse-ia:empty { display: none; }
.analyse-ia {
  border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 14px;
  padding: 4px 20px 18px;
  margin: 22px 0 8px;
}

.badge-ia {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  vertical-align: middle;
  background: linear-gradient(135deg, var(--marque-sup), #6d3bd6);
  color: #fff;
  border-radius: 6px;
  padding: 2px 7px;
  margin-left: 4px;
}

.ia-info { color: var(--texte-doux); font-size: .92rem; margin: 12px 0 0; }
.ia-info code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.ia-chargement { color: var(--texte-doux); animation: pulsation 1.4s ease-in-out infinite; }
@keyframes pulsation { 50% { opacity: .4; } }

.ia-note { display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.ia-note span { width: 15px; height: 15px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--bordure); }
.ia-note span.plein { background: var(--accent); border-color: var(--accent); }
.ia-note strong { margin-left: 6px; color: var(--accent); }

.ia-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ia-colonnes h4 { margin: 0 0 4px; font-size: .95rem; }
.ia-colonnes ul { margin: 0; padding-left: 1.2em; }
.ia-colonnes li { margin-bottom: 4px; }

.ia-question { background: var(--accent-doux); padding: 12px 16px; border-radius: var(--rayon-sm); margin: 14px 0 0; }

/* ------------------------------------------------------------ Bilan */

.bilan { text-align: center; }
.bilan .surtitre { display: block; }
.bilan .alertes { text-align: left; }

.score {
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  margin: 18px auto 16px;
  border-radius: 50%;
  background: conic-gradient(var(--orange) 0deg, var(--marque-sup) calc(var(--p, 0) * 3.6deg), var(--surface-2) 0);
}

.score-anneau {
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: var(--surface);
}

.score-valeur { font-size: 3rem; font-weight: 800; color: var(--texte); line-height: 1; letter-spacing: -.03em; }
.score-max { font-size: 1.1rem; font-weight: 600; color: var(--texte-doux); margin-left: 4px; }
.bonus { color: var(--texte-doux); }

.alertes p {
  background: var(--danger-doux);
  color: var(--danger);
  font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--rayon-sm);
  margin-bottom: 8px;
}

.profil { background: linear-gradient(150deg, #003b80, #002352); color: #fff; border: 0; }
.profil .surtitre { color: #ffb27a; }
.profil h3 { margin-top: 0; font-size: 1.5rem; }
.profil p { color: rgb(255 255 255 / 85%); }
.piste { background: rgb(255 255 255 / 10%); padding: 14px 16px; border-radius: var(--rayon-sm); margin: 0; }

.journal { list-style: none; padding: 0; counter-reset: decision; }
.journal li { position: relative; padding: 0 0 18px 46px; margin-bottom: 4px; border-left: 2px solid var(--bordure); margin-left: 16px; }
.journal li:last-child { border-left-color: transparent; }
.journal li::before { counter-increment: decision; content: counter(decision); position: absolute; left: -16px; top: -2px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: .85rem; color: #fff; background: var(--marque-sup); }
.journal-entete { display: flex; justify-content: space-between; gap: 12px; }
.points-mini { font-weight: 800; color: var(--accent); white-space: nowrap; }

.journal blockquote {
  margin: 8px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--bordure);
  color: var(--texte-doux);
  font-style: italic;
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}

.journal-concept { font-size: .85rem; color: var(--texte-doux); margin: 4px 0 0; }

/* ------------------------------------------------------------ Tableau de bord */

.tableau-de-bord {
  position: sticky;
  top: calc(var(--entete-h) + 64px);
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 22px;
}

.tdb-titre { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-doux); margin-bottom: 18px; }
.tdb-titre::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--succes); box-shadow: 0 0 0 4px var(--succes-doux); }

.jauge { margin-bottom: 18px; }
.jauge:last-child { margin-bottom: 0; }

.jauge-entete { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.jauge-label { font-weight: 700; flex: 1; }
.jauge-valeur { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

.barre {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 7px 0 5px;
}

.remplissage {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--couleur) 70%, #fff), var(--couleur));
  border-radius: 999px;
  transition: width .7s cubic-bezier(.2, .8, .2, 1);
}

.jauge.critique .remplissage { background: var(--danger); }
.jauge.critique .jauge-valeur { color: var(--danger); }

.jauge-aide { font-size: .78rem; color: var(--texte-doux); margin: 0; }

/* ------------------------------------------------------------ Pied de page */

.pied { background: #001a3d; color: #b9c7df; margin-top: 40px; }
.pied-int { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; max-width: 1200px; margin: 0 auto; padding: 36px 24px; }
.pied-marque { display: flex; align-items: center; gap: 12px; }
.pied-marque img { background: #fff; border-radius: 10px; padding: 3px; }
.pied-marque strong { font-size: 1.15rem; font-weight: 800; }
.pied-marque .m-edu { color: #fff; }
.pied-marque .m-sup { color: #5aa2ff; }
.pied-marque p { margin: 0; font-size: .88rem; }
.pied-liens { display: flex; gap: 20px; }
.pied-liens a { color: #fff; text-decoration: none; font-weight: 600; font-size: .92rem; }
.pied-liens a:hover { text-decoration: underline; }
.pied-mention { width: 100%; margin: 0; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 10%); font-size: .82rem; color: #8193b3; }


/* ------------------------------------------------------------ Icônes (Lucide) */

.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.btn .ico, .btn-hero .ico, .nav-principale .ico, .lien-retour .ico, .module-jouer .ico { width: 1.1em; height: 1.1em; }
.btn-entete { display: inline-flex; align-items: center; gap: 7px; }
.module-jouer { display: inline-flex; align-items: center; gap: 4px; }
.lien-retour { display: inline-flex; align-items: center; gap: 6px; }
.module-icone { color: var(--couleur-module); }
.module-icone .ico { width: 28px; height: 28px; stroke-width: 1.8; }
.apercu-entete strong { display: inline-flex; align-items: center; gap: 8px; }
.apercu-entete .ico { color: var(--marque-sup); }
.apercu-decision .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.apercu-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--orange); background: var(--orange-doux); }
.apercu-ico .ico { width: 18px; height: 18px; }
.atout-icone { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: rgb(255 255 255 / 14%); border: 1px solid rgb(255 255 255 / 22%); }
.atout-icone .ico { width: 26px; height: 26px; stroke-width: 1.8; }
@media (prefers-color-scheme: dark) {
  .module-icone { color: color-mix(in srgb, var(--couleur-module) 60%, #fff); }
}

/* ------------------------------------------------------------ Responsive */

@media (max-width: 980px) {
  .hero-int { grid-template-columns: minmax(0, 1fr); padding: 56px 20px 72px; gap: 56px; }
  .apercu { max-width: 440px; width: 100%; margin: 0 auto; }
  .etapes-vitrine, .atouts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  :root { --entete-h: 60px; }
  .entete-int { padding: 0 16px; }
  .nav-principale #lien-micromondes, .nav-principale #lien-agent { display: none; }
  .mise-en-page { grid-template-columns: 1fr; padding: 20px 16px 48px; }
  body.accueil .mise-en-page { padding-top: 56px; }
  /* Le tableau de bord passe en haut et reste visible en défilant. */
  .tableau-de-bord { order: -1; top: calc(var(--entete-h) + 52px); z-index: 2; padding: 12px 16px; }
  .jauge-aide, .tdb-titre { display: none; }
  #jauges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .jauge { margin: 0; }
  .carte { padding: 22px; }
  .etapes { padding: 8px 16px; justify-content: flex-start; overflow-x: auto; }
  .etapes li span:not(.num) { display: none; }
  .etapes li { padding: 5px 6px; }
  .section { padding: 56px 16px 0; }
  .apercu-flottant { left: 8px; }
}

@media (max-width: 480px) {
  .nom-marque { font-size: 1.15rem; }
  .nav-principale .btn-entete { padding: 8px 12px; font-size: .85rem; }
  .hero-chiffres { gap: 22px; }
  .btn-hero { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
