/* MH FORMATION — mise en page « dossier de consultation » :
   une colonne réglée, des articles numérotés, le rouge en tampon. */

:root {
  --encre:      #111114;
  --encre-doux: #4A4A52;
  --papier:     #FFFFFF;
  --papier-2:   #F3F3F0;
  --papier-3:   #E9E9E4;
  --trait:      #DEDED8;
  --rouge:      #FF4040;
  --rouge-2:    #D92B2B;
  --rouge-pale: #FFEDEC;
  --ombre:      0 1px 2px rgba(17,17,20,.05), 0 8px 24px rgba(17,17,20,.06);

  --titre: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --texte: "Inter", "Helvetica Neue", Arial, sans-serif;
  --code:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --large: 1180px;
  --lire:  68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --encre:      #F2F2EF;
    --encre-doux: #A8A8A2;
    --papier:     #0E0E11;
    --papier-2:   #16161A;
    --papier-3:   #1F1F25;
    --trait:      #2A2A31;
    --rouge:      #FF5A5A;
    --rouge-2:    #FF8080;
    --rouge-pale: #2A1517;
    --ombre:      0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --encre:      #F2F2EF;
  --encre-doux: #A8A8A2;
  --papier:     #0E0E11;
  --papier-2:   #16161A;
  --papier-3:   #1F1F25;
  --trait:      #2A2A31;
  --rouge:      #FF5A5A;
  --rouge-2:    #FF8080;
  --rouge-pale: #2A1517;
  --ombre:      0 1px 2px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* Le script cache et montre avec l'attribut « hidden ». Plus bas, des blocs
   posent « display: flex » ou « display: grid » : sans cette règle, ils
   gagnent contre « hidden » et l'élément reste visible — le voile du
   rendez-vous se met alors devant toute la page et bloque chaque clic.
   La règle est écrite une fois, ici, et vaut partout. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--papier);
}

img, svg { max-width: 100%; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--titre);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4.1rem); }
h2 { font-size: clamp(1.55rem, 1.1rem + 2vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, .95rem + .7vw, 1.4rem); }
p  { margin: 0; }

.bande { width: 100%; }
.dedans {
  width: 100%;
  max-width: var(--large);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.serre { max-width: var(--lire); }

.section { padding-block: clamp(3rem, 1.5rem + 5vw, 6rem); }
.section--pale { background: var(--papier-2); }
.section--encre { background: var(--encre); color: var(--papier); }
.section--encre h2, .section--encre h3 { color: var(--papier); }

/* ---------- Étiquette de rubrique ---------- */
.oeil {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--code);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rouge-2);
  margin-bottom: 1rem;
}
.oeil::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: var(--rouge);
}
.section--encre .oeil { color: var(--rouge); }

/* ---------- En-tête ---------- */
.tete {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--papier) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--trait);
}
.tete__rang {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: .7rem;
}
.marque { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.marque__mh {
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -.04em;
  line-height: 1;
}
.marque__mh em { font-style: normal; color: var(--rouge); }
.marque__sous {
  font-family: var(--code);
  font-size: .58rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--encre-doux);
  display: block;
  margin-top: .2rem;
}

.nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  font-size: .9rem;
  padding: .45rem .6rem;
  border-radius: 6px;
  color: var(--encre-doux);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--encre); background: var(--papier-2); }
.nav a[aria-current="page"] { color: var(--encre); font-weight: 600; }
.nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--rouge);
  margin-top: .18rem;
}

