/* ============================================================
   SASIQuest 2.0 — Révision (« Mes points faibles » + examen blanc)
   Reprend les jetons de style.css (cartes ardoise, accent jaune,
   vert succès, rouge danger). Fichier séparé pour ne pas toucher style.css.
   ============================================================ */

/* ---------- Cartes d'entrée sur la carte ---------- */
.rev-cartes { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.rev-carte {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-left: 4px solid var(--safety-yellow);
  border-radius: var(--radius); padding: 13px 14px; text-align: left;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
.rev-carte-examen { border-left-color: var(--success); }
.rev-carte-vide { border-left-color: var(--line-2); cursor: default; box-shadow: none; }
.rev-carte-vide .rev-carte-ic { filter: grayscale(.6); opacity: .8; }
.rev-carte-ic { font-size: 26px; flex-shrink: 0; width: 34px; text-align: center; }
.rev-carte-tx { flex: 1; min-width: 0; }
.rev-carte-tx b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.rev-carte-tx small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.rev-carte-fl { font-size: 26px; font-weight: 700; color: var(--safety-yellow); flex-shrink: 0; }
.rev-carte-examen .rev-carte-fl { color: var(--success); }
.rev-pastille {
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 800;
  border-radius: 10px; padding: 1px 8px; line-height: 18px;
}

/* ---------- Session points faibles ---------- */
.rev-etiquette {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  color: var(--on-accent); background: var(--safety-yellow);
  border-radius: 12px; padding: 5px 10px; margin-bottom: 8px; line-height: 1.4;
}
.rev-reste { font-weight: 700; margin: 4px 0; }
.rev-note { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 6px 0; }

/* ---------- Configuration de l'examen ---------- */
.rev-config { display: flex; flex-direction: column; text-align: center; }
.rev-config h2 { margin: 4px 0 4px; }
.rev-intro { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 6px; }
.rev-config .field-label { margin-bottom: 6px; }
.rev-select {
  width: 100%; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--dark-2); color: var(--text);
  font-size: 16px; font-family: inherit;
}
.rev-puces { display: flex; gap: 8px; flex-wrap: wrap; }
.rev-puce {
  flex: 1; min-width: 64px; background: var(--dark-2); color: var(--text);
  border: 2px solid var(--line); border-radius: 12px; padding: 11px 6px;
  font-size: 14px; font-weight: 700;
}
.rev-puce.on { background: var(--safety-yellow); color: var(--on-accent); border-color: var(--safety-yellow); }
.rev-resume {
  background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  margin-top: 16px; text-align: left;
}
.rev-resume p { margin: 4px 0; }
.rev-config .cta:disabled { opacity: .4; }

/* ---------- Historique ---------- */
.rev-histo { margin-top: 22px; text-align: left; border-top: 1px solid var(--line); padding-top: 14px; }
.rev-histo-tete { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 8px; }
.rev-histo-tete span { font-size: 12.5px; color: var(--safety-yellow); font-weight: 700; }
.rev-histo-ligne { display: grid; grid-template-columns: 52px 1fr 64px 44px; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 0; }
.rev-histo-date { color: var(--muted); }
.rev-histo-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-histo-barre { height: 8px; background: var(--dark-2); border-radius: 5px; overflow: hidden; }
.rev-histo-barre span { display: block; height: 100%; background: var(--danger); border-radius: 5px; }
.rev-histo-barre span.ok { background: var(--success); }
.rev-histo-p { text-align: right; font-weight: 800; }
.rev-histo-p.ok, .rev-det-tete .ok { color: var(--success); }
.rev-histo-p.ko, .rev-det-tete .ko { color: var(--ko); }

/* ---------- Barre d'examen (chrono) ---------- */
.rev-barre {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px 8px;
}
.rev-quitter { background: var(--card); color: var(--muted); padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.rev-chrono {
  font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--safety-yellow); color: var(--on-accent); padding: 6px 14px; border-radius: 12px;
}
.rev-chrono.urgent { background: var(--danger); color: #fff; animation: rev-pouls 1s ease-in-out infinite alternate; }
@keyframes rev-pouls { from { transform: scale(1); } to { transform: scale(1.06); } }
.rev-compte { font-size: 13px; color: var(--muted); font-weight: 700; min-width: 54px; text-align: right; }
.rev-piste { height: 5px; background: var(--dark-2); margin: 0 16px 8px; border-radius: 3px; overflow: hidden; }
.rev-piste-fill { height: 100%; background: var(--safety-yellow); transition: width .5s linear; }

/* ---------- Question d'examen ---------- */
.rev-q-tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rev-q-tete .quiz-progress { margin: 0; }
.rev-q-comp { font-size: 12px; color: var(--muted); }
.rev-marquer {
  width: 100%; margin-top: 14px; background: var(--dark-2); color: var(--muted);
  border: 2px dashed var(--line-2); border-radius: 12px; padding: 11px; font-size: 14px; font-weight: 700;
}
.rev-marquer.on { color: var(--on-accent); background: var(--flag); border: 2px solid var(--flag); }
.rev-apercu { width: 100%; }
.rev-exam .quiz-nav { align-items: center; gap: 10px; }
.rev-exam .quiz-nav .cta, .rev-exam .quiz-nav .secondary { margin-top: 0; }

/* ---------- Récapitulatif ---------- */
.rev-recap { text-align: center; display: flex; flex-direction: column; }
.rev-recap h2 { margin: 6px 0 4px; }
.rev-recap-stats { margin: 4px 0; }
.rev-marq-tx { color: var(--flag); font-weight: 700; }
.rev-grille { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.rev-case {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px; font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.rev-case.rep { background: var(--safety-yellow); color: var(--on-accent); }
.rev-case.vide { background: var(--dark-2); color: var(--text); border: 2px solid var(--line-2); }
.rev-case.marq { background: var(--flag); color: var(--on-accent); border: 2px solid var(--flag); }
.rev-case i { position: absolute; top: -6px; right: -4px; font-style: normal; font-size: 13px; }
.rev-legende { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.rev-legende span { display: flex; align-items: center; gap: 5px; }
.rev-legende .rev-case { width: 14px; height: 14px; aspect-ratio: auto; border-radius: 4px; display: inline-block; }

/* ---------- Résultat ---------- */
.rev-auto { background: var(--flag); color: var(--on-accent); font-weight: 700; border-radius: var(--radius); padding: 10px 12px; font-size: 14px; }
.rev-note-finale { font-size: 54px; font-weight: 900; line-height: 1; margin: 6px 0 0; }
.rev-note-finale.ok { color: var(--success); }
.rev-note-finale.ko { color: var(--ko); }
.rev-seuil { position: relative; height: 14px; background: var(--dark-2); border-radius: 8px; margin: 18px 4px 26px; }
.rev-seuil-fill { height: 100%; border-radius: 8px; background: var(--danger); }
.rev-seuil-fill.ok { background: var(--success); }
.rev-seuil-ligne { position: absolute; top: -5px; bottom: -5px; width: 3px; background: var(--text); border-radius: 2px; transform: translateX(-50%); }
.rev-seuil-ligne span { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; }
.rev-det { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.rev-det-tete { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.rev-det-niv { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.rev-corr-barre { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.rev-corr-barre .review-title { margin: 0; }
.rev-corr-barre .rev-puce { flex: 0 0 auto; font-size: 12px; padding: 8px 10px; }
.rev-corr { border-left: 4px solid var(--line-2); }
.rev-corr.ok { border-left-color: var(--success); }
.rev-corr.ko { border-left-color: var(--danger); }
.rev-corr-tete { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.rev-corr.ok .rev-corr-tete { color: var(--success); }
.rev-corr.ko .rev-corr-tete { color: var(--ko); }

/* ===== SASIQuest 2.0 — nouvelles formes (après les règles ci-dessus) ===== */
/* --- Cartes d'entrée 2.0 : icône en médaillon --- */
.rev-carte { border-radius: 20px; border-left-width: 1px; }
.rev-carte-ic {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); font-size: 24px;
}
.rev-carte-examen .rev-carte-ic { background: var(--ok-soft); }
.rev-carte-fl { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--accent-soft); }
.rev-carte-examen .rev-carte-fl { background: var(--ok-soft); }
.rev-puce { border-radius: 999px; }
.rev-chrono { border-radius: 999px; }
.rev-marquer { border-radius: 999px; }
.rev-case { border-radius: 50%; aspect-ratio: 1; }

/* ===== 2.0 — les deux cartes en tuiles côte à côte, en haut de l'accueil ===== */
.rev-cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 16px; }
.rev-carte {
  position: relative; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 14px 14px 16px; min-height: 138px; border-left-width: 1px;
}
.rev-carte-faibles { border-top: 4px solid var(--safety-yellow); }
.rev-carte-examen { border-top: 4px solid var(--success); }
.rev-carte-vide { border-top: 4px solid var(--line-2); }
.rev-carte-tx b { font-size: 15px; line-height: 1.2; flex-wrap: wrap; }
.rev-carte-tx small { font-size: 12px; }
.rev-carte-fl { position: absolute; top: 14px; right: 12px; }
.rev-pastille { position: absolute; top: 12px; right: 12px; font-size: 13px; padding: 2px 9px; }
.rev-carte-faibles .rev-carte-fl { display: none; }
