/* Les pages de la formation AI 101 (/formation/…), chargée APRÈS braise.css et app.css. Lot 2 :
 * la mise en page seulement ; le lot 3 y ajoute les animations des badges et des illustrations.
 * Jetons uniquement, budget 180 lignes non vides (design/test/systeme.test.ts). */
.module { padding-block-end: var(--espace-5); }
.module h1 { margin: 0; font-size: clamp(var(--taille-titre), 5vw, var(--taille-hero)); line-height: var(--interligne-titre); }
.module h2, .carte h2 { margin: var(--espace-5) 0 0; font-size: var(--taille-titre); line-height: var(--interligne-titre); }
.module h3 { margin: var(--espace-4) 0 0; font-size: var(--taille-intertitre); }
.carte > h2:first-child, .quiz > h2, .partage > h2 { margin-top: 0; }
.module p, .module li { line-height: var(--interligne-texte); }
.module li { min-width: 0; }
.barre-titre { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.module ul, .module ol:not(.jalons) { display: grid; gap: var(--espace-2); margin: var(--espace-3) 0 0; padding-left: var(--espace-4); }
.module .copiable { margin-block: var(--espace-3); }
.module-jauge { position: sticky; top: calc(3.5rem + env(safe-area-inset-top, 0px)); z-index: var(--couche-barre); }
.illustration { margin: 0; }
.illustration svg { display: block; width: 100%; height: auto; max-height: 15rem; border-radius: var(--rayon-grand); background: var(--fond-discret); }
.schema { display: grid; gap: var(--espace-2); margin: var(--espace-4) 0; }
.feuille-svg { display: block; width: 100%; max-width: 28rem; height: auto; margin-inline: auto; }
.feuille-lecture { fill: var(--encre-marque); opacity: .12; transition: height .4s ease-in-out; }
.feuille-ligne { stroke-dasharray: 1; transition: translate .5s ease-in-out; }
.anim-trace { animation: tracer .5s ease-out both; }
.feuille-commandes { justify-content: center; align-items: center; }
.feuille-compteur { flex-basis: 100%; text-align: center; font-family: var(--police-chiffres); font-size: var(--taille-petite); color: var(--encre-discrete); }
.feuille-statut { margin: 0; min-height: 1.5em; text-align: center; font-size: var(--taille-petite); }
.schema figcaption { font-size: var(--taille-petite); color: var(--encre-discrete); }
.module .jalons { flex-wrap: wrap; justify-content: flex-start; margin-block: var(--espace-4); }
/* Les écrans d'un module : un seul visible (formation.mjs), la barre de flèches collée en bas.
 * Sans JS, ils se lisent à la suite ; avec, les suivants restent cachés jusqu'au montage. */
[data-js] [data-ecrans]:not([data-pret]) > .ecran:not(#ecran-1) { display: none; }
[data-ecrans] { overflow-x: clip; }
.ecran { scroll-margin-top: 5rem; }
.ecran[data-sens] { animation: entrer .35s ease-out both; }
.ecran[data-sens="arriere"] { --de-ecran: -1.5rem; }
@keyframes entrer { from { opacity: 0; translate: var(--de-ecran, 1.5rem) 0; } }
.ecran { --pile-ecart: var(--espace-4); }
.ecran > :is(h2, p, ul, ol, .schema) { margin: 0; }
.ecran :is(h1, h2)[tabindex="-1"]:focus { outline: none; }
.ecran-visuel { margin: 0; }
.ecran-visuel svg { display: block; width: 100%; max-width: 22rem; max-height: 11rem; margin-inline: auto; border-radius: var(--rayon-grand); background: var(--fond-discret); }
.ecrans-nav { position: sticky; bottom: 0; z-index: var(--couche-barre); display: flex; align-items: center; justify-content: space-between; gap: var(--espace-3); padding-block: var(--espace-3) calc(var(--espace-3) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--bordure); background: var(--fond-page); }
.ecrans-nav .bouton { min-width: 3.5rem; min-height: 44px; font-size: var(--taille-intertitre); }
.ecrans-nav .bouton:disabled { opacity: .35; cursor: default; }
.ecrans-progression { display: grid; justify-items: center; gap: var(--espace-1); }
.ecrans-points { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--espace-1); }
.ecrans-points i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--bordure-forte); transition: background .3s, scale .3s; }
.ecrans-points i[data-vu] { background: var(--encre-marque); }
.ecrans-points i[data-vu]:has(+ i:not([data-vu])), .ecrans-points i[data-vu]:last-child { scale: 1.35; }
.ecrans-compteur { font-family: var(--police-chiffres); font-size: var(--taille-petite); color: var(--encre-discrete); }
.hindsight-module p { margin: 0; }
.hindsight-module p + p { margin-top: var(--espace-3); }
/* Le hub : les sept badges flottent sous le titre du héros (à sa droite sur grand écran), puis
 * 7 cartes, une, deux ou trois colonnes. */