.burger {
  display: none;
  border: 1px solid var(--trait);
  background: var(--papier);
  color: var(--encre);
  border-radius: 8px;
  padding: .45rem .6rem;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 900px) {
  .burger { display: block; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--papier);
    border-bottom: 1px solid var(--trait);
    padding: .5rem max(16px, env(safe-area-inset-left, 0px)) 1rem;
  }
  .nav.est-ouvert { display: flex; }
  .nav a { padding: .7rem .2rem; border-bottom: 1px solid var(--trait); border-radius: 0; }
  .tete__rang { position: relative; }
}

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--texte);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  padding: .72rem 1.15rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s cubic-bezier(.2,.7,.3,1), background .16s, border-color .16s, box-shadow .16s;
}
.bouton:hover { transform: translateY(-2px); }
.bouton:active { transform: translateY(0); }
.bouton--plein { background: var(--rouge); color: #fff; }
.bouton--plein:hover { background: var(--rouge-2); box-shadow: 0 8px 20px rgba(255,64,64,.3); }
.bouton--trait { border-color: var(--trait); background: var(--papier); color: var(--encre); }
.bouton--trait:hover { border-color: var(--encre); }
.bouton--clair { background: var(--papier); color: var(--encre); }
.bouton svg { width: 1.05em; height: 1.05em; flex: none; }

/* ---------- Accueil ---------- */
.heros { padding-block: clamp(2.5rem, 1rem + 6vw, 5.5rem) clamp(2rem, 1rem + 3vw, 3.5rem); }
.heros__grille { display: grid; gap: clamp(2rem, 1rem + 4vw, 3.5rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 950px) { .heros__grille { grid-template-columns: 1.25fr .75fr; } }

.heros h1 em { font-style: normal; color: var(--rouge); }
.heros__chapo {
  margin-top: 1.4rem;
  font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem);
  color: var(--encre-doux);
  max-width: 52ch;
}
.heros__actes { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }

.fiche-id {
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: var(--papier-2);
  padding: 1.3rem;
  min-width: 0;
}
.fiche-id__titre {
  font-family: var(--code);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--encre-doux);
  margin-bottom: .9rem;
}
.fiche-id dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0; font-size: .86rem; }
.fiche-id dt { color: var(--encre-doux); }
.fiche-id dd { margin: 0; font-family: var(--code); font-size: .82rem; word-break: break-word; }

