/* ============================================================
   YOAT Academy — Moteur de QCM intégré
   Style cohérent avec la palette ivoire-terre des leçons.
   ============================================================ */

.qcm-block {
  margin: 56px 0 32px;
  padding: 36px 40px 36px;
  background: var(--ivoire-2, #F5EFE0);
  border-left: 3px solid var(--terre, #A8472A);
  border-radius: 2px;
  font-family: var(--font-body, 'Manrope', -apple-system, sans-serif);
}
.qcm-block * { box-sizing: border-box; }

.qcm-header {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 22px; padding-bottom: 18px;
  border-bottom: 1px solid var(--rule, rgba(26,25,22,0.12));
}
.qcm-badge {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px; color: var(--terre, #A8472A);
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500;
}
.qcm-title {
  font-family: var(--font-display, 'Fraunces', serif);
  font-weight: 500; font-size: 26px; line-height: 1.25;
  color: var(--encre, #1A1916);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  margin: 4px 0;
}
.qcm-title em {
  font-style: italic; color: var(--terre, #A8472A);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}
.qcm-intro {
  font-size: 15px; color: var(--encre-soft, #2E2B26);
  line-height: 1.55; margin-bottom: 22px;
}
.qcm-intro strong { color: var(--encre, #1A1916); font-weight: 600; }
.qcm-threshold {
  font-family: var(--font-mono, monospace);
  font-size: 11px; color: var(--encre-mute, #6F6A60);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.qcm-threshold strong { color: var(--terre, #A8472A); font-weight: 600; }

.qcm-progress {
  background: var(--ivoire, #FAF5EA);
  padding: 14px 20px; margin-bottom: 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono, monospace);
  font-size: 12px; color: var(--encre-mute, #6F6A60);
  letter-spacing: 0.04em; flex-wrap: wrap; gap: 10px;
  border: 1px solid var(--rule, rgba(26,25,22,0.12));
  border-radius: 2px;
}
.qcm-progress strong { color: var(--encre, #1A1916); font-weight: 600; }
.qcm-progress-bar {
  flex: 1; min-width: 100px; margin: 0 12px;
  height: 3px; background: rgba(26,25,22,0.08);
  position: relative; overflow: hidden;
}
.qcm-progress-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--terre, #A8472A); width: 0%;
  transition: width 0.35s ease;
}
.qcm-live-score { color: var(--terre, #A8472A); font-weight: 600; }

.qcm-question {
  margin-bottom: 30px; padding-bottom: 24px;
  border-bottom: 1px solid var(--rule, rgba(26,25,22,0.12));
}
.qcm-question:last-of-type {
  border-bottom: none; padding-bottom: 0; margin-bottom: 8px;
}
.qcm-q-num {
  font-family: var(--font-mono, monospace);
  font-size: 11px; color: var(--terre, #A8472A);
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 10px; font-weight: 500;
}
.qcm-q-text {
  font-family: var(--font-display, serif);
  font-weight: 600; font-size: 19px; line-height: 1.4;
  color: var(--encre, #1A1916);
  font-variation-settings: "opsz" 144, "SOFT" 40;
  margin-bottom: 18px;
}

.qcm-choices { display: flex; flex-direction: column; gap: 8px; }
.qcm-choice {
  background: var(--ivoire, #FAF5EA);
  border: 1px solid var(--rule, rgba(26,25,22,0.12));
  padding: 13px 18px; cursor: pointer;
  font-size: 15px; color: var(--encre-soft, #2E2B26);
  line-height: 1.5; text-align: left;
  transition: all 0.15s ease;
  font-family: inherit; width: 100%;
  border-radius: 2px;
  display: flex; gap: 12px; align-items: flex-start;
}
.qcm-letter {
  font-family: var(--font-mono, monospace);
  font-size: 12px; font-weight: 600;
  color: var(--encre-mute, #6F6A60);
  flex-shrink: 0; padding-top: 2px;
  letter-spacing: 0.04em;
}
.qcm-text { flex: 1; }
.qcm-choice:hover:not(.is-locked) {
  background: var(--ivoire-3, #EDE5D2);
  border-color: var(--rule-strong, rgba(26,25,22,0.24));
}
.qcm-choice.is-locked { cursor: default; }
.qcm-choice.is-correct {
  background: rgba(77,96,83,0.15);
  border-color: #4D6053; color: var(--encre, #1A1916);
}
.qcm-choice.is-correct .qcm-letter { color: #4D6053; }
.qcm-choice.is-incorrect {
  background: rgba(168,71,42,0.10);
  border-color: var(--terre, #A8472A); color: var(--encre, #1A1916);
}
.qcm-choice.is-incorrect .qcm-letter { color: var(--terre, #A8472A); }
.qcm-choice.is-revealed {
  background: rgba(77,96,83,0.10);
  border-color: #4D6053; border-style: dashed;
  color: var(--encre, #1A1916);
}
.qcm-choice.is-revealed .qcm-letter { color: #4D6053; }

.qcm-feedback {
  margin-top: 14px; padding: 14px 18px;
  background: var(--ivoire-3, #EDE5D2);
  border-left: 3px solid var(--terre, #A8472A);
  font-size: 14px; color: var(--encre-soft, #2E2B26);
  line-height: 1.6; display: none;
  border-radius: 0 2px 2px 0;
}
.qcm-feedback.is-shown { display: block; }
.qcm-feedback strong { color: var(--encre, #1A1916); font-weight: 600; }
.qcm-feedback.is-correct {
  border-left-color: #4D6053; background: rgba(77,96,83,0.08);
}
.qcm-feedback.is-incorrect {
  border-left-color: var(--terre, #A8472A); background: rgba(168,71,42,0.06);
}
.qcm-feedback-label { font-weight: 700; color: var(--encre, #1A1916); }
.qcm-feedback.is-correct .qcm-feedback-label { color: #4D6053; }
.qcm-feedback.is-incorrect .qcm-feedback-label { color: var(--terre, #A8472A); }

.qcm-result {
  background: var(--ivoire, #FAF5EA);
  border: 1px solid var(--rule-strong, rgba(26,25,22,0.24));
  padding: 28px 32px; margin-top: 28px;
  display: none; border-radius: 2px;
}
.qcm-result.is-shown { display: block; }
.qcm-result.is-passed {
  border-color: #4D6053;
  background: linear-gradient(0deg, rgba(77,96,83,0.04), rgba(77,96,83,0.04)), var(--ivoire, #FAF5EA);
}
.qcm-result.is-failed {
  border-color: var(--terre, #A8472A);
  background: linear-gradient(0deg, rgba(168,71,42,0.04), rgba(168,71,42,0.04)), var(--ivoire, #FAF5EA);
}
.qcm-result h3 {
  font-family: var(--font-display, serif);
  font-size: 24px; font-weight: 500; margin-bottom: 8px;
  font-variation-settings: "opsz" 144, "SOFT" 60;
  color: var(--encre, #1A1916);
}
.qcm-result.is-passed h3 { color: #4D6053; }
.qcm-result.is-failed h3 { color: var(--terre, #A8472A); }
.qcm-score-display {
  font-family: var(--font-display, serif); font-style: italic;
  font-size: 56px; line-height: 1;
  color: var(--encre, #1A1916);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  margin: 12px 0 4px;
}
.qcm-result.is-passed .qcm-score-display { color: #4D6053; }
.qcm-result.is-failed .qcm-score-display { color: var(--terre, #A8472A); }
.qcm-score-detail {
  font-family: var(--font-mono, monospace);
  font-size: 12px; color: var(--encre-mute, #6F6A60);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 16px;
}
.qcm-result-message {
  font-size: 15px; line-height: 1.55;
  color: var(--encre-soft, #2E2B26); margin-bottom: 18px;
}
.qcm-result-message strong { color: var(--encre, #1A1916); font-weight: 600; }

.qcm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.qcm-btn {
  font-family: var(--font-mono, monospace);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 20px; border-radius: 2px;
  cursor: pointer; transition: all 0.15s ease;
  text-decoration: none; display: inline-flex;
  align-items: center; gap: 8px;
  border: 1px solid var(--rule-strong, rgba(26,25,22,0.24));
  background: transparent; color: var(--encre, #1A1916);
}
.qcm-btn:hover { border-color: var(--terre, #A8472A); color: var(--terre, #A8472A); }
.qcm-btn.is-primary {
  background: var(--terre, #A8472A); color: var(--ivoire, #FAF5EA);
  border-color: var(--terre, #A8472A);
}
.qcm-btn.is-primary:hover {
  background: var(--terre-soft, #C25D3F); color: var(--ivoire, #FAF5EA);
  border-color: var(--terre-soft, #C25D3F);
}
.qcm-btn.is-success {
  background: #4D6053; color: var(--ivoire, #FAF5EA);
  border-color: #4D6053;
}
.qcm-btn.is-success:hover { opacity: 0.92; color: var(--ivoire, #FAF5EA); }
.qcm-btn.is-disabled {
  opacity: 0.4; cursor: not-allowed; pointer-events: none;
}

.qcm-locked-notice {
  margin-top: 22px; padding: 16px 22px;
  background: rgba(168,71,42,0.06);
  border-left: 3px solid var(--terre, #A8472A);
  font-size: 14px; color: var(--encre-soft, #2E2B26);
  line-height: 1.55; border-radius: 0 2px 2px 0;
  display: none;
}
.qcm-locked-notice.is-shown { display: block; }
.qcm-locked-notice strong { color: var(--encre, #1A1916); font-weight: 600; }

@media (max-width: 768px) {
  .qcm-block { padding: 26px 22px; }
  .qcm-title { font-size: 22px; }
  .qcm-q-text { font-size: 17px; }
  .qcm-score-display { font-size: 44px; }
}

/* Index : verrou des leçons non débloquées */
.lesson-card.is-locked {
  opacity: 0.55; pointer-events: none; cursor: not-allowed;
  position: relative;
}
.lesson-card.is-locked::after {
  content: "🔒"; position: absolute; top: 12px; right: 14px;
  font-size: 14px; opacity: 0.7;
}
.lesson-card.is-current {
  border-color: var(--terre, #A8472A) !important;
  box-shadow: 0 0 0 1px var(--terre, #A8472A);
}
.lesson-card.is-acquis::after {
  content: "✓"; position: absolute; top: 10px; right: 14px;
  font-size: 13px; color: #4D6053; font-weight: 700;
}
.lesson-card.is-acquis.is-locked::after { content: "✓"; }

/* Lien "leçon suivante" verrouillé en pied de leçon */
.lesson-nav .nav-link.is-locked,
.deck-end-nav .end-nav-link.is-locked {
  opacity: 0.4 !important; pointer-events: none; cursor: not-allowed;
}

/* ============================================================
   Mode deck (formation 5h chapitrée) :
   le QCM remplace la slide de validation finale.
   ============================================================ */
.slide.slide-validation.is-qcm-slide {
  /* On surcharge le layout flex centré natif pour permettre le scroll. */
  display: block !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  text-align: left;
  padding: 60px 40px 60px;
  overflow-y: auto;
}
.slide.slide-validation.is-qcm-slide .slide-num,
.slide.slide-validation.is-qcm-slide .slide-brand {
  /* On préserve l'identité visuelle des slides */
  position: absolute;
}
.slide.slide-validation.is-qcm-slide .qcm-deck-scroll {
  max-width: 920px;
  margin: 32px auto 0;
  width: 100%;
}
.slide.slide-validation.is-qcm-slide .qcm-block {
  /* Fond légèrement différent dans une slide pour ne pas écraser */
  background: var(--ivoire-2, #F5EFE0);
  margin: 0;
  padding: 32px 36px 36px;
  border-radius: 4px;
}
@media (max-width: 720px) {
  .slide.slide-validation.is-qcm-slide {
    padding: 56px 18px 40px;
  }
  .slide.slide-validation.is-qcm-slide .qcm-block {
    padding: 22px 18px 24px;
  }
}
