/* Quiz v2 (26/11/2026) : lancement en un clic, écran question épuré, nouvel écran de résultats.
   Charge après quiz-launch.css, quiz-simplifie.css et charte-v2.css. Le moteur du quiz n'est pas modifié. */

/* ---------- Accueil : cartes « Commencer » ---------- */
.qs-heading { justify-content: center; text-align: center; margin: 8px 0 22px; }
.qs-heading h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.qs-heading p { margin-top: 6px; }
.qs-heading .bank-proof { display: none; }
.qs-start { text-align: center; margin-bottom: 26px; }
.qs-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.qs-card { display: flex; flex-direction: column; gap: 9px; text-align: left; padding: 22px; border-radius: 20px; cursor: pointer; font: inherit;
  background: var(--bg-surface); border: 1px solid var(--saas-border); color: var(--text-primary);
  box-shadow: 0 18px 36px -28px rgba(17, 24, 39, .35); transition: transform .15s, box-shadow .15s, border-color .15s; }
.qs-card:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -26px rgba(17, 24, 39, .4); }
.qs-card:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; }
.qs-card strong { font: 700 1.2rem var(--font-display); }
.qs-desc { color: var(--text-secondary); font-size: .9rem; line-height: 1.45; flex: 1; }
.qs-tag { align-self: flex-start; font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.qs-go { margin-top: 4px; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; color: #fff; }
.qs-card.y .qs-tag { background: var(--v2-yellow-bg, #fef3c7); color: var(--v2-yellow-ink, #92400e); } .qs-card.y .qs-go { background: #c2680a; }
.qs-card.g .qs-tag { background: var(--v2-green-bg, #d1fae5); color: var(--v2-green-ink, #065f46); } .qs-card.g .qs-go { background: #04785a; }
.qs-card.k .qs-tag { background: var(--v2-black-bg, #e5e7eb); color: var(--v2-black-ink, #1f2937); } .qs-card.k .qs-go { background: #374151; }
.qs-card.y:hover { border-color: #f59e0b; } .qs-card.g:hover { border-color: #10b981; } .qs-card.k:hover { border-color: #6b7280; }
.qs-custom { border: 0; background: none; font: inherit; font-weight: 700; color: var(--color-secondary); cursor: pointer; padding: 8px 6px; min-height: 44px; }
.qs-custom:hover { text-decoration: underline; }
.qs-info { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin: 8px 0 0; font-size: .87rem; color: var(--text-secondary); }
.qs-info a { color: var(--color-secondary); font-weight: 700; }

/* Le panneau de réglages complet n'apparaît que sur demande (« Personnaliser ») ou pendant une session. */
.quiz-app:not(.show-custom):not(.has-session) .app-shell { display: none; }
.quiz-app.has-session .qs-start, .quiz-app.has-session .qs-heading { display: none; }
.quiz-app.show-custom .flowline { display: none; }

/* ---------- Écran d'une question ---------- */
.quiz-app.has-session .app-shell { max-width: 980px; margin: 0 auto; background: transparent; border: 0; box-shadow: none; }
.question-layout { display: block; max-width: 760px; margin: 0 auto; }
.question-aside { display: none !important; }
.question-main { background: var(--bg-surface); border: 1px solid var(--saas-border); border-radius: 22px; padding: 28px; box-shadow: 0 24px 50px -34px rgba(15, 107, 100, .45); }
.question-meta { font-size: .84rem; }
.question-main progress { width: 100%; height: 7px; accent-color: var(--color-secondary); border-radius: 99px; margin: 8px 0 18px; }
.question-title { font: 700 1.3rem/1.4 var(--font-display); }
.answer-option { border-radius: 13px; border-width: 1.5px; }
.answer-letter { border-radius: 8px; font-weight: 800; }
.answer-option.is-correct { border-color: #16a34a; background: rgba(22, 163, 74, .08); }
.answer-option.is-wrong { border-color: #dc2626; background: rgba(220, 38, 38, .07); }
.correction-panel { border-left: 4px solid var(--color-secondary); border-radius: 10px; }
.answer-actions .btn { min-width: 220px; }
.session-toolbar { max-width: 980px; margin: 0 auto 6px; }

/* ---------- Écran de résultats ---------- */
.rv2 { padding: 6px 0 10px; }
.rv2-eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-secondary); font-weight: 700; margin: 0 0 8px; }
.rv2 h2 { font: 800 clamp(1.6rem, 3.2vw, 2.3rem)/1.15 var(--font-display); margin: 0 0 8px; letter-spacing: -.02em; }
.rv2-sub { color: var(--text-secondary); margin: 0 0 22px; }
.rv2-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.rv2-score, .rv2-panel { background: var(--bg-surface); border: 1px solid var(--saas-border); border-radius: 22px; padding: 22px; }
.rv2-score { text-align: center; }
.rv2-ring { width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--color-secondary) 0 var(--pct), var(--saas-border) var(--pct) 100%); }
.rv2-ring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--bg-surface); }
.rv2-ring div { position: relative; z-index: 1; }
.rv2-ring strong { display: block; font: 800 2.2rem/1 var(--font-display); }
.rv2-ring span { color: var(--text-secondary); font-size: .85rem; }
.rv2-verdict { font: 700 1.12rem var(--font-display); margin: 0 0 6px; }
.rv2-score p { color: var(--text-secondary); font-size: .88rem; line-height: 1.5; margin: 0 0 6px; }
.rv2-score small { color: var(--text-muted); font-size: .76rem; }
.rv2-panel { margin-bottom: 16px; }
.rv2-panel h3 { font: 700 1.08rem var(--font-display); margin: 0 0 10px; }
.rv2-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--saas-border); font-size: .93rem; }
.rv2-row:first-of-type { border-top: 0; }
.rv2-row .bar { height: 7px; border-radius: 99px; background: var(--saas-border); overflow: hidden; }
.rv2-row .bar i { display: block; height: 100%; border-radius: 99px; }
.rv2-row a { color: var(--color-secondary); font-weight: 700; font-size: .86rem; white-space: nowrap; }
.rv2-row .ok { color: var(--text-muted); font-size: .86rem; white-space: nowrap; }
.rv2-next { border-radius: 22px; padding: 22px; border: 1.5px solid #6ee7b7; background: linear-gradient(150deg, rgba(16, 185, 129, .10), var(--bg-surface) 60%); }
.rv2-next.is-yellow { border-color: #fcd34d; background: linear-gradient(150deg, rgba(245, 158, 11, .10), var(--bg-surface) 60%); }
.rv2-next h3 { font: 800 1.2rem var(--font-display); margin: 0 0 8px; }
.rv2-next p { color: var(--text-secondary); margin: 0 0 14px; line-height: 1.55; }
.rv2-next ul { margin: 0 0 16px; padding-left: 1.2rem; line-height: 1.75; font-size: .93rem; }
.rv2-next small { display: block; color: var(--text-muted); margin: -4px 0 14px; font-size: .8rem; }
.rv2-next .secondary { margin: 12px 0 0; font-size: .88rem; }
.rv2-next .secondary a { color: var(--color-secondary); font-weight: 700; }
.rv2-meta { color: var(--text-muted); font-size: .82rem; margin: 14px 0 0; }
.rv2-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

@media (max-width: 860px) {
  .qs-cards, .rv2-grid { grid-template-columns: 1fr; }
  .qs-card { padding: 18px; }
  .question-main { padding: 20px 16px; }
  .rv2-row { grid-template-columns: minmax(0, 1fr) 54px; }
  .rv2-row > :last-child { grid-column: 1 / -1; justify-self: start; }
  .rv2-actions .btn, .rv2-next .btn { width: 100%; }
}

/* --- Corrections du 26/11 (retours visuels) --- */
/* Résultats : marges intérieures pour que le texte ne touche plus le bord de la carte */
.result-dashboard.rv2 { padding: 30px 36px 36px; }
/* Le titre reçoit le focus pour les lecteurs d'écran : pas de cadre bleu visible (focus programmatique) */
#quizResultHeading:focus, #questionTitle:focus { outline: none; }
/* Les repères « ✓ Niveau ✓ Mode Question » n'ont plus de sens avec le lancement en un clic */
.session-flow { display: none !important; }
.session-toolbar { padding-left: 36px; padding-right: 36px; }
@media (max-width: 860px) {
  .result-dashboard.rv2 { padding: 22px 18px 26px; }
  .session-toolbar { padding-left: 18px; padding-right: 18px; }
}

/* Bloc « Un QCM pour apprendre » : trois cartes au lieu d'un pavé de texte */
.qs-why { max-width: none; margin: 40px 0 0; text-align: center; font-size: 1rem; line-height: 1.6; }
.qs-why h2 { font: 800 clamp(1.3rem, 2.6vw, 1.8rem)/1.25 var(--font-display); margin: 0 0 22px; }
.qs-why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; text-align: left; }
.qs-why-grid > div { background: var(--bg-surface); border: 1px solid var(--saas-border); border-radius: 18px; padding: 20px; }
.qs-why-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--bg-surface-light); font-size: 1.1rem; margin-bottom: 10px; }
.qs-why-grid strong { display: block; font: 700 1.05rem var(--font-display); color: var(--text-primary); margin-bottom: 6px; }
.qs-why-grid p { margin: 0; color: var(--text-secondary); font-size: .92rem; line-height: 1.55; }
.qs-why-grid a, .qs-why-foot a { color: var(--color-secondary); font-weight: 700; }
.qs-why-foot { margin: 18px 0 0; color: var(--text-muted); font-size: .86rem; }
@media (max-width: 860px) { .qs-why-grid { grid-template-columns: 1fr; } }
/* L'écran question est déjà dans la carte de session : pas de deuxième carte imbriquée */
.question-main { background: transparent; border: 0; box-shadow: none; padding: 8px 36px 32px; }
#quizSession { border-radius: 22px; box-shadow: 0 24px 50px -34px rgba(15, 107, 100, .40); }
/* Mot en gras à l'intérieur d'un paragraphe des cartes : reste dans la ligne */
.qs-why-grid p strong { display: inline; font: inherit; font-weight: 700; margin: 0; }
@media (max-width: 860px) { .question-main { padding: 6px 18px 24px; } }

/* --- « Un QCM pour apprendre » v2 : question annotée + jauge (remplace les 3 cartes à icônes) --- */
.qs-why-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 28px; align-items: center; text-align: left; }
.qs-anatomy { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 36px; align-items: center; }
.qs-anatomy-card { position: relative; background: var(--bg-surface); border: 1px solid var(--saas-border); border-radius: 18px; padding: 18px;
  box-shadow: 0 24px 46px -30px rgba(15, 107, 100, .45); transform: rotate(-1deg); }
.qs-anatomy-meta { position: relative; padding-right: 20px; display: flex; justify-content: space-between; font-size: .76rem; color: var(--text-muted); margin-bottom: 8px; }
.qs-anatomy-q { font: 700 1rem/1.4 var(--font-display); color: var(--text-primary); margin: 0 0 10px; }
.qs-anatomy-opt { font-size: .84rem; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--saas-border); margin-bottom: 6px; color: var(--text-primary); }
.qs-anatomy-opt.is-wrong { border-color: #dc2626; background: rgba(220, 38, 38, .07); }
.qs-anatomy-opt.is-right { border-color: #16a34a; background: rgba(22, 163, 74, .08); font-weight: 600; }
.qs-anatomy-expl { position: relative; font-size: .82rem; line-height: 1.5; color: var(--text-secondary); border-left: 3px solid var(--color-secondary);
  background: var(--bg-surface-light); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.qs-anatomy-link { position: relative; font-size: .84rem; font-weight: 700; color: var(--color-secondary); margin-top: 10px; }
.qs-pin { position: absolute; right: -13px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font: 800 .78rem var(--font-display); color: #fff; background: var(--color-secondary);
  box-shadow: 0 0 0 4px var(--bg-dark); }
.qs-anatomy-meta .qs-pin { top: 6px; }
.qs-anatomy figcaption ol { margin: 0; padding: 0; list-style: none; counter-reset: pin; display: grid; gap: 12px; }
.qs-anatomy figcaption li { counter-increment: pin; position: relative; padding-left: 34px; font-size: .9rem; line-height: 1.45; color: var(--text-secondary); }
.qs-anatomy figcaption li::before { content: counter(pin); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font: 800 .78rem var(--font-display); color: #fff; background: var(--color-secondary); }
.qs-anatomy figcaption strong { color: var(--text-primary); }

/* Jauge 15 → 50 → 350+ : une échelle de mesure, avec des repères en pointillés comme des limites */
.qs-gauge { background: var(--bg-surface); border: 1px solid var(--saas-border); border-radius: 18px; padding: 20px 22px; }
.qs-gauge-title { font: 700 1.05rem var(--font-display); color: var(--text-primary); margin: 0 0 14px; }
.qs-gauge-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--saas-border); margin-bottom: 4px; }
.qs-gauge-bar i { display: block; height: 100%; border-right: 2px dashed var(--bg-surface); }
.qs-gauge-bar i:nth-child(1) { background: #d97706; } .qs-gauge-bar i:nth-child(2) { background: #059669; } .qs-gauge-bar i:nth-child(3) { background: var(--color-secondary); border-right: 0; opacity: .85; }
.qs-gauge-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.qs-gauge-steps li { display: grid; grid-template-columns: 64px 1fr; column-gap: 12px; align-items: baseline; }
.qs-gauge-steps strong { grid-row: span 2; font: 800 1.6rem/1 var(--font-display); color: var(--text-primary); }
.qs-gauge-steps li:nth-child(1) strong { color: #b45309; } .qs-gauge-steps li:nth-child(2) strong { color: #047857; } .qs-gauge-steps li:nth-child(3) strong { color: var(--color-secondary); }
.qs-gauge-steps span { font-weight: 700; color: var(--text-primary); font-size: .93rem; }
.qs-gauge-steps small { color: var(--text-secondary); font-size: .82rem; line-height: 1.45; }
.qs-gauge-steps a { color: var(--color-secondary); font-weight: 700; }
.qs-gauge-note { margin: 14px 0 0; font-size: .8rem; color: var(--text-muted); }
[data-theme="dark"] .qs-gauge-steps li:nth-child(1) strong { color: #fbbf24; }
[data-theme="dark"] .qs-gauge-steps li:nth-child(2) strong { color: #34d399; }

@media (max-width: 980px) {
  .qs-why-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .qs-anatomy { grid-template-columns: 1fr; }
  .qs-anatomy-card { transform: none; margin-right: 14px; }
}
[data-theme="dark"] .qs-pin, [data-theme="dark"] .qs-anatomy figcaption li::before { color: #0b1220; }
