/* Mes enseignements — feuille de style commune (élève et prof). Aucune ressource externe. */
/* Lexend, police pensée pour faciliter la lecture. Licence SIL Open Font License 1.1 (fonts/OFL.txt). */
@font-face {
  font-family: Lexend;
  src: url("/static/fonts/Lexend-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --encre: #1D2433; --gris: #545E70; --gris-clair: #8A8398; --fond: #F6F5FB; --fond-prof: #F4F3F7;
  --blanc: #FFFFFF; --trait: #E2DEEA; --trait-fort: #B9B2C6;
  --violet: #6B3F68; --violet-fonce: #4E2C4C; --violet-doux: #F1E7F0;
  --jaune: #F2B632; --jaune-doux: #FFF4D6; --jaune-texte: #6E4700;
  --vert: #1F7A4D; --vert-doux: #E3F3EA; --vert-texte: #1F5A3A;
  --orange: #B4530F; --orange-doux: #FDEBDD; --orange-texte: #8A3A08;
  --bleu: #1F5F8B; --bleu-doux: #E3EEF8;
  --rayon: 16px;
  font-family: Lexend, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--encre);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); font-size: 17px; line-height: 1.45; }
body.prof { background: var(--fond-prof); font-size: 16px; }
a { color: var(--violet); }
a:hover { color: var(--violet-fonce); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --------------------------------------------------------------- boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 20px;
  border: 0; border-radius: var(--rayon); background: var(--violet); color: #fff; font-weight: 600; font-size: 18px;
  text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--violet-fonce); color: #fff; }
