/* Mon Coach de Français — DA « La Copie » (copie d'examen annotée)
   Palette : papier #fbf9f4 · encre #201d19 · lignes #c9d5ea · bleu Bic #2547c9
   sémantique : rouge correcteur #cf3a2c · vert admis #2c8a57
   Typo cible : Bricolage Grotesque (titres) + Atkinson Hyperlegible (texte) + Caveat (annotations)
   — à auto-héberger au déploiement (jamais de CDN Google Fonts : CNIL). */

/* Polices auto-hébergées (OFL) — aucun appel externe */
@font-face{font-family:'Bricolage Grotesque';src:url('/assets/fonts/bricolage-grotesque-700-800.woff2') format('woff2');
  font-weight:700 800;font-style:normal;font-display:swap}
@font-face{font-family:'Atkinson Hyperlegible';src:url('/assets/fonts/atkinson-hyperlegible-400.woff2') format('woff2');
  font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Atkinson Hyperlegible';src:url('/assets/fonts/atkinson-hyperlegible-700.woff2') format('woff2');
  font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:'Atkinson Hyperlegible';src:url('/assets/fonts/atkinson-hyperlegible-400-italic.woff2') format('woff2');
  font-weight:400;font-style:italic;font-display:swap}
@font-face{font-family:'Caveat';src:url('/assets/fonts/caveat-600.woff2') format('woff2');
  font-weight:600;font-style:normal;font-display:swap}

:root{
  --papier:#fbf9f4; --feuille:#fffdf8; --encre:#201d19; --ligne:#c9d5ea;
  --bic:#2547c9; --rouge:#cf3a2c; --vert:#2c8a57; --gris:#6b675f;
  --titres:'Bricolage Grotesque','Segoe UI',system-ui,sans-serif;
  --texte:'Atkinson Hyperlegible','Segoe UI',system-ui,sans-serif;
  --manuscrit:'Caveat','Segoe Print','Comic Sans MS',cursive;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--papier);color:var(--encre);font-family:var(--texte);
  font-size:17px;line-height:1.6}
