/* =========================================================================
   Académie — zone questions : niveaux, QCM, questions ouvertes, scores
   ========================================================================= */

.questions {
  margin-top: clamp(96px, 12vw, 140px);
  padding-top: 56px;
  border-top: 1px solid var(--filet);
  scroll-margin-top: calc(var(--entete-h) + 16px);
}
.q-tete .surtitre { margin-bottom: 10px; }
.q-intro { margin-top: 12px; max-width: 560px; color: var(--texte-2); }
.q-niveaux { margin: 30px 0 40px; }
.q-niveaux .segmente { width: 100%; }
.q-contenu { transition: opacity .2s, transform .35s var(--courbe); }
.q-contenu.change { opacity: 0; transform: translateY(10px); }
.q-bloc + .q-bloc { margin-top: 64px; }
.q-bloc-tete { margin-bottom: 18px; }
.q-bloc-tete .titre-3 { margin-top: 8px; }
.q-bloc-note { margin-top: 6px; font-size: 14px; color: var(--texte-2); max-width: 600px; }

/* ---------- QCM ---------- */
.qcm {
  position: relative;
  padding: clamp(20px, 3.4vw, 36px);
  border-radius: 28px;
  background: var(--surface);
}
.qcm-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.qcm-points { display: flex; gap: 6px; }
.qcm-points li {
  width: 8px; height: 8px;
  border-radius: 4px;
  background: var(--filet-2);
  transition: width .45s var(--courbe), background-color .3s;
}
.qcm-points li.courant { width: 24px; background: var(--texte); }
.qcm-points li.juste { background: var(--ok); }
.qcm-points li.faux { background: var(--ko); }
.qcm-corps { transition: opacity .2s, transform .38s var(--courbe); }
.qcm-corps.sortie { opacity: 0; transform: translateX(-18px); }
.qcm-corps.entree { opacity: 0; transform: translateX(18px); transition: none; }
.qcm-partie { margin-bottom: 10px; font-size: 13.5px; color: var(--texte-2); }
.qcm-partie .mono { margin-right: 4px; color: var(--accent-texte); font-weight: 600; }
.qcm-enonce { font-size: clamp(19px, 1.8vw, 22px); font-weight: 600; letter-spacing: -0.018em; line-height: 1.42; }
.qcm-multi { margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-texte); }
.qcm-options { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.opt {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--filet);
  font-size: 16.5px;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .2s, background-color .25s, transform .18s var(--courbe), opacity .3s;
}
.opt:hover { box-shadow: inset 0 0 0 1px var(--texte-2); }
.opt:active { transform: scale(.993); }
.opt:focus-visible { outline-offset: 2px; border-radius: 16px; }
.opt-touche {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--texte-2);
  box-shadow: inset 0 0 0 1.5px var(--filet-2);
  transition: background-color .25s, color .25s, box-shadow .25s, transform .3s var(--courbe);
}
.opt--multi .opt-touche { border-radius: 8px; }
.opt-corps { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.opt.choisie { box-shadow: inset 0 0 0 2px var(--accent); }
.opt.choisie .opt-touche { background: var(--accent-fond, var(--accent)); color: #fff; box-shadow: none; transform: scale(1.05); }
.opt.corrigee { cursor: default; }
.opt.corrigee:hover { box-shadow: inset 0 0 0 1px var(--filet); }
.opt.corrigee:not(.juste):not(.faux) { opacity: .72; }
.opt.juste, .opt.juste:hover { background: var(--ok-fond); box-shadow: inset 0 0 0 2px var(--ok); }
.opt.juste .opt-touche { background: var(--ok); color: #fff; box-shadow: none; }
.opt.oubliee, .opt.oubliee:hover { box-shadow: none; outline: 2px dashed var(--ok); outline-offset: -2px; }
.opt.faux, .opt.faux:hover { background: var(--ko-fond); box-shadow: inset 0 0 0 2px var(--ko); animation: secousse .45s var(--courbe); }
.opt.faux .opt-touche { background: var(--ko); color: #fff; box-shadow: none; }
@keyframes secousse {
  0%, 100% { transform: none; }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
/* Correction : tout ce qui apparaît à la validation s'ouvre en douceur, avec la même
   durée et la même courbe, pour que la carte grandisse d'un seul mouvement (pas de saut). */
.opt-verdict {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: max-height .55s var(--courbe), margin-top .55s var(--courbe), opacity .3s linear .1s;
}
.opt.juste .opt-verdict { max-height: 3.4em; margin-top: 6px; opacity: 1; color: var(--ok); }
.opt.faux .opt-verdict { max-height: 3.4em; margin-top: 6px; opacity: 1; color: var(--ko); }
.opt-pourquoi { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--courbe); }
.opt.corrigee .opt-pourquoi { grid-template-rows: 1fr; }
.opt-pourquoi-int { overflow: hidden; min-height: 0; font-size: 14.5px; line-height: 1.5; color: var(--texte-2); transition: padding-top .55s var(--courbe); }
.opt.corrigee .opt-pourquoi-int { padding-top: 6px; }
.qcm-explication-zone { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--courbe); }
.qcm-explication-zone.deplie { grid-template-rows: 1fr; }
.qcm-explication-int { overflow: hidden; min-height: 0; }
.qcm-explication {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--bg);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s linear .12s, transform .55s var(--courbe);
}
.qcm-explication:empty { padding: 0; margin: 0; }
.qcm-explication-zone.deplie .qcm-explication { opacity: 1; transform: none; }
.qcm-explication .surtitre { margin-bottom: 6px; }
.qcm-ok { color: var(--ok) !important; }
.qcm-ko { color: var(--ko) !important; }
.qcm-pied { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; }
.qcm-aide { font-size: 13px; color: var(--texte-2); }
.qcm-valider { min-width: 140px; }
@media (max-width: 520px) {
  .qcm-aide { display: none; }
  .qcm-pied .bouton { flex: 1; }
  .opt { padding: 13px 14px; gap: 12px; font-size: 16px; }
}

/* Score final */
.qcm-fin { text-align: center; padding: 10px 0 4px; transition: opacity .45s var(--courbe), transform .6s var(--courbe); }
.qcm-fin.entree { opacity: 0; transform: scale(.97); transition: none; }
.score-grand { margin-top: 6px; font-size: clamp(92px, 14vw, 148px); font-weight: 700; letter-spacing: -0.06em; line-height: 1; }
.score-sur { margin-left: .04em; font-size: .42em; letter-spacing: -0.03em; color: var(--texte-2); }
.qcm-points--fin { justify-content: center; margin-top: 18px; }
.qcm-points--fin li { width: 24px; height: 6px; border-radius: 3px; }
.score-msg { max-width: 440px; margin: 20px auto 0; font-size: 18px; line-height: 1.5; }
.score-record { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent-texte); }
.score-record.gris { color: var(--texte-2); font-weight: 500; }
.qcm-fin-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.detail-bloc { margin-top: 34px; text-align: left; }
.detail-bloc .surtitre { margin-bottom: 8px; }
.detail-partie {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 44px;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--filet);
  font-size: 15px;
}
.detail-lien { display: flex; gap: 10px; min-width: 0; }
.detail-lien:hover .detail-titre { color: var(--accent-texte); }
.detail-num { color: var(--texte-2); font-size: 13px; padding-top: 1px; }
.detail-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-barre { height: 4px; border-radius: 2px; background: var(--filet-2); overflow: hidden; }
.detail-barre span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--p)); }
.detail-score { text-align: right; font-weight: 600; }
@media (max-width: 520px) { .detail-partie { grid-template-columns: minmax(0, 1fr) 44px; } .detail-barre { display: none; } }

/* ---------- Questions ouvertes ---------- */
.ouvertes-grille { display: grid; gap: 12px; }
.ouverte {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px var(--filet-2);
}
.ouverte-q { font-size: 19px; font-weight: 600; letter-spacing: -0.016em; line-height: 1.42; }
.ouverte-contexte { padding: 14px 16px; border-radius: 14px; background: var(--surface); font-size: 15.5px; line-height: 1.5; }
.ouverte-contexte .surtitre { margin-bottom: 4px; }
.ouvertes-serie { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 16px; }
.ouvertes-note { flex: 1; min-width: 240px; font-size: 14px; }
.copie-ok { animation: copie .5s var(--courbe); }
@keyframes copie { 40% { transform: scale(.95); } }
@media (max-width: 520px) { .ouverte-actions .bouton, .ouvertes-serie .bouton { width: 100%; white-space: normal; } }