.heros-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--espace-3); max-width: 17rem; margin: 0; padding: 0; list-style: none; }
.heros-badges .module-badge { animation: flotter 6s ease-in-out infinite both; }
.heros-badges .module-badge svg { width: 3.25rem; height: 3.25rem; }
.heros-badges li:nth-child(2n) .module-badge { animation-delay: -2s; }
.heros-badges li:nth-child(3n) .module-badge { animation-delay: -4s; }
@keyframes flotter { 50% { translate: 0 -.4rem; } }
.modules { grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
.module-carte { position: relative; display: grid; gap: var(--espace-2); justify-items: start; height: 100%; }
.module-carte .module-etat { position: absolute; top: var(--espace-4); right: var(--espace-4); }
.module-numero { font-family: var(--police-chiffres); font-size: var(--taille-mention); color: var(--encre-discrete); }
.module-badge { display: inline-block; color: var(--texte-marque); }
.module-badge svg { display: block; width: 3.5rem; height: 3.5rem; }
.module-badge-grand svg { width: 6rem; height: 6rem; }
.module-badge .badge-fond { fill: var(--fond-marque); }
[data-etat="verrouille"] .module-badge { opacity: .35; filter: grayscale(1); }
[data-etat="fait"] .module-badge { filter: drop-shadow(0 0 .6rem var(--encre-marque)); }
.module-carte[data-deverrouille] { animation: deverrouiller 1.4s ease-out .4s both; }
.module-carte[data-deverrouille] .module-badge { animation: debloquer 1.4s ease-out .4s both; }
.anim-deverrouiller { animation: deverrouiller 1.4s ease-out; }
.anim-obtenu { animation: sceau .9s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes deverrouiller { 0% { outline: .2rem solid var(--encre-marque); outline-offset: 0; } 35% { scale: 1.04; } 100% { outline: .2rem solid transparent; outline-offset: .8rem; } }
@keyframes debloquer { from { opacity: .35; filter: grayscale(1); } }
@keyframes sceau { from { opacity: 0; scale: .3; rotate: -25deg; } }
.diplomes { margin: 0; color: var(--encre-discrete); }
.compteur-modules { margin: 0; }
.bravo h1 { margin: 0; font-size: clamp(var(--taille-hero), 7vw, var(--taille-affichage)); line-height: var(--interligne-titre); text-wrap: balance; }
.bravo-badges { --grille-min: 4rem; margin: 0; padding: 0; list-style: none; justify-items: center; }
.offres-formation { --grille-min: 18rem; align-items: stretch; }
/* La boîte à outils : les cartes des fiches et leur état, le verrou d'une fiche fermée. */
.fiches { --grille-min: 16rem; margin: 0; padding: 0; list-style: none; }
.fiche-carte { display: grid; gap: var(--espace-2); align-content: start; justify-items: start; height: 100%; }
.fiche-carte[data-etat="verrouille"] .carte-titre { color: var(--encre-discrete); }
[data-outil][data-etat="verrouille"] .copiable, [data-outil]:not([data-etat="verrouille"]) [data-verrou] { display: none; }
.outil-prompt code { white-space: pre-wrap; }
/* Le quiz : une question par bloc, la réponse juste ou fausse dite en couleur ET en texte. */
.quiz { margin-top: var(--espace-5); }
.quiz-etat { margin: 0; font-weight: var(--graisse-forte); }
.quiz-etat:empty, .quiz .rangee:has(> [hidden]:only-child) { display: none; }
.quiz .reponses { --reponses-colonnes: 1; margin-top: var(--espace-2); }
.question { display: grid; gap: var(--espace-2); margin: 0; padding: 0; border: 0; }
.question legend { padding: 0; font-weight: var(--graisse-forte); }
.question-retour { margin: 0; padding: var(--espace-2) var(--espace-3); border-radius: var(--rayon); font-size: var(--taille-petite); animation: apparaitre .3s ease-out both; }
.question-retour[data-etat="juste"] { background: var(--fond-succes); color: var(--texte-succes); }
.question-retour[data-etat="faux"] { background: var(--fond-erreur); color: var(--texte-erreur); }
.question[data-etat="juste"] .reponse[data-juste] { background: var(--fond-succes); color: var(--texte-succes); animation: obtenu .5s ease-out; }
.question[data-etat="juste"] .reponse:not([data-juste]) { opacity: .5; }
.question[data-etat="faux"] .reponse[data-mienne] { background: var(--fond-erreur); border-color: var(--encre-erreur); color: var(--texte-erreur); animation: secouer .4s ease-in-out; }
.question[data-etat="faux"] .reponse[data-mienne] .reponse-lettre { background: var(--encre-erreur); color: var(--fond-page); }
.quiz-resultat { display: flex; flex-direction: column; align-items: center; gap: var(--espace-2); padding: var(--espace-4); border-radius: var(--rayon-grand); background: var(--fond-discret); text-align: center; animation: apparaitre .4s ease-out both; }
.quiz-resultat p { margin: 0; font-weight: var(--graisse-forte); }
@keyframes apparaitre { from { opacity: 0; translate: 0 -.25rem; } }
@keyframes secouer { 20%, 60% { translate: -.3rem 0; } 40%, 80% { translate: .3rem 0; } }
@keyframes obtenu { 40% { scale: 1.03; } }
.partage { margin-top: var(--espace-5); }
.partage .saisie { width: 100%; resize: none; }
.partage .partage-lien { min-height: 0; }
.module-nav { margin-top: var(--espace-5); }
@media (max-width: 47.99rem) {
  .module-nav { flex-direction: column; align-items: stretch; }
  .module-nav .bouton, [data-reprendre] { white-space: normal; text-align: center; }
  .barre-titre { font-size: var(--taille-petite); }
  .barre-prefixe { display: none; }
}
@media (min-width: 48rem) {
  .modules { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .modules { grid-template-columns: repeat(3, 1fr); }
  .heros-cadre { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--espace-6); }
  .heros-badges { grid-column: 2; grid-row: 1 / span 4; align-self: center; justify-self: end; max-width: 23rem; }
  .heros-badges .module-badge svg { width: 4.5rem; height: 4.5rem; }
}
/* Les illustrations : SVG inline, couleurs par jetons. L'état de base est l'image finale, pleine :
 * sous prefers-reduced-motion, plus aucune animation et l'image reste lisible. */
.ill-papier { fill: var(--fond-carte); stroke: var(--bordure-forte); stroke-width: 2; }
.ill-trait { fill: none; stroke: var(--bordure-forte); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill-ligne { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.ill-texte { font: var(--graisse-moyenne) 11px var(--police); fill: var(--encre-discrete); }
[class*="anim-"] { transform-box: fill-box; transform-origin: center; }
.anim-remplir { stroke-dasharray: 1; animation: remplir 6s ease-in-out infinite both; }
.anim-pulser { animation: pulser 3s ease-in-out infinite both; }
.anim-tamponner { animation: tamponner 5s ease-out infinite both; }
.anim-glisser { animation: glisser 5s ease-in-out infinite both; }
.anim-defiler { animation: defiler 1s linear infinite; }
.anim-tourner { animation: tourner 4s linear infinite; }
.anim-allumer { animation: allumer 3.6s ease-in-out infinite both; }
.anim-effacer { animation: effacer .5s ease-in forwards; }
@keyframes remplir { 0% { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } 12%, 85% { stroke-dashoffset: 0; } 95%, 100% { stroke-dashoffset: -1; opacity: 1; } }
@keyframes pulser { 0%, 40%, 100% { scale: 1; } 20% { scale: 1.3; } }
@keyframes tamponner { 0% { scale: 1.25; opacity: 0; } 10%, 88% { scale: 1; opacity: 1; } 100% { opacity: 0; } }
@keyframes glisser { 0% { translate: var(--de); opacity: 0; } 12% { opacity: 1; } 40%, 85% { translate: 0 0; opacity: 1; } 100% { opacity: 0; } }
@keyframes defiler { to { stroke-dashoffset: -8; } }
@keyframes tourner { to { rotate: 1turn; } }
@keyframes allumer { 0%, 50%, 100% { opacity: .35; } 15%, 35% { opacity: 1; } }
@keyframes tracer { from { stroke-dashoffset: 1; } }
@keyframes effacer { to { opacity: 0; translate: 0 -.5rem; } }
/* Les confettis de fin : posés par confettis.mjs, jamais sous prefers-reduced-motion. */
.confettis { position: fixed; inset: 0; z-index: var(--couche-notification); overflow: hidden; pointer-events: none; }
.confettis i { position: absolute; top: 0; left: var(--x); width: .5rem; height: .85rem; border-radius: var(--rayon-petit); background: var(--teinte); animation: confetti-tombe 3.5s var(--delai) cubic-bezier(.25, .6, .45, 1) both; }
@keyframes confetti-tombe { from { transform: translate(0, -10vh) rotate(0); } to { transform: translate(var(--derive), 110vh) rotate(var(--rotation)); } }
@media (prefers-reduced-motion: reduce) {
  [class*="anim-"], .ecran, .heros-badges .module-badge, .module-carte[data-deverrouille], .module-carte[data-deverrouille] .module-badge { animation: none !important; }
}