.btn:disabled { background: var(--trait-fort); cursor: not-allowed; }
.btn-sec { background: var(--blanc); color: var(--violet); border: 2px solid var(--violet); }
.btn-sec:hover { background: var(--violet-doux); color: var(--violet-fonce); }
.btn-danger { background: var(--blanc); color: var(--orange-texte); border: 1px solid var(--orange); }
.btn-danger:hover { background: var(--orange-doux); color: var(--orange-texte); }
.btn-petit { min-height: 44px; font-size: 15px; padding: 0 14px; border-radius: 10px; }
.btn-large { width: 100%; }
.btn-icone { width: 48px; min-height: 48px; padding: 0; border-radius: 14px; background: var(--blanc); border: 1px solid var(--trait); color: var(--encre); }
.btn-icone:hover { background: var(--violet-doux); color: var(--encre); }
.btn-ecouter { background: var(--bleu-doux); color: var(--bleu); border: 0; border-radius: 24px; min-height: 48px; padding: 0 16px; font-size: 15px; }
.btn-ecouter:hover { background: #d2e3f2; color: var(--bleu); }
.lien { background: none; border: 0; padding: 10px 4px; color: var(--violet); text-decoration: underline; cursor: pointer; font-size: 15px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label, .etiquette { font-weight: 600; font-size: 15px; }
.champ input, .champ select, .champ textarea, input.entree, select.entree, textarea.entree {
  min-height: 48px; border: 1px solid var(--trait-fort); border-radius: 12px; padding: 8px 14px; background: var(--blanc); width: 100%; }
.champ textarea, textarea.entree { line-height: 1.5; resize: vertical; }
.aide { font-size: 14px; color: var(--gris); margin: 0; }
.erreur { color: var(--orange-texte); background: var(--orange-doux); padding: 12px 14px; border-radius: 12px; margin: 0; }
.succes { color: var(--vert-texte); background: var(--vert-doux); padding: 12px 14px; border-radius: 12px; margin: 0; }

/* --------------------------------------------------------------- éléments communs */
.marque { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--encre); text-decoration: none; }
.marque-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--violet); display: grid; place-items: center; flex-shrink: 0; }
.carte { background: var(--blanc); border: 1px solid var(--trait); border-radius: 20px; padding: 18px; }
.puce { display: inline-block; padding: 5px 12px; border-radius: 99px; font-size: 14px; font-weight: 600; }
.puce-jaune { background: var(--jaune-doux); color: var(--jaune-texte); }
.puce-verte { background: var(--vert-doux); color: var(--vert-texte); }
.puce-orange { background: var(--orange-doux); color: var(--orange-texte); }
.puce-grise { background: #EEEBF2; color: var(--gris); }
.pile { display: flex; flex-direction: column; gap: 16px; }
.rang { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rang-espace { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 20px; color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.annonce { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--encre); color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: calc(100% - 32px); }
.barre { height: 12px; border-radius: 6px; background: var(--trait); flex-grow: 1; overflow: hidden; }
.barre > span { display: block; height: 100%; border-radius: 6px; background: var(--violet); }
.chargement { color: var(--gris); padding: 24px 0; }

/* --------------------------------------------------------------- espace élève */
.ecran { max-width: 560px; margin: 0 auto; padding: 20px 20px 32px; min-height: 100vh; display: flex; flex-direction: column; gap: 20px; }
.ecran.large { max-width: 1120px; }
.titre-eleve { font-size: 30px; font-weight: 700; }
.sous-titre { font-size: 18px; color: var(--gris); margin: 0; }
.entete-eleve { display: flex; align-items: center; gap: 12px; }
.code-saisie { min-height: 64px; border: 2px solid var(--violet); border-radius: var(--rayon); padding: 0 20px; font-size: 28px;
  font-weight: 600; letter-spacing: 3px; text-transform: uppercase; width: 100%; background: var(--blanc); }
.separateur { display: flex; align-items: center; gap: 12px; color: var(--gris); font-size: 15px; }
.separateur::before, .separateur::after { content: ""; flex-grow: 1; height: 1px; background: #DAD5E3; }
.astuce { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--rayon); background: var(--blanc); border: 1px solid var(--trait); }
.astuce-icone { width: 56px; height: 56px; flex-shrink: 0; border-radius: 14px; background: var(--jaune-doux); display: grid; place-items: center; }
.pied { margin-top: auto; display: flex; justify-content: space-between; font-size: 14px; }
.btn-prenom { min-height: 64px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--blanc);
  display: flex; align-items: center; gap: 12px; padding: 0 12px; font-size: 18px; font-weight: 600; cursor: pointer; text-align: left; }
.btn-prenom:hover { border-color: var(--violet); background: var(--violet-doux); }
.onglets-matieres { display: flex; gap: 8px; flex-wrap: wrap; }
.onglet { min-height: 48px; padding: 0 18px; border-radius: 24px; border: 1px solid var(--trait-fort); background: var(--blanc); font-weight: 600; cursor: pointer; }
.onglet[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.liste-lecons { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.carte-lecon { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 20px; background: var(--blanc);
  border: 1px solid var(--trait); text-decoration: none; color: var(--encre); box-shadow: 0 4px 14px rgba(29, 36, 51, .06); border-top: 6px solid var(--violet); }
.carte-lecon:hover { border-color: var(--violet); color: var(--encre); }
.surtitre { font-size: 14px; font-weight: 600; letter-spacing: .3px; color: var(--violet); }
.vignettes { display: flex; gap: 8px; }
.vignettes img { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: var(--violet-doux); }
.etape { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--blanc); border: 1px solid var(--trait); }
.etape-tete { display: flex; align-items: center; gap: 14px; }
.etape-num { width: 52px; height: 52px; flex-shrink: 0; border-radius: 26px; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.lien-activite { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-radius: 14px;
  background: var(--fond); text-decoration: none; color: var(--encre); font-size: 17px; font-weight: 600; }
.lien-activite:hover { background: var(--violet-doux); color: var(--encre); }
.grille-mots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mot { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.mot img { width: 110px; height: 110px; object-fit: contain; }
.mot .recto { font-weight: 700; font-size: 18px; }
.mot .verso { color: var(--gris); font-size: 15px; }
.flash { min-height: 320px; border: 0; border-radius: 24px; background: var(--violet-doux); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 24px; cursor: pointer; text-align: center; width: 100%; }
.flash img { width: 200px; height: 200px; object-fit: contain; }
.flash .gros { font-size: 30px; font-weight: 700; }
.choix { min-height: 60px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--blanc); padding: 0 18px; text-align: left;
  font-size: 20px; font-weight: 600; cursor: pointer; width: 100%; }
.choix:hover { border-color: var(--violet); }
.choix[aria-checked="true"], .choix.choisi { border: 3px solid var(--violet); background: var(--violet-doux); }
.choix.trouve, .choix:disabled.trouve { border: 2px solid var(--vert); background: var(--vert-doux); color: var(--vert-texte); cursor: default; }
.choix.rate { border: 2px solid var(--orange); background: var(--orange-doux); }
.tuile-image { aspect-ratio: 1; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--blanc); padding: 6px; cursor: pointer; }
.tuile-image img { width: 100%; height: 100%; object-fit: contain; }
.tuile-image.choisi { border: 3px solid var(--violet); }
.tuile-image.trouve { border: 2px solid var(--vert); background: var(--vert-doux); cursor: default; }
.question { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; border-radius: 22px; background: var(--blanc); border: 1px solid var(--trait); text-align: center; }
.question img { width: 150px; height: 150px; object-fit: contain; }
.question .consigne { font-size: 22px; font-weight: 700; }
.etoiles { display: flex; gap: 6px; justify-content: center; }
.score-geant { font-size: 56px; font-weight: 700; line-height: 1.1; }
.a-revoir { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--orange-doux); }
.a-revoir strong { flex-shrink: 0; max-width: 45%; text-align: right; }

/* --------------------------------------------------------------- espace prof */
.entete-prof { background: var(--blanc); border-bottom: 1px solid var(--trait); }
.entete-prof > div { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.nav-prof { display: flex; flex-wrap: wrap; gap: 4px; }
.nav-prof a { padding: 10px 14px; border-radius: 10px; color: var(--encre); text-decoration: none; }
.nav-prof a[aria-current="page"] { background: var(--violet-doux); font-weight: 600; color: var(--violet); }
.contenu-prof { max-width: 1200px; margin: 0 auto; padding: 28px 24px 48px; display: flex; flex-direction: column; gap: 22px; }
.titre-prof { font-size: 28px; font-weight: 700; }
.bloc { background: var(--blanc); border: 1px solid var(--trait); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.bloc h2 { font-size: 19px; }
.colonnes { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.colonnes > .principal { flex: 999 1 560px; min-width: 0; }
.colonnes > .cote { flex: 1 1 300px; min-width: 0; }
.tuiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tuile { flex: 1 1 220px; padding: 18px 20px; border-radius: 16px; background: var(--blanc); border: 1px solid var(--trait); }
.tuile .valeur { font-size: 30px; font-weight: 700; }
.defile { overflow-x: auto; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { text-align: left; padding: 12px; background: var(--fond); font-weight: 600; }
.tableau td { padding: 10px 12px; border-top: 1px solid #EEEBF2; vertical-align: middle; }
.tableau tr.faux td { background: #FFF8F3; }
.tableau input.entree { min-height: 42px; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.vignette-carte { width: 56px; height: 56px; border-radius: 10px; border: 2px dashed var(--trait-fort); background: var(--blanc); display: grid; place-items: center; cursor: pointer; padding: 0; overflow: hidden; }
.vignette-carte img { width: 100%; height: 100%; object-fit: contain; }
.vignette-carte.avec { border: 1px solid #D6D0E0; background: var(--violet-doux); }
.etapes-editeur { display: flex; flex-wrap: wrap; gap: 8px; }
.etapes-editeur a { min-height: 44px; display: flex; align-items: center; padding: 0 16px; border-radius: 22px; background: var(--blanc); border: 1px solid var(--trait); color: var(--encre); text-decoration: none; }
.etapes-editeur a[aria-current="page"] { background: var(--violet); border-color: var(--violet); color: #fff; font-weight: 600; }
.ligne-lecon { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--fond); }
.ligne-lecon > span:first-child { flex: 1 1 280px; }
.pastille { width: 14px; height: 14px; border-radius: 7px; flex-shrink: 0; }
.couleurs { display: flex; gap: 10px; }
.couleurs button { width: 40px; height: 40px; border-radius: 20px; border: 3px solid transparent; cursor: pointer; }
.couleurs button[aria-pressed="true"] { border-color: var(--encre); }
.question-liste { min-height: 52px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--trait); background: var(--blanc); display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; width: 100%; }
.question-liste[aria-current="true"] { border: 2px solid var(--violet); background: var(--violet-doux); }
.code-classe { font-size: 32px; font-weight: 700; letter-spacing: 3px; }
.qr { width: 140px; height: 140px; border-radius: 12px; border: 1px solid var(--trait); background: #fff; }
.plein-ecran { position: fixed; inset: 0; background: var(--blanc); z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px; text-align: center; }
.plein-ecran .code-classe { font-size: clamp(48px, 10vw, 120px); }
.plein-ecran .qr { width: min(60vh, 70vw); height: min(60vh, 70vw); }
.codes-secours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 18px; }
.connexion { max-width: 460px; margin: 8vh auto; padding: 0 16px; }

@media (max-width: 620px) {
  .contenu-prof { padding: 18px 14px 40px; }
  .titre-eleve { font-size: 26px; }
  .grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media print {
  .entete-prof, .nav-prof, button { display: none !important; }
}
