/* Évaluation MathsMDE — identité « copie d'élève » : papier Seyès, encre bleue, correction au stylo rouge.
   Polices auto-hébergées (SIL OFL) : Lexend (texte, conçue pour la lisibilité), Caveat (annotations au stylo). */
@font-face{font-family:"Lexend";src:url(fonts/lexend-latin-400-normal.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Lexend";src:url(fonts/lexend-latin-700-normal.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:"Caveat";src:url(fonts/caveat-latin-600-normal.woff2) format("woff2");font-weight:600;font-style:normal;font-display:swap}

:root{
  --papier:#fdfdff; --carreau:#eceefc; --reglure:#d6daf7;
  --encre:#17246b; --encre-doux:#4a5596; --texte:#1a2040;
  --stylo:#c62d27; --marge:#e8575a; --surligneur:#ffe45c;
  --rouge:#c62d27; --orange:#c76a00; --vert:#16794f; --bleu:#2745c9;
  --fond-bande:#fdfdff; --trait:#c9cdf0;
  --marge-x:44px; --grille:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Cpath fill='%23eceefc' d='M0 0h32v1H0zM0 8h32v1H0zM0 16h32v1H0zM0 24h32v1H0z'/%3E%3Cpath fill='%23d6daf7' d='M0 0h32v1H0z'/%3E%3Cpath fill='%23eceefc' d='M0 0h1v32H0z'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme:dark){.barre-haut .logo,.connexion .logo{filter:drop-shadow(0 0 2px rgba(170,182,255,.95))}}
@media (prefers-color-scheme:dark){:root{
  --papier:#14183a; --carreau:#1a1f4d; --reglure:#262c66;
  --encre:#aab6ff; --encre-doux:#8a95d8; --texte:#e9ecff;
  --stylo:#ff7a70; --marge:#ff6b63; --surligneur:#6b5a00;
  --rouge:#ff7a70; --orange:#ffb04d; --vert:#5fd59f; --bleu:#8fa5ff;
  --fond-bande:#14183a; --trait:#303778; --grille:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Cpath fill='%231a1f4d' d='M0 0h32v1H0zM0 8h32v1H0zM0 16h32v1H0zM0 24h32v1H0z'/%3E%3Cpath fill='%23262c66' d='M0 0h32v1H0z'/%3E%3Cpath fill='%231a1f4d' d='M0 0h1v32H0z'/%3E%3C/svg%3E");
}}
*{box-sizing:border-box}
/* Fond « papier à carreaux » : UNE tuile SVG (traits nets) posée sur la racine <html>.
   Avant : trois dégradés de 1 px sur <body>, que certains navigateurs n'affichaient plus (zoom fractionnaire,
   repeinture après un changement de contenu), d'où un fond qui disparaissait par moments. */
html{-webkit-text-size-adjust:100%;min-height:100%;background-color:var(--papier);background-image:var(--grille);background-size:32px 32px;background-repeat:repeat}
body{margin:0;min-height:100vh;font-family:"Lexend",system-ui,sans-serif;font-size:1rem;line-height:1.7;color:var(--texte);background:transparent}
a{color:var(--encre)}
:focus-visible{outline:3px solid var(--bleu);outline-offset:3px;border-radius:3px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---- bandeau haut ---- */
.barre-haut{display:flex;align-items:center;gap:18px;padding:10px 24px;background:var(--fond-bande);border-bottom:2px solid var(--encre)}
.barre-haut .logo{height:58px;width:auto;margin:-8px 0}
.barre-haut .nom{color:var(--encre);font-size:1.1rem;margin-right:auto}
.barre-haut .nom b{font-weight:700}
.barre-haut .nom span{font-weight:400;color:var(--encre-doux)}
.barre-haut nav{display:flex;gap:6px;flex-wrap:wrap}
.barre-haut nav a{color:var(--encre);text-decoration:none;padding:6px 12px;border-radius:4px}
.barre-haut nav a:hover{background:var(--carreau);text-decoration:underline;text-decoration-color:var(--stylo);text-decoration-thickness:2px;text-underline-offset:4px}
.barre-haut nav a[aria-current=page]{text-decoration:underline;text-decoration-color:var(--stylo);text-decoration-thickness:3px;text-underline-offset:5px;font-weight:700}

/* ---- la page : marge rouge à gauche, contenu à droite ---- */
.page{position:relative;max-width:1120px;margin:0 auto;min-height:calc(100vh - 66px)}
.page::before{content:"";position:absolute;top:0;bottom:0;left:var(--marge-x);width:2px;background:var(--marge);opacity:.85}
.contenu{max-width:900px;margin-left:calc(var(--marge-x) + 34px);padding:28px 22px 80px 0}
.page.large{max-width:1360px}
.page.large .contenu{max-width:none;padding-right:28px}
@media (max-width:640px){:root{--marge-x:14px}.contenu{margin-left:calc(var(--marge-x) + 16px);padding-right:14px}
  .barre-haut{flex-wrap:wrap;gap:4px 10px;padding:8px 12px}.barre-haut .logo{height:46px;margin:-6px 0}.barre-haut .nom span{display:none}
  .barre-haut nav{width:100%;gap:0;margin-left:-8px}.barre-haut nav a{padding:4px 6px;font-size:.88rem}
  .page{min-height:calc(100vh - 90px)}.appreciation .stylo{font-size:1.9rem}.exercice{grid-template-columns:2.2rem 1fr}.exercice>.numero{font-size:2.6rem;padding-right:6px}}

h1{font-size:2rem;line-height:1.2;margin:.2em 0 .5em;color:var(--encre);font-weight:700}
h2{font-size:1.45rem;line-height:1.25;margin:0 0 .6em;color:var(--encre);font-weight:700}
h3{font-size:1.1rem;margin:1em 0 .3em;color:var(--encre)}
.titre-regle{display:inline-block;text-decoration:underline;text-decoration-color:var(--stylo);text-decoration-thickness:3px;text-underline-offset:7px}
p{max-width:68ch}
.petit{font-size:.9rem;color:var(--encre-doux)}
.stylo{font-family:"Caveat","Segoe Print","Bradley Hand",cursive;font-weight:600;color:var(--stylo);line-height:1.15}
mark,.surligne{background:linear-gradient(transparent 12%,var(--surligneur) 12%,var(--surligneur) 88%,transparent 88%);color:inherit;padding:0 .2em}

/* ---- boutons ---- */
.btn{display:inline-block;font:inherit;font-weight:700;background:var(--encre);color:var(--papier);border:2px solid var(--encre);border-radius:4px;padding:9px 18px;cursor:pointer;text-decoration:none;line-height:1.3}
.btn:hover{background:var(--encre-doux);border-color:var(--encre-doux)}
.btn:active{transform:translateY(1px)}
.btn.sec{background:transparent;color:var(--encre)}
.btn.sec:hover{background:var(--carreau)}
.btn:disabled{opacity:.5;cursor:default}
.actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0 0}

/* ---- formulaires ---- */
label{display:block;margin:.8em 0}
input[type=text],input[type=email],input[type=password],select{width:100%;font:inherit;color:inherit;background:var(--papier);border:2px solid var(--trait);border-radius:4px;padding:8px 10px}
input[type=text]:focus,input[type=email]:focus,input[type=password]:focus,select:focus{border-color:var(--encre)}
.alerte{background:rgba(198,45,39,.1);border-left:5px solid var(--stylo);padding:10px 14px;color:var(--texte)}

/* ---- accueil élève ---- */
.niveaux{display:flex;flex-wrap:wrap;gap:6px 22px;margin:0 0 20px;border-bottom:2px solid var(--trait)}
.niveaux a{color:var(--encre);text-decoration:none;padding:6px 2px 8px;margin-bottom:-2px;border-bottom:3px solid transparent;font-weight:700}
.niveaux a:hover{border-bottom-color:var(--trait)}
.niveaux a[aria-current=page]{border-bottom-color:var(--stylo)}
.appreciation{display:flex;flex-wrap:wrap;gap:12px 28px;align-items:center;margin:6px 0 34px}
.appreciation .stylo{font-size:2.3rem;margin:0;flex:1 1 380px;max-width:30ch;animation:ecrire 1.3s steps(40,end) .15s both}
@keyframes ecrire{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
.chapitre{margin:0 0 44px}
.chapitre-corps{display:flex;flex-wrap:wrap;gap:18px 30px;align-items:center}
.chapitre .radar{flex:0 1 270px;min-width:220px;color:var(--encre)}
.competences{flex:1 1 340px;list-style:none;margin:0;padding:0}
.competence{display:grid;grid-template-columns:1.6em 1fr auto;gap:2px 8px;align-items:center;padding:7px 0;border-bottom:1px solid var(--reglure)}
.competence .symbole{font-weight:700;text-align:center;font-size:1.1rem}
.competence .barre{grid-column:2 / 4;height:7px;border-radius:4px;background:var(--reglure);overflow:hidden}
.competence .barre i{display:block;height:100%;border-radius:4px;background:currentColor}
.competence .niveau{font-size:.9rem;font-weight:700;text-align:right}
.niv-rouge{color:var(--rouge)}.niv-orange{color:var(--orange)}.niv-vert{color:var(--vert)}.niv-bleu{color:var(--bleu)}.niv-bord{color:var(--encre-doux)}
.niv-rouge .symbole::before{content:"✘"}.niv-orange .symbole::before{content:"~"}.niv-vert .symbole::before{content:"✔"}.niv-bleu .symbole::before{content:"★"}.niv-bord .symbole::before{content:"?"}
.competence .lib{color:var(--texte)}
.bloc-papier{background:var(--papier);border:1px solid var(--trait);padding:14px 18px}
table{border-collapse:collapse;width:100%;font-size:.95rem;background:var(--papier)}
th,td{border:1px solid var(--trait);padding:6px 9px;text-align:center}
th{background:var(--carreau);color:var(--encre)}
th:first-child,td:first-child{text-align:left}

.choix-chap{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:0 14px;border:0;padding:0;margin:0 0 6px}
.saisie{margin:0 0 6px}
.btn-clavier{padding:5px 12px;font-size:.9rem;margin:6px 0 0}
.clavier{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;max-width:400px;margin:8px 0;padding:10px;background:var(--papier);border:2px solid var(--trait);border-radius:4px}
.clavier[hidden]{display:none}
.touche{font:inherit;font-weight:700;min-height:44px;padding:4px;background:var(--papier);color:var(--texte);border:2px solid var(--trait);border-radius:4px;cursor:pointer;touch-action:manipulation}
.touche:hover{border-color:var(--encre)}
.touche:active{transform:translateY(1px);background:var(--carreau)}
.touche.op{background:var(--carreau);color:var(--encre)}
.touche.fn{background:var(--carreau);color:var(--encre);font-style:italic}
.touche.var{background:var(--surligneur);color:var(--texte);border-color:transparent}
.touche.act{color:var(--stylo);border-color:var(--stylo)}
.touche.large{grid-column:span 2}
.aide-clavier{grid-column:1 / -1;margin:2px 0 0}
.apercu{min-height:1.6em;margin:8px 0 0;padding:2px 12px;border-left:4px solid var(--trait)}
.apercu:empty{display:none}
.apercu.erreur{border-left-color:var(--stylo);color:var(--stylo)}
.apercu .erreur-txt{color:var(--stylo)}
/* ---- passage du test ---- */
.copie{max-width:760px}
.chrono{position:sticky;top:8px;z-index:3;float:right;margin:0 0 6px 12px;padding:4px 12px;background:var(--papier);border:2px solid var(--encre);border-radius:4px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--encre)}
.chrono.bas{border-color:var(--stylo);color:var(--stylo)}
.carreaux{display:flex;gap:4px;flex-wrap:wrap;margin:0 0 6px}
.carreaux span{width:22px;height:22px;border:2px solid var(--encre);background:var(--papier)}
.carreaux span.fait{background:var(--encre)}
.carreaux span.courant{background:var(--surligneur)}
.mode-test{font-size:.9rem;color:var(--encre-doux);margin:0 0 22px}
.exercice{display:grid;grid-template-columns:3.4rem 1fr;gap:0 4px}
.exercice>.numero{font-family:"Caveat",cursive;font-weight:600;font-size:3.4rem;line-height:.9;color:var(--stylo);text-align:right;padding-right:10px}
.enonce{font-size:1.15rem;margin:0 0 1em}
.enonce p{max-width:none}
.choix{display:flex;gap:12px;align-items:flex-start;padding:9px 12px;margin:6px 0;border:2px solid var(--trait);border-radius:4px;cursor:pointer;background:var(--papier)}
.choix:hover{border-color:var(--encre)}
.choix:has(input:checked){border-color:var(--encre);background:var(--carreau)}
.choix input{width:1.2rem;height:1.2rem;margin-top:.25rem;accent-color:var(--encre);flex:none}
.reponse-libre{display:block;max-width:420px}
.reponse-libre span{font-size:.9rem;color:var(--encre-doux)}
.reponse-libre input[type=text],.reponse-libre input[type=text]:focus{border:0;border-bottom:3px solid var(--encre);border-radius:0;background:transparent;font-size:1.25rem;padding:6px 2px}
.reponse-libre input[type=text]:focus{border-bottom-color:var(--bleu);background:var(--carreau)}
.reponse-libre input[type=text]:focus-visible{outline:none}
.etape{margin-top:20px;padding-top:12px;border-top:1px solid var(--reglure)}
.confiance{display:flex;gap:18px;flex-wrap:wrap;align-items:center;margin:18px 0 6px;font-size:.95rem}
.confiance label{display:inline-flex;gap:6px;align-items:center;margin:0}
.correction{margin:14px 0;padding:10px 0 10px 18px;border-left:4px solid var(--stylo)}
.correction.juste{border-color:var(--vert)}
.correction .verdict{font-family:"Caveat",cursive;font-weight:600;font-size:2rem;line-height:1.1;color:var(--stylo);margin:0}
.correction.juste .verdict{color:var(--vert)}
.correction.partiel .verdict{color:var(--orange)}
.correction p{margin:.3em 0}
.attendu{font-weight:700}
code{font-family:ui-monospace,Menlo,Consolas,monospace;background:var(--carreau);padding:1px 6px;border-radius:3px}

/* ---- résultats ---- */
.bilan-tete{display:flex;flex-wrap:wrap;gap:10px 36px;align-items:center;margin-bottom:26px}
.note-cerclee{position:relative;flex:none;width:210px;height:128px;display:grid;place-items:center}
.note-cerclee svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.note-cerclee path{fill:none;stroke:var(--stylo);stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:0;animation:tracer 1.1s ease-out .2s both}
@keyframes tracer{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
.note-cerclee .stylo{font-size:3.6rem;position:relative}
.rappel{background:var(--papier);border:1px solid var(--trait);border-left:5px solid var(--surligneur);padding:10px 16px;margin:10px 0}
.rappel p{margin:.2em 0}
@media (prefers-reduced-motion:reduce){.appreciation .stylo,.note-cerclee path{animation:none}}

/* ---- espace enseignant ---- */
.legende{display:flex;gap:16px;flex-wrap:wrap;font-size:.9rem;margin:6px 0 12px}
.chaleur{overflow-x:auto;background:var(--papier);border:1px solid var(--trait)}
.chaleur table{font-size:.9rem}
.chaleur th:first-child,.chaleur td:first-child{position:sticky;left:0;background:var(--papier);z-index:1;white-space:nowrap}
.chaleur th:first-child{background:var(--carreau)}
td.c-rouge{background:rgba(198,45,39,.2);color:var(--texte)}td.c-orange{background:rgba(199,106,0,.2)}td.c-vert{background:rgba(22,121,79,.2)}td.c-bleu{background:rgba(39,69,201,.2)}
.leg-note{display:inline-block;padding:1px 10px;border:1px solid var(--trait);border-radius:3px}
.leg-note.c-rouge{background:rgba(198,45,39,.2)}.leg-note.c-orange{background:rgba(199,106,0,.2)}.leg-note.c-vert{background:rgba(22,121,79,.2)}.leg-note.c-bleu{background:rgba(39,69,201,.2)}
.radars-classe{display:flex;flex-wrap:wrap;gap:18px 26px}
.radars-classe>div{flex:1 1 260px;max-width:330px;color:var(--encre)}
.reglages .actions{margin:6px 0 44px}
.filtres{display:flex;flex-wrap:wrap;gap:6px 22px;align-items:end;margin-bottom:22px}
.filtres label{margin:0}
.filtres select,.filtres input[type=text]{width:auto;min-width:9em}

/* ---- connexion ---- */
.connexion{max-width:400px;margin:56px auto;padding:0 16px}
.connexion .feuillet{background:var(--papier);border:2px solid var(--encre);padding:26px 28px}
.connexion .logo{height:100px;margin:-10px 0 0 -8px}

/* ---- impression des feuilles d'exercices ---- */
@media print{
  html,body{background:#fff;color:#000;font-size:12pt}
  html{background-image:none}
  .barre-haut,.filtres,.no-print{display:none!important}
  .page::before{display:none}.page{max-width:none;min-height:0}
  .contenu{margin:0;max-width:none;padding:0}
  .feuille{page-break-after:always}
  .stylo{color:#000}
}

