/* Feuille de style C10 — accessible (WCAG AA), sobre, souveraine (aucune ressource externe).
   Double codage forme/texte : l'information n'est JAMAIS portée par la seule couleur (ENF-1). */

:root {
  --ink: #1a2733; --ink-doux: #4a5a68; --ligne: #d6dee6; --fond: #f6f8fa;
  --panel: #ffffff; --accent: #2c5f8a; --accent-fond: #e8f0f7;
  --ok: #1f7a4d; --ok-fond: #e6f3ec; --attention: #8a5a1f; --attention-fond: #f7efe0;
  --alerte: #a23a2c; --alerte-fond: #f7e9e6; --focus: #1652a8;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--fond); line-height: 1.5;
}
.enveloppe { max-width: 960px; margin: 0 auto; padding: 24px 20px 64px; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 12px; }
.sous-titre { color: var(--ink-doux); margin: 0 0 20px; }

/* focus visible partout (navigation clavier — WCAG) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

.panel {
  background: var(--panel); border: 1px solid var(--ligne); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 16px;
}

/* file de recommandations */
.item { border-bottom: 1px solid var(--ligne); padding: 14px 0; }
.item:last-child { border-bottom: none; }
.item-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.item-app { font-weight: 600; }
.item-resume { color: var(--ink-doux); margin: 4px 0 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

button {
  font: inherit; padding: 7px 14px; border-radius: 7px; border: 1px solid var(--ligne);
  background: var(--panel); color: var(--ink); cursor: pointer;
}
button:hover { border-color: var(--accent); }
.btn-valider  { background: var(--ok-fond); border-color: var(--ok); color: var(--ok); }
.btn-refuser  { background: var(--alerte-fond); border-color: var(--alerte); color: var(--alerte); }
.btn-ajuster, .btn-reporter { background: var(--accent-fond); border-color: var(--accent); color: var(--accent); }

/* état d'incertitude : double codé (mot + pastille à motif, pas juste couleur) */
.incert { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; }
.incert .pastille { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.incert.faible  { color: var(--ok); }
.incert.faible .pastille { background: currentColor; }
.incert.moyenne { color: var(--attention); }
.incert.moyenne .pastille { background: repeating-linear-gradient(45deg, currentColor 0 2px, transparent 2px 4px); }
.incert.forte   { color: var(--alerte); }
.incert.forte .pastille { background: transparent; }

/* justification 3 niveaux */
.justif-phrase { font-size: 1.05rem; font-weight: 600; margin: 0 0 12px; }
.appuis { margin: 0 0 12px; padding-left: 20px; }
.appuis li { margin: 4px 0; }
details.audit { border-top: 1px solid var(--ligne); padding-top: 10px; }
details.audit summary { cursor: pointer; font-weight: 600; color: var(--ink-doux); }
.audit-trace { font-family: ui-monospace, Consolas, monospace; font-size: .82rem;
  background: var(--fond); border-radius: 6px; padding: 10px 12px; margin-top: 8px;
  white-space: pre-wrap; word-break: break-word; }

/* position dans le groupe : bandes/quartiles, JAMAIS un rang nominatif (non-stigmatisant) */
.bandes { display: flex; gap: 2px; margin: 8px 0; }
.bande { flex: 1; height: 22px; border: 1px solid var(--ligne); border-radius: 3px; background: var(--fond); }
.bande.actif { background: var(--accent-fond); border-color: var(--accent); }
.bande-legende { font-size: .82rem; color: var(--ink-doux); }

.abstention { color: var(--attention); font-style: italic; }
.vide { color: var(--ink-doux); font-style: italic; padding: 12px 0; }
form.arb-inline { display: inline; }
label { font-weight: 600; display: block; margin: 10px 0 4px; }
input[type="number"], textarea {
  font: inherit; padding: 6px 8px; border: 1px solid var(--ligne); border-radius: 6px; width: 100%;
}
.rang-mesg { background: var(--ok-fond); border: 1px solid var(--ok); color: var(--ok);
  border-radius: 7px; padding: 8px 12px; margin-top: 10px; }

/* ---- MOBILE FIRST (les élèves sont sur tablette/mobile) ---- */
button, .lecon-carte-cta, .se-form button { min-height: 44px; }  /* cible tactile */
img { max-width: 100%; height: auto; }
@media (max-width: 680px) {
  .enveloppe { padding: 14px 12px 96px; }
  h1 { font-size: 1.3rem; }
  .panel { padding: 14px 14px; border-radius: 12px; }
  .item-tete, .actions { gap: 8px; }
  button { padding: 10px 16px; }
}

/* barre de navigation basse de l'ÉLÈVE — repères fixes, comme une appli */
.nav-eleve {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--panel); border-top: 1px solid var(--ligne);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(20, 30, 40, .08);
}
.nav-eleve a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px; min-height: 48px; justify-content: center;
  text-decoration: none; color: var(--ink-doux); font-size: .72rem;
  border-radius: 10px; padding: 4px 8px;
}
.nav-eleve a .nav-emoji { font-size: 1.35rem; line-height: 1; }
.nav-eleve a:hover, .nav-eleve a:focus-visible { background: var(--accent-fond); color: var(--accent); }
body:has(.nav-eleve) .enveloppe { padding-bottom: 110px; }

/* ---- MOTION DESIGN (finition « produit ») — CSS pur, souverain ----
   Doctrine : la motion RÉCOMPENSE une action ou accueille une page ; jamais de
   décor au scroll (outil quotidien, tablettes modestes, attention protégée). */
button, .acc-tuile, .acc-go, .lecon-carte-cta, .nav-eleve a, .exo-form button {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease,
              background-color .15s ease;
}
button:active, .acc-tuile:active, .acc-go:active, .nav-eleve a:active,
.lecon-carte-cta:active { transform: scale(.97); }           /* feedback tactile */
.acc-tuile:hover { transform: translateY(-2px);
                   box-shadow: 0 6px 16px rgba(18, 26, 22, .10); }

@media (prefers-reduced-motion: no-preference) {
  @keyframes fond-monte { from { opacity: 0; transform: translateY(14px); }
                          to { opacity: 1; transform: none; } }
  @keyframes jauge-remplir { from { width: 0; } }
  @keyframes fete-pop { 0% { transform: scale(.6); opacity: 0; }
                        60% { transform: scale(1.08); }
                        100% { transform: scale(1); opacity: 1; } }
  .anim-entree { animation: fond-monte .5s ease-out both; }
  .anim-retard-1 { animation-delay: .08s; } .anim-retard-2 { animation-delay: .16s; }
  .anim-retard-3 { animation-delay: .24s; } .anim-retard-4 { animation-delay: .32s; }
  .acc-jauge-barre { animation: jauge-remplir .9s ease-out both; }  /* la fierté monte */
  .se-confirm { animation: fete-pop .45s ease-out both; }
  .se-fete::after { content: " 🎉"; display: inline-block;
                    animation: fete-pop .6s ease-out .15s both; }
}

/* ---- manipulations tactiles (leçons) ---- */
.manip { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.manip-fraction { margin: 0; font-size: 1.25rem; }
.manip-fraction b { color: var(--accent); font-size: 1.5rem; }
.manip-aide { margin: 0; font-size: .82rem; color: var(--ink-doux); }
.manip-curseur { width: min(320px, 90%); accent-color: var(--accent); height: 32px; }
