/* eleve.css — charte ultra anti-DYS / TDAH / lecture limitée
   Règles non négociables :
   - Calibri 14pt MINIMUM (corps), 18pt+ pour les actions, 24pt+ pour les titres d'étape
   - Maximum 3 lignes alignées par bloc → après on coupe en cartes
   - 1 action = 1 carte
   - Couleurs sémantiques fortes : vert = vas-y, orange = aide, rouge = STOP, bleu = info
   - Aucun jargon non expliqué
   - Pictogramme + texte (jamais texte seul)
   - Espaces blancs généreux, fond clair uniquement
*/

:root {
  --bleu: #1b3a63;
  --orange: #ff6b35;
  --vert: #2e7d32;
  --vert-clair: #66bb6a;
  --rouge: #c53030;
  --jaune: #fbc02d;
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-warm: #fff8f0;
  --bg-cool: #eef3fb;
  --text: #1a1a1a;
  --text-soft: #4a5568;
  --border: #d9e1ec;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-cool);
  color: var(--text);
  font-family: Calibri, "Segoe UI", Tahoma, Verdana, sans-serif;
  font-size: 16pt; /* corps 16pt — au-dessus du minimum 14pt pour confort */
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* -- TITRES -- toujours Trebuchet bold, gros, lisibles */
h1, h2, h3 {
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 700;
  color: var(--bleu);
  margin: 0 0 14px 0;
  line-height: 1.2;
}
h1 { font-size: 28pt; }
h2 { font-size: 24pt; }
h3 { font-size: 20pt; }

/* === ENTÊTE === */
.eleve-header {
  background: var(--bleu);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 6px solid var(--orange);
}
.eleve-header .logo {
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: 22pt;
}
.eleve-header .logo .badge {
  background: var(--orange);
  color: #fff;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 14pt;
  margin-left: 4px;
}
.eleve-header .title {
  font-family: "Trebuchet MS", sans-serif;
  font-size: 18pt;
  margin-left: auto;
}

/* === SÉLECTEUR TP === */
.selector {
  background: var(--bg-card);
  padding: 24px;
  margin: 16px;
  border-radius: 10px;
  border-top: 4px solid var(--orange);
}
.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tp-choice {
  background: var(--bg-card);
  border: 3px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.tp-choice:hover { border-color: var(--orange); transform: translateY(-2px); }
.tp-choice.selected { border-color: var(--vert); background: #f0fdf4; }
.tp-choice .id {
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 700;
  font-size: 16pt;
  color: var(--orange);
}
.tp-choice .titre {
  font-weight: 700;
  font-size: 15pt;
  color: var(--bleu);
  margin: 6px 0;
}
.tp-choice .meta { font-size: 13pt; color: var(--text-soft); }

.version-bar {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.version-bar button {
  font-family: "Trebuchet MS", sans-serif;
  font-size: 16pt;
  font-weight: 700;
  padding: 12px 20px;
  border: 3px solid var(--bleu);
  background: var(--bg-card);
  color: var(--bleu);
  border-radius: 8px;
  cursor: pointer;
}
.version-bar button.active {
  background: var(--bleu);
  color: #fff;
}
.version-bar button.v1 { border-color: var(--vert); color: var(--vert); }
.version-bar button.v1.active { background: var(--vert); color: #fff; }
.version-bar button.v2 { border-color: var(--orange); color: var(--orange); }
.version-bar button.v2.active { background: var(--orange); color: #fff; }

/* === FICHE DE GUIDANCE === */
.fiche {
  max-width: 21cm;
  margin: 16px auto;
  background: var(--bg-card);
  padding: 24px;
  border-radius: 10px;
}
.fiche-mission {
  background: var(--bg-warm);
  border-left: 6px solid var(--orange);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 18pt;
  line-height: 1.4;
}
.fiche-mission strong { color: var(--orange); }

/* === PROGRESSION === */
.progression {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  padding: 12px 16px;
  border-bottom: 3px solid var(--bleu);
  z-index: 10;
}
.progression .barre {
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  overflow: hidden;
  margin-top: 6px;
}
.progression .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--vert-clair), var(--vert));
  width: 0%;
  transition: width 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13pt;
}

/* === ÉTAPE — UNE ACTION = UNE CARTE === */
.etape {
  background: var(--bg-card);
  border: 3px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.etape.done {
  background: #f0fdf4;
  border-color: var(--vert);
}
.etape.done .etape-num { background: var(--vert); }
.etape-num {
  display: inline-block;
  background: var(--bleu);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 22pt;
  font-weight: 700;
  margin-right: 12px;
  vertical-align: middle;
}
.etape-titre {
  display: inline-block;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 22pt;
  font-weight: 700;
  color: var(--bleu);
  vertical-align: middle;
  max-width: calc(100% - 80px);
}
.etape-picto {
  display: inline-block;
  font-size: 36pt;
  margin-right: 8px;
  vertical-align: middle;
}

/* "JE FAIS QUOI ?" — l'action en 1 phrase */
.etape-action {
  background: var(--bg-warm);
  border-left: 5px solid var(--orange);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 18pt;
  line-height: 1.4;
  font-weight: 600;
}
.etape-action::before {
  content: "👉 ";
  font-size: 22pt;
}

/* Checklist micro-actions — max 3 lignes par item, items distincts */
.checklist {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.checklist li {
  background: var(--bg-cool);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16pt;
  line-height: 1.4;
}
.checklist li input[type="checkbox"] {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--vert);
}
.checklist li.done {
  background: #e8f5e9;
  text-decoration: line-through;
  color: var(--text-soft);
}

/* AIDE — bloc orange clair, repliable */
.aide {
  background: #fff5e1;
  border: 2px dashed var(--orange);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
}
.aide summary {
  font-weight: 700;
  font-size: 16pt;
  color: var(--orange);
  cursor: pointer;
  list-style: none;
}
.aide summary::before {
  content: "🆘 SI JE BLOQUE → ";
  font-weight: 700;
}
.aide[open] summary::before { content: "💡 AIDE — "; }
.aide-content {
  margin-top: 10px;
  font-size: 15pt;
  line-height: 1.5;
}

/* STOP — visa prof obligatoire */
.stop-prof {
  background: #fef2f2;
  border: 3px solid var(--rouge);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 17pt;
  font-weight: 700;
  color: var(--rouge);
  text-align: center;
}
.stop-prof::before {
  content: "🛑 ";
  font-size: 28pt;
  display: block;
  margin-bottom: 4px;
}

/* DEFI — bonus si fini avant l'heure */
.defi {
  background: #f0fdf4;
  border: 3px dashed var(--vert);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
}
.defi h3 {
  color: var(--vert);
  font-size: 18pt;
  margin: 0 0 8px;
}
.defi h3::before { content: "🏆 "; }

/* SECOURS — atelier de rattrapage */
.secours {
  background: var(--bg-warm);
  border-top: 6px solid var(--rouge);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 24px;
}
.secours h3 {
  color: var(--rouge);
  margin: 0 0 8px;
}
.secours h3::before { content: "🚨 "; }

/* SÉCURITÉ — toujours visible */
.securite {
  background: #fff8e1;
  border-left: 6px solid var(--jaune);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 16pt;
}
.securite::before {
  content: "⚠️ SÉCURITÉ : ";
  font-weight: 700;
  color: #c08600;
}

/* === BOUTONS NAVIGATION === */
.nav-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.btn-nav {
  font-family: "Trebuchet MS", sans-serif;
  font-size: 18pt;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  min-width: 160px;
}
.btn-nav.next { background: var(--vert); color: #fff; }
.btn-nav.prev { background: var(--bg-card); color: var(--bleu); border: 3px solid var(--bleu); }
.btn-nav.print { background: var(--bleu); color: #fff; }

/* === IMPRESSION A4 === */
@media print {
  body { background: #fff; font-size: 13pt; }
  .eleve-header, .selector, .version-bar, .nav-bar, .progression { display: none !important; }
  .fiche { box-shadow: none; padding: 10px; }
  .etape { border-color: #999; box-shadow: none; }
  @page { size: A4; margin: 1.2cm; }
  h1 { font-size: 22pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 16pt; }
  .checklist li { background: #fafafa; }
  .aide { display: none; } /* l'aide en papier prend trop de place */
  .aide.print-show { display: block; }
}
