/* Entraînement EPPA — feuille unique, pensée d'abord pour le téléphone. */
:root {
  --fond: #f4f5f7; --carte: #ffffff; --texte: #1d2330; --discret: #5b6475;
  --bord: #d9dde5; --accent: #1f5fbf; --accent-texte: #ffffff;
  --juste: #1e7a3d; --juste-fond: #e3f4e8; --faux: #b3261e; --faux-fond: #fbe7e6;
  --avert: #8a5a00; --avert-fond: #fff3d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #14161b; --carte: #1e2128; --texte: #e8eaef; --discret: #a3aab8;
    --bord: #343a46; --accent: #6ea1ff; --accent-texte: #0d1424;
    --juste: #6ad48b; --juste-fond: #173322; --faux: #ff8a80; --faux-fond: #3a1a18;
    --avert: #ffcc66; --avert-fond: #3a2f12;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.4rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }

.entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
          gap: .5rem; padding: .6rem 16px; background: var(--carte); border-bottom: 1px solid var(--bord); }
.marque { font-weight: 700; text-decoration: none; color: var(--texte); }
.menu { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.menu form { margin: 0; }
.page { max-width: 760px; margin: 0 auto; padding: 16px; }
.pied { text-align: center; padding: 1.5rem 16px; font-size: .9rem; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px;
         padding: 1rem; margin: 0 0 1rem; }
.etroite { max-width: 420px; margin-left: auto; margin-right: auto; }
.discret { color: var(--discret); font-size: .92rem; }
.liste { margin: 0; padding-left: 1.2rem; }

.formulaire { display: flex; flex-direction: column; gap: .35rem; }
.formulaire label { font-weight: 600; margin-top: .4rem; }
input, select, button { font: inherit; }
input:not([type=checkbox]), select {
  width: 100%; padding: .65rem .7rem; border: 1px solid var(--bord); border-radius: 8px;
  background: var(--carte); color: var(--texte); min-height: 44px; }
input:focus, select:focus, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.ligne { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: .4rem .6rem; align-items: center; }
.ligne label { margin: 0; }
.cases { border: 0; padding: 0; margin: 0; display: grid;
         grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .15rem .8rem; }
.cases legend { font-weight: 600; margin-bottom: .3rem; }
.case { display: flex; align-items: center; gap: .5rem; font-weight: 400 !important; margin: 0 !important;
        min-height: 36px; }
.case input { width: 20px; height: 20px; }

.bouton { display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
          background: var(--accent); color: var(--accent-texte); border: 0; border-radius: 8px;
          padding: .75rem 1.1rem; font-weight: 600; min-height: 44px; margin-top: .6rem; }
.bouton[disabled] { opacity: .6; cursor: wait; }
.lien { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.petit { font-size: .85rem; padding: .35rem .6rem; border-radius: 6px; border: 1px solid var(--bord);
         background: var(--carte); color: var(--texte); cursor: pointer; }
.actions { margin: 0 0 1rem; }
.secondaire { text-align: center; margin: 1rem 0; }

.alerte { background: var(--faux-fond); color: var(--faux); padding: .6rem .8rem; border-radius: 8px; }
.succes { background: var(--juste-fond); color: var(--juste); padding: .6rem .8rem; border-radius: 8px; }
.rappel { background: var(--avert-fond); color: var(--texte); padding: .6rem .8rem; border-radius: 8px;
          font-size: .92rem; }

.progression { color: var(--discret); margin: 0 0 .5rem; }
.enonce { font-size: 1.08rem; margin: 0 0 .6rem; }
.consigne { font-size: .92rem; color: var(--discret); font-style: italic; margin: 0 0 .4rem; }
.verdict { font-weight: 700; font-size: 1.15rem; margin: 0 0 .6rem; }
.verdict.reussie { color: var(--juste); }
.verdict.ratee { color: var(--faux); }
.corrigee.reussie { border-left: 5px solid var(--juste); }
.corrigee.ratee { border-left: 5px solid var(--faux); }
.reponses { width: 100%; border-collapse: collapse; margin: .4rem 0 .6rem; font-size: .95rem; }
.reponses th, .reponses td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--bord);
                              vertical-align: top; }
.pastille { display: inline-block; font-size: .78rem; font-weight: 700; padding: .05rem .45rem;
            border-radius: 99px; background: var(--faux-fond); color: var(--faux); }
.pastille.juste { background: var(--juste-fond); color: var(--juste); }
.pastille.vide, .pastille.format, .pastille.unite, .pastille.forme, .pastille.arrondi {
  background: var(--avert-fond); color: var(--avert); }
.correction { margin: .4rem 0 0; padding-left: 1.3rem; }
.correction li { margin: .15rem 0; }
summary { cursor: pointer; font-weight: 600; }

.bilan .note { font-size: 2.2rem; font-weight: 800; margin: 0; }

.chrono { position: sticky; top: 0; z-index: 2; background: var(--carte); border: 1px solid var(--bord);
          border-radius: 10px; padding: .5rem .8rem; margin: 0 0 1rem; text-align: center; }
.chrono.urgent { background: var(--faux-fond); color: var(--faux); border-color: var(--faux); }
.question-sujet legend { font-weight: 700; padding: 0 .3rem; }
.etat-enregistrement { min-height: 1.2em; margin: .3rem 0 0; }

.mot-de-passe .secret { font: 700 1.3rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .03em;
                        user-select: all; word-break: break-all; }
.defilement { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th, .tableau td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--bord); }
.boutons { display: flex; flex-wrap: wrap; gap: .3rem; }
.boutons form { margin: 0; }

/* Suivi et tableaux de bord */
textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--bord); border-radius: 8px;
           background: var(--carte); color: var(--texte); font: inherit; resize: vertical; }
.compteur { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 99px;
            background: var(--faux); color: var(--carte); font-size: .8rem; font-weight: 700; text-align: center; }
.periodes { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.periodes a { padding: .45rem .8rem; border: 1px solid var(--bord); border-radius: 99px;
              text-decoration: none; color: var(--texte); background: var(--carte); min-height: 36px; }
.periodes a.active { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.tuile { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: .7rem .8rem; }
.tuile .valeur { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.tuile .libelle { color: var(--discret); font-size: .88rem; }
.peu-de-donnees { color: var(--discret); }
.graphique { display: block; max-width: none; }
.graphique .grille { stroke: var(--bord); stroke-width: 1; }
.graphique .axe { fill: var(--discret); font-size: 11px; }
.graphique .barre { fill: var(--accent); }
.graphique .barre-faible { fill: var(--accent); fill-opacity: .35; }
.graphique .cible { fill: transparent; }
.graphique .point:hover .barre { fill-opacity: .8; }
.liste-contestations { list-style: none; margin: 0; padding: 0; }
.liste-contestations li { padding: .6rem 0; border-bottom: 1px solid var(--bord); }
.pastille.statut-en_attente, .pastille.statut-complement { background: var(--avert-fond); color: var(--avert); }
.pastille.statut-acceptee { background: var(--juste-fond); color: var(--juste); }
.pastille.statut-refusee { background: var(--faux-fond); color: var(--faux); }
.contestation, .contester { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--bord); }
.citation { white-space: pre-wrap; border-left: 3px solid var(--bord); padding-left: .7rem; }
.en-ligne { display: inline; }

@media (max-width: 480px) {
  .ligne { grid-template-columns: auto 1fr; }
  .tableau th:nth-child(4), .tableau td:nth-child(4) { display: none; }
}