/* ---------- Chiffres ---------- */
.chiffres { display: grid; gap: 1px; background: var(--trait); border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chiffre { background: var(--papier); padding: 1.25rem; min-width: 0; }
.chiffre__n { font-family: var(--titre); font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.chiffre__n span { color: var(--rouge); }
.chiffre__l { font-size: .84rem; color: var(--encre-doux); margin-top: .3rem; }

/* ---------- Cartes ---------- */
.cartes { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
/* Cinq formations sur quatre colonnes laissent une carte seule en bas.
   Trois colonnes au plus : 3 puis 2, la rangée du bas reste équilibrée. */
.cartes--trois { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
@media (min-width: 1040px) { .cartes--trois { grid-template-columns: repeat(3, 1fr); } }
.carte {
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 1.4rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
}
a.carte { text-decoration: none; }
a.carte:hover, .carte--vive:hover { transform: translateY(-4px); box-shadow: var(--ombre); border-color: var(--encre); }
.carte__ico {
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--rouge-pale);
  color: var(--rouge-2);
  flex: none;
}
.carte__ico svg { width: 1.3rem; height: 1.3rem; }
.carte p { color: var(--encre-doux); font-size: .93rem; }
.carte__pied { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.carte__meta { font-family: var(--code); font-size: .76rem; color: var(--encre-doux); }
.carte__fleche { color: var(--rouge); font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; white-space: nowrap; }
.carte__meta { white-space: nowrap; }
a.carte:hover .carte__fleche { gap: .6rem; }
.carte__fleche { transition: gap .18s; }

/* ---------- Liste numérotée (articles) ---------- */
.articles { counter-reset: art; display: grid; gap: 0; border-top: 1px solid var(--trait); }
.article { counter-increment: art; border-bottom: 1px solid var(--trait); padding-block: 1.3rem; display: grid; gap: .35rem 1.4rem; grid-template-columns: 2.8rem 1fr; }
.article::before {
  content: counter(art, decimal-leading-zero);
  font-family: var(--code);
  font-size: .8rem;
  color: var(--rouge-2);
  padding-top: .25rem;
}
.article h3 { grid-column: 2; }
.article p, .article ul { grid-column: 2; color: var(--encre-doux); font-size: .94rem; }
.article ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.article li { margin-bottom: .25rem; }

/* ---------- Programme d'une formation ---------- */
.module { border: 1px solid var(--trait); border-radius: 10px; margin-bottom: .6rem; background: var(--papier); overflow: hidden; }
.module__t {
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 600;
  background: none;
  border: 0;
  color: inherit;
  padding: 1rem 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.module__t:hover { background: var(--papier-2); }
.module__n { font-family: var(--code); font-size: .76rem; color: var(--rouge-2); flex: none; }
.module__d { margin-left: auto; font-family: var(--code); font-size: .76rem; color: var(--encre-doux); flex: none; }
.module__c { padding: 0 1.1rem 1.1rem 3.4rem; color: var(--encre-doux); font-size: .93rem; }
.module__c ul { margin: 0; padding-left: 1.1rem; }
.module__fl { flex: none; transition: transform .2s; color: var(--encre-doux); }
.module[open] .module__fl { transform: rotate(90deg); }

/* ---------- Tableau de données ---------- */
.tableau-boite { overflow-x: auto; border: 1px solid var(--trait); border-radius: 10px; }
table.donnees { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.donnees th, table.donnees td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--trait); white-space: nowrap; }
table.donnees th { font-family: var(--code); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-doux); background: var(--papier-2); }
table.donnees tr:last-child td { border-bottom: 0; }
table.donnees td.prix { font-family: var(--code); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Encadré ---------- */
.encadre {
  border-left: 3px solid var(--rouge);
  background: var(--papier-2);
  border-radius: 0 10px 10px 0;
  padding: 1.1rem 1.3rem;
  font-size: .93rem;
  color: var(--encre-doux);
}
.encadre strong { color: var(--encre); }

/* ---------- Pied ---------- */
.pied { background: var(--encre); color: var(--papier); padding-block: 3rem 2rem; }
.pied a { color: var(--papier); text-decoration: none; opacity: .78; }
.pied a:hover { opacity: 1; text-decoration: underline; }
.pied__grille { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pied__t { font-family: var(--code); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; opacity: .55; margin-bottom: .9rem; }
.pied ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .9rem; }
.pied__bas { margin-top: 2.5rem; padding-top: 1.3rem; border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; justify-content: space-between; font-size: .8rem; opacity: .6; }
.pied .marque__mh, .pied .marque__sous { color: var(--papier); }

.qualiopi {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 9px;
  padding: .8rem 1rem;
  font-size: .82rem;
  line-height: 1.5;
  opacity: .85;
}
.qualiopi b { display: block; font-family: var(--code); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .3rem; opacity: .7; }

/* ---------- Apparition ---------- */
.monte { opacity: 1; }
.js .monte { opacity: 0; transform: translateY(14px); }
.js .monte.vu { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
@media (prefers-reduced-motion: reduce) {
  .js .monte, .js .monte.vu { opacity: 1; transform: none; transition: none; }
  .bouton:hover, a.carte:hover { transform: none; }
}

/* ---------- Bulle d'aide ---------- */
.bulle-lanceur {
  position: fixed;
  right: calc(1.1rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--encre);
  color: var(--papier);
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.15rem .75rem .85rem;
  font: 600 .92rem/1 var(--texte);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(17,17,20,.28);
  transition: transform .18s cubic-bezier(.2,.7,.3,1);
}
.bulle-lanceur:hover { transform: translateY(-3px); }
.bulle-lanceur__pastille { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--rouge); display: grid; place-items: center; flex: none; }
.bulle-lanceur__pastille svg { width: 1rem; height: 1rem; color: #fff; }
.bulle-lanceur__point { position: absolute; top: .5rem; right: .7rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--rouge); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .bulle-lanceur__point { animation: none; } }

.bulle {
  position: fixed;
  right: calc(1.1rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  z-index: 71;
  width: min(370px, calc(100vw - 2.2rem));
  max-height: min(560px, calc(100vh - 3rem));
  background: var(--papier);
  border: 1px solid var(--trait);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(17,17,20,.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bulle__tete { background: var(--encre); color: var(--papier); padding: 1rem 1.1rem; display: flex; align-items: center; gap: .75rem; }
.bulle__tete b { font-family: var(--titre); font-size: 1rem; }
.bulle__tete small { display: block; font-size: .75rem; opacity: .65; }
.bulle__x { margin-left: auto; background: none; border: 0; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; opacity: .7; padding: .2rem; }
.bulle__x:hover { opacity: 1; }
.bulle__fil { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.msg { max-width: 86%; padding: .65rem .9rem; border-radius: 12px; font-size: .9rem; line-height: 1.55; }
.msg--elle { background: var(--papier-2); border: 1px solid var(--trait); border-bottom-left-radius: 4px; }
.msg--lui { background: var(--rouge); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg a { color: var(--rouge-2); }
.msg--lui a { color: #fff; }
.bulle__choix { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem 1rem; }
.puce {
  border: 1px solid var(--trait);
  background: var(--papier);
  color: var(--encre);
  border-radius: 999px;
  padding: .42rem .8rem;
  font: 500 .82rem/1.2 var(--texte);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.puce:hover { border-color: var(--rouge); background: var(--rouge-pale); }

/* ---------- Fenêtre de rendez-vous ---------- */
.voile { position: fixed; inset: 0; z-index: 80; background: rgba(10,10,12,.55); display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.rdv {
  background: var(--papier);
  border-radius: 16px;
  border: 1px solid var(--trait);
  width: min(620px, 100%);
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  overflow: hidden;
}
.rdv__tete { padding: 1.3rem 1.4rem; border-bottom: 1px solid var(--trait); display: flex; align-items: flex-start; gap: 1rem; }
.rdv__tete h3 { font-size: 1.25rem; }
.rdv__tete p { font-size: .88rem; color: var(--encre-doux); margin-top: .25rem; }
.rdv__x { margin-left: auto; background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--encre-doux); padding: .1rem .3rem; }
.rdv__corps { padding: 1.3rem 1.4rem; display: grid; gap: 1.1rem; }
/* La bande des jours est plus large que la fenêtre : sans « min-width: 0 »,
   elle pousse la colonne de la grille et tout le formulaire déborde, coupé
   par le « overflow: hidden » de la fenêtre. La règle vaut pour tous les
   blocs du formulaire, pas seulement celui-là. */
.rdv__corps > *, .rdv__motifs, .rdv__paire, .jours, .creneaux { min-width: 0; }
.rdv__motifs { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choix-carte { border: 1px solid var(--trait); border-radius: 10px; padding: .8rem .9rem; cursor: pointer; font-size: .88rem; display: flex; gap: .6rem; align-items: flex-start; transition: border-color .15s, background .15s; }
.choix-carte:hover { border-color: var(--rouge); }
.choix-carte input { margin-top: .22rem; accent-color: var(--rouge); }
.choix-carte.est-choisi { border-color: var(--rouge); background: var(--rouge-pale); }
.jours { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .3rem; }
.jour {
  border: 1px solid var(--trait); background: var(--papier); color: inherit;
  border-radius: 10px; padding: .55rem .7rem; min-width: 4.3rem; cursor: pointer; text-align: center; font: inherit;
  transition: border-color .15s, background .15s;
}
.jour small { display: block; font-family: var(--code); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-doux); }
.jour b { display: block; font-family: var(--titre); font-size: 1.15rem; }
.jour:hover { border-color: var(--rouge); }
.jour.est-choisi { border-color: var(--rouge); background: var(--rouge); color: #fff; }
.jour.est-choisi small { color: rgba(255,255,255,.8); }
.creneaux { display: flex; flex-wrap: wrap; gap: .45rem; }
.creneau { border: 1px solid var(--trait); background: var(--papier); color: inherit; border-radius: 8px; padding: .45rem .75rem; font: 500 .86rem/1 var(--code); cursor: pointer; transition: border-color .15s, background .15s; }
.creneau:hover { border-color: var(--rouge); }
.creneau.est-choisi { border-color: var(--rouge); background: var(--rouge); color: #fff; }
.champ { display: grid; gap: .3rem; }
.champ label { font-size: .82rem; color: var(--encre-doux); }
.champ input, .champ textarea {
  font: inherit; padding: .62rem .8rem; border-radius: 8px;
  border: 1px solid var(--trait); background: var(--papier); color: var(--encre);
}
.champ input:focus, .champ textarea:focus { outline: 2px solid var(--rouge); outline-offset: 1px; border-color: transparent; }
.rdv__paire { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.rdv__pied { padding: 1.1rem 1.4rem; border-top: 1px solid var(--trait); background: var(--papier-2); display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; }
.rdv__note { font-size: .78rem; color: var(--encre-doux); }
.rdv__ok { text-align: center; padding: 2.4rem 1.4rem; display: grid; gap: .8rem; justify-items: center; }
.rdv__ok .rond { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--rouge-pale); color: var(--rouge-2); display: grid; place-items: center; }
.rdv__ok .rond svg { width: 1.6rem; height: 1.6rem; }

:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; border-radius: 4px; }

.ruban {
  display: inline-block;
  font-family: var(--code);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--rouge);
  color: var(--rouge-2);
  border-radius: 999px;
  padding: .22rem .6rem;
}

/* =======================================================================
   ILLUSTRATIONS ET ANIMATIONS
   Tout ce qui bouge est écrit ici, et tout est coupé d'un seul bloc à la
   fin du fichier si le visiteur a demandé « moins d'animations ».
   ======================================================================= */

/* ---------- La boîte d'illustration ---------- */
.illu-boite { color: var(--encre); width: 100%; }
.illu-boite .illu { width: 100%; height: auto; display: block; overflow: visible; }
.illu-boite--petite { max-width: 340px; }
.illu-boite--large { max-width: 640px; margin-inline: auto; }
.illu .coche-r, .illu .ligne-r, .illu .rond-r, .illu .pt, .illu .et { stroke: var(--rouge); }
.illu .pt, .illu .rond-r, .illu .et { fill: var(--rouge); }
.illu [fill="var(--papier)"] { fill: var(--papier); }

/* ---------- Le trait qui se dessine ---------- */
.illu .t { stroke-dasharray: 1; stroke-dashoffset: 1; }
.monte.vu .illu .t { animation: tracer .85s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes tracer { to { stroke-dashoffset: 0; } }

/* le décalage donne l'impression d'une main qui dessine */
.monte.vu .illu .t:nth-of-type(2n)  { animation-delay: .08s; }
.monte.vu .illu .t:nth-of-type(3n)  { animation-delay: .16s; }
.monte.vu .illu .t:nth-of-type(5n)  { animation-delay: .24s; }
.monte.vu .illu .b1 { animation-delay: .30s; }
.monte.vu .illu .b2 { animation-delay: .40s; }
.monte.vu .illu .b3 { animation-delay: .50s; }
.monte.vu .illu .b4 { animation-delay: .60s; }
.monte.vu .illu .trace-coche { animation-delay: .75s; }

/* ---------- Les parties qui apparaissent et flottent ---------- */
.illu .flotte1, .illu .flotte2, .illu .flotte3,
.illu .pousse1, .illu .pousse2, .illu .etape, .illu .source { opacity: 0; }
.monte.vu .illu .flotte1 { animation: parait .5s .25s forwards, flotte 5.5s 1s ease-in-out infinite; }
.monte.vu .illu .flotte2 { animation: parait .5s .40s forwards, flotte 6.5s 1.2s ease-in-out infinite; }
.monte.vu .illu .flotte3 { animation: parait .5s .55s forwards, flotte 4.8s .9s ease-in-out infinite; }
.monte.vu .illu .pousse1 { animation: pousse .6s .18s cubic-bezier(.2,.8,.3,1) forwards; }
.monte.vu .illu .pousse2 { animation: pousse .6s .36s cubic-bezier(.2,.8,.3,1) forwards; }
.monte.vu .illu .e1 { animation: surgit .5s .35s cubic-bezier(.2,1.5,.4,1) forwards; }
.monte.vu .illu .e2 { animation: surgit .5s .55s cubic-bezier(.2,1.5,.4,1) forwards; }
.monte.vu .illu .e3 { animation: surgit .5s .75s cubic-bezier(.2,1.5,.4,1) forwards; }
.monte.vu .illu .e4 { animation: surgit .5s .95s cubic-bezier(.2,1.5,.4,1) forwards; }
.monte.vu .illu .s1 { animation: parait .5s .30s forwards; }
.monte.vu .illu .s2 { animation: parait .5s .45s forwards; }
.monte.vu .illu .s3 { animation: parait .5s .60s forwards; }

@keyframes parait { to { opacity: 1; } }
@keyframes pousse { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes surgit { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes flotte { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.illu g[class*="flotte"], .illu g[class*="pousse"], .illu g[class*="etape"],
.illu g[class*="source"], .illu .epingle, .illu .tourne { transform-box: fill-box; transform-origin: center; }

/* ---------- Les mouvements propres à chaque dessin ---------- */
.illu .fil { stroke-dasharray: .06 .05; }
.monte.vu .illu .fil { animation: coule 2.4s linear infinite; stroke-dashoffset: 0; }
@keyframes coule { to { stroke-dashoffset: -1.1; } }

.illu .monte-fleche { opacity: 0; }
.monte.vu .illu .monte-fleche { animation: parait .4s .8s forwards, vaetvient 2.2s 1.2s ease-in-out infinite; }
@keyframes vaetvient { 0%,100% { transform: translateX(0); } 50% { transform: translateX(7px); } }

.illu .remplit { transform: scaleX(0); transform-box: fill-box; transform-origin: left center; }
.monte.vu .illu .remplit { animation: remplit 2.6s .7s cubic-bezier(.3,.8,.3,1) forwards; }
@keyframes remplit { to { transform: scaleX(.78); } }

.illu .barre { transform: scaleY(0); transform-box: fill-box; transform-origin: bottom center; }
.monte.vu .illu .v1 { animation: pousseh .7s .25s cubic-bezier(.2,.9,.3,1) forwards; }
.monte.vu .illu .v2 { animation: pousseh .7s .40s cubic-bezier(.2,.9,.3,1) forwards; }
.monte.vu .illu .v3 { animation: pousseh .7s .55s cubic-bezier(.2,.9,.3,1) forwards; }
.monte.vu .illu .v4 { animation: pousseh .7s .70s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes pousseh { to { transform: scaleY(1); } }

.monte.vu .illu .tourne { animation: tourne 48s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.illu .et { opacity: .25; }
.monte.vu .illu .et { animation: scintille 3.2s ease-in-out infinite; }
.monte.vu .illu .et:nth-of-type(2) { animation-delay: .4s; }
.monte.vu .illu .et:nth-of-type(3) { animation-delay: .8s; }
.monte.vu .illu .et:nth-of-type(4) { animation-delay: 1.2s; }
.monte.vu .illu .et:nth-of-type(5) { animation-delay: 1.6s; }
.monte.vu .illu .et:nth-of-type(6) { animation-delay: 2.0s; }
.monte.vu .illu .et:nth-of-type(7) { animation-delay: 2.4s; }
@keyframes scintille { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.illu .epingle { opacity: 0; }
.monte.vu .illu .epingle { animation: tombe .7s .45s cubic-bezier(.3,1.6,.4,1) forwards; }
@keyframes tombe { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: none; } }
.monte.vu .illu .onde-sol .s1 { animation: onde 2.6s 1s ease-out infinite; }
.monte.vu .illu .onde-sol .s2 { animation: onde 2.6s 1.5s ease-out infinite; }
@keyframes onde { 0% { opacity: .6; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.25); } }
.illu .onde-sol ellipse { transform-box: fill-box; transform-origin: center; }

.monte.vu .illu .o1 { animation: respire 2.4s ease-in-out infinite; }
.monte.vu .illu .o2 { animation: respire 2.4s .4s ease-in-out infinite; }
@keyframes respire { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.monte.vu .illu .plume { animation: parait .5s .3s forwards, ecritmain 6s 1s ease-in-out infinite; }
@keyframes ecritmain { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(-10px,6px) rotate(-5deg); } }

/* ---------- Le fond vivant de la bannière ---------- */
.heros { position: relative; overflow: hidden; isolation: isolate; }
.heros::before, .heros::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(70px); opacity: .5; pointer-events: none;
}
.heros::before { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -18%; right: -12%; background: var(--rouge-pale); animation: derive1 20s ease-in-out infinite; }
.heros::after  { width: 34vw; height: 34vw; max-width: 460px; max-height: 460px;
  bottom: -26%; left: -10%; background: var(--rouge-pale); opacity: .36; animation: derive2 26s ease-in-out infinite; }
@keyframes derive1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,40px) scale(1.12); } }
@keyframes derive2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,-34px) scale(1.18); } }

/* le quadrillage qui glisse derrière la bannière */
.heros .trame {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--trait) 1px, transparent 1px),
                    linear-gradient(90deg, var(--trait) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 70% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, #000 10%, transparent 72%);
  animation: glisse 24s linear infinite;
}
@keyframes glisse { to { background-position: 56px 56px; } }

/* ---------- Le titre qui se lève mot par mot ---------- */
.mot { display: inline-block; }
.js .mot { opacity: 0; transform: translateY(.5em) rotate(1.5deg); }
.js .leve .mot { animation: leve .62s cubic-bezier(.2,.8,.25,1) forwards; }
@keyframes leve { to { opacity: 1; transform: none; } }

/* ---------- Le trait sous les titres de section ---------- */
.oeil::before { transition: width .55s cubic-bezier(.3,.8,.3,1); }
h2 { position: relative; }
.js h2.souligne::after {
  content: ""; display: block; height: 3px; width: 0; background: var(--rouge);
  border-radius: 2px; margin-top: .55rem; animation: souligne .6s .25s cubic-bezier(.3,.8,.3,1) forwards;
}
@keyframes souligne { to { width: 72px; } }

/* ---------- Apparitions dirigées ---------- */
.js .monte--gauche { transform: translateX(-26px); }
.js .monte--droite { transform: translateX(26px); }
.js .monte--zoom   { transform: scale(.94); }
.js .monte--gauche.vu, .js .monte--droite.vu, .js .monte--zoom.vu { transform: none; }

/* ---------- La barre de progression de lecture ---------- */
.progres {
  position: fixed; inset: 0 auto auto 0; height: 3px; width: 100%; z-index: 90;
  background: var(--rouge); transform: scaleX(0); transform-origin: left center;
  pointer-events: none;
}

/* ---------- La barre du haut qui se resserre ---------- */
.tete { transition: padding .25s ease, box-shadow .25s ease, background .25s ease; }
.tete.est-reduite { box-shadow: 0 6px 24px rgba(17,17,20,.08); }

/* ---------- Le bandeau qui défile ---------- */
.defile { overflow: hidden; border-block: 1px solid var(--trait); padding-block: .9rem; }
.defile__piste { display: flex; gap: 2.5rem; width: max-content; animation: defile 34s linear infinite; }
.defile:hover .defile__piste { animation-play-state: paused; }
.defile__mot {
  display: inline-flex; align-items: center; gap: .6rem; white-space: nowrap;
  font-family: var(--code); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--encre-doux);
}
.defile__mot svg { width: 1rem; height: 1rem; color: var(--rouge); }
@keyframes defile { to { transform: translateX(-50%); } }

/* ---------- Le reflet qui traverse les boutons pleins ---------- */
.bouton--plein { position: relative; overflow: hidden; }
.bouton--plein::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 42px;
  left: -60px; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-18deg); pointer-events: none;
  animation: reflet 4.6s 1.4s ease-in-out infinite;
}
@keyframes reflet { 0%, 72%, 100% { left: -60px; } 86% { left: 120%; } }

/* ---------- La carte qui réagit ---------- */
.carte { transition: transform .22s cubic-bezier(.2,.8,.3,1), border-color .22s, box-shadow .22s; }
.carte:hover { box-shadow: 0 18px 42px rgba(17,17,20,.09); }
.carte__ico { transition: transform .25s cubic-bezier(.2,1.4,.4,1), background .25s; }
.carte:hover .carte__ico { transform: translateY(-3px) rotate(-6deg) scale(1.08); }

/* ---------- Les compteurs ---------- */
.chiffre { transition: transform .25s, border-color .25s; }
.chiffre:hover { transform: translateY(-4px); }
.chiffre__n { font-variant-numeric: tabular-nums; }

/* ---------- L'entrée de la page ---------- */
.js body { animation: entree .5s ease both; }
@keyframes entree { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Le parallaxe, là où le navigateur sait le faire ---------- */
@supports (animation-timeline: view()) {
  .parallaxe { animation: glisseh linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  @keyframes glisseh { from { transform: translateY(26px); } to { transform: translateY(-26px); } }
}

/* ---------- Tout s'arrête si le visiteur l'a demandé ---------- */
@media (prefers-reduced-motion: reduce) {
  .heros::before, .heros::after, .heros .trame,
  .defile__piste, .bouton--plein::after, .js body,
  .illu *, .parallaxe { animation: none !important; }
  .illu .t { stroke-dasharray: none; stroke-dashoffset: 0; }
  .illu .flotte1, .illu .flotte2, .illu .flotte3,
  .illu .pousse1, .illu .pousse2, .illu .etape, .illu .source,
  .illu .epingle, .illu .monte-fleche { opacity: 1; }
  .illu .remplit { transform: scaleX(.78); }
  .illu .barre { transform: scaleY(1); }
  .illu .et { opacity: .85; }
  .js .mot { opacity: 1; transform: none; }
  .js h2.souligne::after { width: 72px; animation: none; }
  .carte:hover, .chiffre:hover, .carte:hover .carte__ico { transform: none; }
}

/* Sans JavaScript, rien n'est caché : le dessin est simplement posé. */
html:not(.js) .illu .t { stroke-dasharray: none; stroke-dashoffset: 0; }
html:not(.js) .illu .flotte1, html:not(.js) .illu .flotte2, html:not(.js) .illu .flotte3,
html:not(.js) .illu .pousse1, html:not(.js) .illu .pousse2,
html:not(.js) .illu .etape, html:not(.js) .illu .source,
html:not(.js) .illu .epingle, html:not(.js) .illu .monte-fleche { opacity: 1; }
html:not(.js) .illu .remplit { transform: scaleX(.78); }
html:not(.js) .illu .barre { transform: scaleY(1); }

/* ---------- Un bloc texte + illustration ---------- */
.duo-illu { display: grid; gap: clamp(2rem, 1rem + 4vw, 3.5rem); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 950px) { .duo-illu { grid-template-columns: 1fr 1fr; } }

/* ---------- Les étapes numérotées ---------- */
.etapes { list-style: none; counter-reset: pas; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .9rem; }
.etapes li {
  counter-increment: pas; position: relative; padding-left: 3.1rem;
  padding-block: .45rem;
}
.etapes li::before {
  content: counter(pas, decimal-leading-zero);
  position: absolute; left: 0; top: .35rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 .82rem/1 var(--code); color: var(--rouge);
  border: 1px solid var(--rouge); background: var(--rouge-pale);
  transition: transform .25s cubic-bezier(.2,1.4,.4,1);
}
.etapes li:hover::before { transform: scale(1.12) rotate(-8deg); }
.etapes li b { display: block; font-family: var(--titre); font-size: 1rem; }
.etapes li span { display: block; color: var(--encre-doux); font-size: .92rem; margin-top: .2rem; }
.etapes li::after {
  content: ""; position: absolute; left: 1.1rem; top: 2.8rem; bottom: -.9rem;
  width: 1px; background: var(--trait);
}
.etapes li:last-child::after { display: none; }

/* Les apparitions latérales décalent le bloc de quelques pixels avant de le
   remettre en place. Sans cette coupe, ce décalage dépasse du côté droit et
   fait apparaître une barre de défilement horizontale sur toute la page.
   « clip » coupe en largeur seulement : les ombres et les cartes qui se
   soulèvent restent visibles en hauteur. */
.dedans { overflow-x: clip; }

/* =======================================================================
   PHOTOS
   ======================================================================= */
.photo {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--papier-2); border: 1px solid var(--trait);
  aspect-ratio: 16 / 9;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.js .photo img { transform: scale(1.09); transition: transform 1.3s cubic-bezier(.2,.75,.25,1); }
.js .monte.vu .photo img, .js .photo.vu img { transform: scale(1); }
.photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(17,17,20,.34), transparent 52%);
  opacity: 0; transition: opacity .5s ease;
}
.photo--ombre::after { opacity: 1; }
/* le coin rouge qui se déplie */
.photo::before {
  content: ""; position: absolute; left: 0; bottom: 0; z-index: 2;
  width: 0; height: 5px; background: var(--rouge);
  transition: width .8s .25s cubic-bezier(.3,.8,.3,1);
}
.monte.vu .photo::before, .photo.vu::before { width: 46%; }
.photo:hover img { transform: scale(1.04); }

.photo__legende {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 1.1rem 1.2rem; color: #fff;
  font: 500 .88rem/1.4 var(--texte);
  text-shadow: 0 1px 10px rgba(0,0,0,.5);
}
.photo__etiquette {
  position: absolute; top: .9rem; left: .9rem; z-index: 3;
  background: var(--rouge); color: #fff; border-radius: 999px;
  padding: .32rem .78rem;
  font: 500 .7rem/1 var(--code); letter-spacing: .1em; text-transform: uppercase;
}

/* une photo pleine largeur, en bandeau */
.bandeau-photo { position: relative; overflow: hidden; }
.bandeau-photo img { width: 100%; height: clamp(260px, 42vw, 460px); object-fit: cover; display: block; }
.bandeau-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(17,17,20,.74), rgba(17,17,20,.18) 62%, transparent);
}
.bandeau-photo__texte {
  position: absolute; inset: 0; z-index: 2; display: grid; align-content: center;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
  color: #fff;
}
.bandeau-photo__texte .dedans { width: 100%; }
.bandeau-photo h2, .bandeau-photo p { color: #fff; }
.bandeau-photo p { max-width: 42ch; opacity: .9; margin-top: .9rem; }

/* =======================================================================
   LE LOGO
   ======================================================================= */
/* Le logo porte « FORMATION » à l'intérieur du M|H : en dessous de 56 px
   de haut, cette ligne n'est plus lisible. */
.marque__logo { display: block; height: clamp(50px, 4vw, 62px); width: auto; }
.marque__logo--blanc { display: none; }
.pied .marque__logo { height: 54px; display: none; }
.pied .marque__logo--blanc { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tete .marque__logo { display: none; }
  :root:not([data-theme="light"]) .tete .marque__logo--blanc { display: block; }
}
:root[data-theme="dark"] .tete .marque__logo { display: none; }
:root[data-theme="dark"] .tete .marque__logo--blanc { display: block; }

/* La barre du haut se resserre quand on descend : le logo garde sa place,
   la page gagne de la hauteur de lecture. */
.tete__rang { transition: padding-block .25s ease; }
.tete.est-reduite .tete__rang { padding-block: .35rem; }
.tete.est-reduite .marque__logo { height: clamp(40px, 3vw, 48px); }
.marque__logo { transition: height .25s ease; }

/* Un trait qui porte sa propre animation perd celle qui le dessine : la
   règle « animation » est remplacée en entier, donc « stroke-dashoffset »
   reste à 1 et le trait ne s'affiche jamais. On rend donc ces traits-là
   pleins dès le départ — ils sont animés autrement. */
.illu .monte-fleche, .illu .barre, .illu .o1, .illu .o2,
.illu .onde-sol .s1, .illu .onde-sol .s2,
.illu rect.pousse1, .illu rect.pousse2, .illu path.pousse1, .illu path.pousse2 {
  stroke-dasharray: none; stroke-dashoffset: 0;
}
