/* Mobile-first — entraînement élève */

:root {
  --bg: #f8fafc;
  --text: #1e293b;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #a16207;
  --warn-bg: #fef9c3;
  --border: #cbd5e1;
  --radius: 0.75rem;
  --tap-min: 3rem;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  font-size: 1.05rem;
}

body.lecture-confort {
  font-family: "OpenDyslexic", "Comic Sans MS", system-ui, sans-serif;
  font-size: 1.25rem;
  line-height: 1.85;
  letter-spacing: 0.04em;
  word-spacing: 0.12em;
  background: #fff;
  color: #111;
}

.site-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.header-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 40rem;
  margin: 0 auto;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.main-content {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.2rem; margin-top: 0; }
.tagline { margin: 0.15rem 0 0; color: #64748b; font-size: 0.95rem; }
.eleve-nom { font-weight: 600; margin-right: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
}

.btn-small {
  min-height: 2.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  width: auto;
}

.inline-form { display: inline; margin: 0; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.form-group { margin-bottom: 1rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: var(--accent-soft);
  color: #1e40af;
}

.bonus-bandeau {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 600;
}

.enonce { margin-bottom: 1rem; }

.propositions { list-style: none; padding: 0; margin: 0; }

.proposition {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  min-height: var(--tap-min);
  cursor: pointer;
  background: #fff;
}

.proposition input {
  margin-top: 0.35rem;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.feedback-ok {
  background: var(--ok-bg);
  border: 2px solid #86efac;
  color: var(--ok);
}

.feedback-ko {
  background: var(--warn-bg);
  border: 2px solid #fde047;
  color: var(--warn);
}

.prop-correct {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.prop-incorrect {
  border-color: #f87171;
  background: #fee2e2;
}

.prop-selected:not(.prop-correct) {
  border-color: #fbbf24;
}

.feedback-msg {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.feedback-msg::before {
  margin-right: 0.35rem;
}

.feedback-ok .feedback-msg::before { content: "✓ "; }
.feedback-ko .feedback-msg::before { content: "↻ "; }

.explication {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.help-link {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: var(--accent);
}

.figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

@media (min-width: 480px) {
  .btn { width: auto; min-width: 12rem; }
  .header-row { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* Portail élève — Lot 1d */

body:has(.nav-portail) .main-content {
  padding-bottom: 5.5rem;
}

.nav-portail {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  gap: 0.15rem;
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0));
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: var(--tap-min);
  padding: 0.35rem 0.15rem;
  text-decoration: none;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 0.5rem;
  text-align: center;
  line-height: 1.2;
}

.nav-item.nav-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-icone {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

.etat-vide {
  text-align: center;
  padding: 2rem 1rem;
  color: #64748b;
  font-size: 1.05rem;
}

.chapitre-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

/* Mes compétences — refonte Lot 1d */

.recap-competences {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border-color: #86efac;
}

.recap-texte {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  line-height: 1.45;
}

.recap-barre-global {
  height: 0.85rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.recap-barre-fill {
  height: 100%;
  background: #15803d;
  border-radius: 999px;
  min-width: 0;
  transition: width 0.3s ease;
}

.chapitre-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.chapitre-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem;
  user-select: none;
}

.chapitre-summary::-webkit-details-marker { display: none; }

.chapitre-summary::after {
  content: "▾";
  float: right;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  margin-top: -1.75rem;
}

.chapitre-card[open] .chapitre-summary::after {
  content: "▴";
}

.chapitre-entete {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
}

.chapitre-titre {
  margin: 0;
  font-size: 1.1rem;
}

.chapitre-compteur {
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
}

.barre-chapitre {
  height: 0.45rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  clear: both;
}

.barre-chapitre-fill {
  height: 100%;
  background: #15803d;
  border-radius: 999px;
  min-width: 0;
}

.liste-competences {
  list-style: none;
  padding: 0 1rem 0.75rem;
  margin: 0;
  border-top: 1px solid #f1f5f9;
}

.competence-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  border-left: 3px solid var(--niveau-couleur, #cbd5e1);
  padding-left: 0.65rem;
}

.competence-ligne:last-child { border-bottom: none; }

.competence-ligne.niveau-a-travailler { --niveau-couleur: #64748b; }
.competence-ligne.niveau-en-cours { --niveau-couleur: #ca8a04; }
.competence-ligne.niveau-acquis { --niveau-couleur: #15803d; }

.competence-nom {
  flex: 1;
  font-weight: 500;
  min-width: 0;
}

.niveau-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--niveau-couleur);
  background: color-mix(in srgb, var(--niveau-couleur) 12%, transparent);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.niveau-icone { font-size: 1rem; line-height: 1; }
.niveau-mot { line-height: 1.2; }

@media (min-width: 480px) {
  .chapitre-summary { padding: 1.1rem 1.25rem; }
  .liste-competences { padding: 0 1.25rem 1rem; }
}

.meta-date { color: #64748b; margin-top: -0.25rem; }

.recap-ok { border-left: 4px solid var(--ok); }
.recap-ko { border-left: 4px solid #ca8a04; }

.liste-recap {
  list-style: none;
  padding: 0;
  margin: 0;
}

.liste-recap li { padding: 0.35rem 0; }

.sous-titre {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0.75rem 0 0.35rem;
  color: #475569;
}

.propositions.lecture-seule .proposition {
  cursor: default;
}

.question-controle { margin-bottom: 1.25rem; }

.progression-card { text-align: center; }

.progression-legende { margin-top: 0; color: #475569; }

.progression-graph {
  margin: 1rem auto;
  max-width: 100%;
}

.progression-svg {
  width: 100%;
  max-width: 24rem;
  height: auto;
}

.progression-points {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  text-align: left;
  font-size: 0.95rem;
  color: #475569;
}

.note-card { text-align: center; padding: 2rem 1rem; }

.note-libelle {
  margin: 0 0 0.5rem;
  color: #475569;
  font-weight: 600;
}

.note-valeur {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0;
  line-height: 1;
}

.note-sur {
  font-size: 1.5rem;
  font-weight: 600;
  color: #64748b;
}

.note-bloquee { max-width: 22rem; margin: 2rem auto; }
