/* ============================================================
   Quiz Engine — styles
   Personnalise les variables CSS --qe-* pour adapter au thème.
   ============================================================ */

.qe-container {
  --qe-accent:       #2563eb;
  --qe-correct:      #16a34a;
  --qe-wrong:        #dc2626;
  --qe-bg:           #f8fafc;
  --qe-border:       #e2e8f0;
  --qe-text:         #1e293b;
  --qe-radius:       10px;
  --qe-font:         inherit;

  font-family: var(--qe-font);
  color: var(--qe-text);
  max-width: 680px;
  margin: 2rem auto;
  background: var(--qe-bg);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* ── Header ─────────────────────────────────────────────────── */

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

.qe-title {
  margin: 0 0 .5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.qe-counter {
  font-size: .8rem;
  color: #64748b;
  display: block;
  margin-bottom: .5rem;
}

.qe-progress {
  height: 6px;
  background: var(--qe-border);
  border-radius: 99px;
  overflow: hidden;
}

.qe-progress-bar {
  height: 100%;
  background: var(--qe-accent);
  border-radius: 99px;
  transition: width .3s ease;
}

/* ── Body ────────────────────────────────────────────────────── */

.qe-body {
  padding: 1.5rem;
}

.qe-question-text {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

/* ── Choix ───────────────────────────────────────────────────── */

.qe-choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.qe-choice {
  margin: 0;
}

.qe-choice-btn {
  width: 100%;
  text-align: left;
  padding: .75rem 1rem;
  background: #fff;
  border: 1.5px solid var(--qe-border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--qe-text);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  line-height: 1.4;
}

.qe-choice-btn:hover:not(:disabled) {
  border-color: var(--qe-accent);
  background: #eff6ff;
}

.qe-choice-btn:disabled {
  cursor: default;
}

.qe-choice-btn.qe-correct {
  border-color: var(--qe-correct);
  background: #f0fdf4;
  color: var(--qe-correct);
  font-weight: 600;
}

.qe-choice-btn.qe-wrong {
  border-color: var(--qe-wrong);
  background: #fef2f2;
  color: var(--qe-wrong);
}

/* ── Explication ─────────────────────────────────────────────── */

.qe-explanation {
  margin: 1rem 0 .75rem;
  padding: .75rem 1rem;
  background: #fefce8;
  border-left: 3px solid #eab308;
  border-radius: 0 6px 6px 0;
  font-size: .9rem;
  line-height: 1.5;
}

/* ── Boutons navigation ──────────────────────────────────────── */

.qe-btn-next,
.qe-btn-restart {
  margin-top: 1rem;
  padding: .7rem 1.4rem;
  background: var(--qe-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}

.qe-btn-next:hover,
.qe-btn-restart:hover {
  opacity: .88;
}

/* ── Résultats ───────────────────────────────────────────────── */

.qe-results {
  padding: 2rem 1.5rem;
  text-align: center;
}

.qe-results--pass { background: #f0fdf4; }
.qe-results--fail { background: #fef2f2; }

.qe-results-label {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .25rem;
}

.qe-results--pass .qe-results-label { color: var(--qe-correct); }
.qe-results--fail .qe-results-label { color: var(--qe-wrong); }

.qe-score {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin: .25rem 0;
}

.qe-results--pass .qe-score { color: var(--qe-correct); }
.qe-results--fail .qe-score { color: var(--qe-wrong); }

.qe-score-detail {
  color: #64748b;
  font-size: .9rem;
  margin: .25rem 0 1.5rem;
}

/* ── Erreurs ─────────────────────────────────────────────────── */

.qe-error {
  color: var(--qe-wrong);
  padding: .75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: .9rem;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 480px) {
  .qe-body    { padding: 1rem; }
  .qe-header  { padding: 1rem 1rem .75rem; }
  .qe-score   { font-size: 2.25rem; }
}