.acces-rapide{position:absolute;left:-999px}
.acces-rapide:focus{left:8px;top:8px;background:var(--bic);color:#fff;padding:8px 14px;z-index:10}

/* ——— En-tête */
.entete{display:flex;align-items:baseline;justify-content:space-between;gap:16px;
  padding:18px clamp(16px,4vw,48px);border-bottom:2px solid var(--encre)}
.marque{font-family:var(--titres);font-weight:800;font-size:1.35rem;color:var(--encre);
  text-decoration:none;letter-spacing:-.02em}
.marque-mon,.marque-de{color:var(--bic)}
.nav-haut a{color:var(--encre);text-decoration:none;margin-left:22px;font-weight:600;
  border-bottom:2px solid transparent;padding-bottom:2px}
.nav-haut a:hover{border-bottom-color:var(--bic)}

/* ——— La copie (feuille d'examen) */
.scene{max-width:1080px;margin:0 auto;padding:clamp(20px,4vw,56px) clamp(14px,3vw,32px)}
.copie{position:relative;background:var(--feuille);border:1px solid #e6e1d5;
  box-shadow:0 2px 0 #e6e1d5,0 14px 34px rgba(32,29,25,.08);
  background-image:repeating-linear-gradient(to bottom,transparent 0,transparent 31px,var(--ligne) 31px,var(--ligne) 32px);
  padding:34px 34px 40px 96px}
.copie::before{content:'';position:absolute;top:0;bottom:0;left:68px;width:2px;background:var(--rouge);opacity:.65}
.copie-entete{display:flex;flex-wrap:wrap;gap:8px 28px;border-bottom:2px solid var(--encre);
  padding-bottom:10px;margin-bottom:22px;font-size:.92rem}
.copie-entete b{font-family:var(--titres);text-transform:uppercase;letter-spacing:.06em;font-size:.8rem}
.copie-entete .champ{border-bottom:1px dotted var(--gris);min-width:110px;display:inline-block}
.copie h1{font-family:var(--titres);font-weight:800;letter-spacing:-.03em;
  font-size:clamp(1.7rem,4.4vw,2.7rem);line-height:1.12;margin:.2em 0 .35em}
.copie h1 .souligne{box-shadow:inset 0 -0.34em 0 rgba(37,71,201,.18)}
.sous-titre{font-size:1.06rem;max-width:56ch;margin:0 0 26px;color:#3d3a33}

/* ——— La dictée qui s'écrit (pièce de bravoure) */
.dictee-scene{margin:0 0 14px;font-family:var(--manuscrit);font-size:1.5rem;color:var(--encre)}
.dictee-etiquette{font-size:1.05rem;color:var(--bic);display:block;transform:rotate(-2deg);margin-bottom:2px}
#dictee{position:relative;display:inline-block;line-height:1.5}
.dictee-lettre{opacity:0}
.dictee-mot{position:relative;white-space:nowrap}
.dictee-plume{position:absolute;left:0;top:0;width:7px;height:7px;border-radius:50%;
  background:var(--bic);opacity:.9;transition:transform .05s linear;will-change:transform}
.dictee-faute::after{content:'';position:absolute;left:-2px;right:-2px;top:56%;height:2px;
  background:var(--rouge);transform:scaleX(0);transform-origin:left center;transition:transform .3s ease-out}
.dictee-correction{position:absolute;left:8%;top:-1.05em;color:var(--rouge);font-size:.82em;
  transform:rotate(-7deg) scale(0);transform-origin:bottom left;transition:transform .28s cubic-bezier(.2,1.6,.4,1) .25s}
.dictee-corrigee .dictee-faute::after{transform:scaleX(1)}
.dictee-corrigee .dictee-correction{transform:rotate(-7deg) scale(1)}

/* Soulignement du titre qui se trace */
.copie h1 .souligne{background:linear-gradient(to top,rgba(37,71,201,.18) .34em,transparent .34em)
  no-repeat left bottom / 0% 100%;box-shadow:none;animation:tracer-souligne .7s ease-out .5s forwards}
@keyframes tracer-souligne{to{background-size:100% 100%}}

/* Annotation manuscrite du coach dans la marge */
.annotation{position:absolute;left:6px;width:56px;font-family:var(--manuscrit);
  color:var(--bic);font-size:1.05rem;line-height:1.15;transform:rotate(-4deg);text-align:center}
.annotation--libre{position:static;width:auto;transform:rotate(-2deg);display:inline-block;
  font-size:1.25rem;margin:4px 0}

/* ——— Quiz */
.quiz-etat{display:flex;justify-content:space-between;align-items:center;gap:12px;
  font-family:var(--titres);font-weight:700;font-size:.9rem;text-transform:uppercase;
  letter-spacing:.08em;margin-bottom:14px}
.quiz-barre{flex:1;height:6px;background:#eee9dc;margin:0 8px}
.quiz-barre i{display:block;height:100%;background:var(--bic);width:0;transition:width .35s ease}
.question{font-size:1.28rem;font-weight:600;margin:10px 0 18px}
.question .trou{border-bottom:2px solid var(--encre);display:inline-block;min-width:88px}
.choix{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.choix button{display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  font:inherit;font-size:1.05rem;background:transparent;border:1.5px solid #d8d2c2;
  padding:11px 14px;cursor:pointer;color:var(--encre);border-radius:3px}
.choix button:hover{border-color:var(--bic);background:rgba(37,71,201,.05)}
.choix .lettre{font-family:var(--titres);font-weight:800;color:var(--bic)}
.choix button.juste{border-color:var(--vert);background:rgba(44,138,87,.08)}
.choix button.faux{border-color:var(--rouge);background:rgba(207,58,44,.06);text-decoration:line-through}
.choix button:disabled{cursor:default}
.mot-du-coach{margin-top:16px;font-family:var(--manuscrit);font-size:1.3rem;color:var(--bic);
  transform:rotate(-.6deg);clip-path:inset(-20% 100% -20% 0);animation:ecrire .55s ease-out forwards}
.mot-du-coach.faux{color:var(--rouge)}
@keyframes ecrire{to{clip-path:inset(-20% -2% -20% 0)}}

/* Coche dessinée sur la bonne réponse */
.coche{width:20px;height:20px;flex:none;margin-left:auto}
.coche path{stroke:var(--vert);stroke-width:3;fill:none;stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:24;stroke-dashoffset:24;animation:dessiner-coche .4s ease-out .1s forwards}
@keyframes dessiner-coche{to{stroke-dashoffset:0}}
.quiz-suite{margin-top:20px}

/* ——— Test blanc : chrono, document à lire, sélection, correction */
.chrono{font-variant-numeric:tabular-nums;color:var(--bic)}
.chrono--alerte{color:var(--rouge)}
.doc-lu{background:#fff;border:1.5px solid #d8d2c2;padding:16px 18px;margin:6px 0 16px;
  border-radius:3px;font-size:1.02rem;box-shadow:2px 3px 0 rgba(32,29,25,.06)}
.choix button.retenu{border-color:var(--bic);background:rgba(37,71,201,.09)}
.doc-audio{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.btn--ecoute:disabled{background:#8a94b8;cursor:default}
.ecoute-etat{font-family:var(--manuscrit);font-size:1.15rem;color:var(--bic)}
.correction{padding-left:1.2em;margin:10px 0}
.correction-item{margin:0 0 18px;padding-bottom:12px;border-bottom:1px dashed #d8d2c2}
.correction-item .correction-q{font-weight:600;margin:.2em 0}
.correction-item .correction-rep{margin:.2em 0}
.correction-item.ok .correction-rep{color:var(--vert)}
.correction-item.ko .correction-rep{color:var(--rouge)}
.correction-item .mot-du-coach{margin-top:4px;font-size:1.15rem}
#consignes ul{max-width:60ch}
#consignes li{margin:.35em 0}

/* Boutons : aplat bleu Bic, angles francs */
.btn{display:inline-block;background:var(--bic);color:#fff;border:none;font:inherit;
  font-weight:700;padding:13px 26px;cursor:pointer;border-radius:3px;text-decoration:none}
.btn:hover{background:#1d3aa6}
.btn--fantome{background:transparent;color:var(--bic);border:2px solid var(--bic)}
.btn--fantome:hover{background:rgba(37,71,201,.07)}

/* ——— Résultat */
.tampon{display:inline-block;font-family:var(--titres);font-weight:800;text-transform:uppercase;
  letter-spacing:.14em;color:var(--vert);border:3px double var(--vert);padding:10px 22px;
  transform:rotate(-6deg);font-size:1.5rem;mix-blend-mode:multiply;margin:6px 0 18px;
  animation:tamponner .38s cubic-bezier(.2,1.4,.4,1) forwards;opacity:0}
@keyframes tamponner{
  from{transform:rotate(-14deg) scale(2.1);opacity:0}
  55%{opacity:1}
  to{transform:rotate(-6deg) scale(1);opacity:1}
}
.tampon--attention{color:var(--rouge);border-color:var(--rouge)}
.niveaux-detail{display:grid;gap:8px;margin:18px 0;max-width:420px}
.niveau-ligne{display:grid;grid-template-columns:44px 1fr 56px;align-items:center;gap:10px}
.niveau-ligne .jauge{height:10px;background:#eee9dc}
.niveau-ligne .jauge i{display:block;height:100%;background:var(--bic);width:0;
  transition:width .7s cubic-bezier(.25,.9,.3,1)}
.niveau-ligne b{font-family:var(--titres)}
.et-maintenant{position:relative;background:rgba(37,71,201,.055);padding:14px 18px 12px;margin:26px 0 20px;max-width:62ch}
.et-maintenant::before{content:'Le coach :';font-family:var(--manuscrit);color:var(--bic);
  font-size:1.25rem;position:absolute;top:-16px;left:10px;transform:rotate(-3deg)}

/* États clavier et actifs */
a:focus-visible,button:focus-visible,input:focus-visible{outline:2.5px solid var(--bic);outline-offset:2px}
.btn:active{transform:translateY(1px)}
.plan-form input[type=email]:focus-visible{border-color:var(--bic);outline-offset:0}

/* Capture email */
.plan-form{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.plan-form input[type=email]{flex:1;min-width:230px;font:inherit;padding:12px 14px;
  border:1.5px solid var(--encre);border-radius:3px;background:#fff}
.plan-note{font-size:.85rem;color:var(--gris);max-width:60ch}

/* ——— Section « ce que dit la loi » : BENTO plein, jamais de carte orpheline */
.section-titre{font-family:var(--titres);font-weight:800;letter-spacing:-.02em;
  font-size:clamp(1.4rem,3vw,2rem);margin:56px 0 6px}
.section-source{font-size:.88rem;color:var(--gris);margin:0 0 20px}
.bento{display:grid;gap:14px;grid-template-columns:repeat(3,1fr)}
.bento article{border:1.5px solid var(--encre);background:var(--feuille);padding:18px 20px;border-radius:3px;
  opacity:0;transform:translateY(14px);transition:opacity .5s ease-out,transform .5s ease-out}
.bento article.visible{opacity:1;transform:none}
@media (prefers-reduced-motion: reduce){.bento article{opacity:1;transform:none;transition:none}}
.bento .gros-niveau{font-family:var(--titres);font-weight:800;font-size:2.4rem;color:var(--bic);line-height:1}
.bento h3{font-family:var(--titres);margin:.5em 0 .3em;font-size:1.02rem}
.bento p{margin:.3em 0;font-size:.94rem}
.bento .avertit{color:var(--rouge);font-weight:600}
.bento a{color:var(--bic)}
@media(max-width:860px){.bento{grid-template-columns:1fr 1fr}}
@media(max-width:560px){
  .bento{grid-template-columns:1fr}
  .copie{padding:24px 18px 30px 58px}
  .copie::before{left:40px}
  .annotation{display:none}
  .entete{flex-direction:column;gap:6px}
  .nav-haut a{margin:0 18px 0 0}
}

/* ——— Pied */
.pied{border-top:2px solid var(--encre);margin-top:70px;padding:26px clamp(16px,4vw,48px);
  font-size:.86rem;color:var(--gris)}
.pied a{color:var(--bic)}
.pied-independance{max-width:88ch}

/* Pages légales */
.page-simple{max-width:820px;margin:0 auto;padding:36px clamp(14px,3vw,32px)}
.page-simple h1{font-family:var(--titres);letter-spacing:-.02em}
.page-simple h2{font-family:var(--titres);margin-top:1.6em}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .quiz-barre i,.niveau-ligne .jauge i{transition:none}
  .mot-du-coach{clip-path:none;animation:none}
  .coche path{stroke-dashoffset:0;animation:none}
  .tampon{animation:none;opacity:1}
  .copie h1 .souligne{animation:none;background-size:100% 100%}
}
