/* DA6 : tous les styles du défi restent dans .refonte-quiz. */
.refonte-quiz {
  --rq-ink: var(--ink, #12131c);
  --rq-muted: var(--ink-soft, #454a63);
  --rq-white: var(--white, #fff);
  --rq-cobalt: var(--cobalt, #2130ea);
  --rq-cobalt-deep: var(--cobalt-deep, #111c9c);
  --rq-cobalt-soft: var(--cobalt-soft, #e7e9ff);
  --rq-pink: var(--pink, #ff5ec4);
  --rq-lime: var(--lime, #c8ff3e);
  --rq-border: var(--brd, #e5e7eb);
  --rq-display: var(--display, 'Plus Jakarta Sans', 'Space Grotesk', system-ui, sans-serif);
  --rq-body: var(--body, 'Space Grotesk', system-ui, sans-serif);
  --rq-mono: var(--mono, 'Rubik Mono One', monospace);
  --rq-grid: var(--grid-w, linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px));
  box-sizing: border-box;
  container-type: inline-size;
  width: 100%; min-width: 0;
  margin: 32px 0;
  border: 2px solid var(--rq-cobalt);
  border-radius: 24px;
  background-color: var(--rq-cobalt);
  background-image: var(--rq-grid);
  background-size: 34px 34px;
  color: var(--rq-ink);
  font: 400 16px/1.6 var(--rq-body);
  text-align: left;
  overflow-wrap: anywhere;
  color-scheme: light;
}
.refonte-quiz *, .refonte-quiz *::before, .refonte-quiz *::after { box-sizing: border-box; }
.refonte-quiz [hidden] { display: none !important; }
.refonte-quiz a { color: var(--rq-cobalt); text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.refonte-quiz a:hover { text-decoration-thickness: 2px; }
.refonte-quiz :is(button, textarea) { font: inherit; }
.refonte-quiz :is(button, a, summary) { touch-action: manipulation; }
.refonte-quiz :focus-visible { outline: 3px solid var(--rq-cobalt); outline-offset: 4px; }
.refonte-quiz .refonte-quiz__choice[data-choice-state]:focus-visible, .refonte-quiz .refonte-quiz__feedback :focus-visible { outline-color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__intro { padding: clamp(20px, 4cqi, 34px); border-radius: 22px 22px 0 0; background-color: var(--rq-cobalt); background-image: var(--rq-grid); background-size: 34px 34px; color: var(--rq-white); border-bottom: 1px solid var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__eyebrow { margin: 0 0 13px; color: var(--rq-white); font: 400 10px/1.5 var(--rq-mono); letter-spacing: .05em; text-transform: uppercase; }
.refonte-quiz .refonte-quiz__title { margin: 0; padding: 0; color: var(--rq-white); font: 800 clamp(28px, 4.5cqi, 43px)/1.13 var(--rq-display); letter-spacing: -.04em; }
.refonte-quiz .refonte-quiz__title > span { color: var(--rq-lime); }
.refonte-quiz .refonte-quiz__dot { color: var(--rq-pink); }
.refonte-quiz .refonte-quiz__intro-text { margin: 16px 0 0; color: var(--rq-white); font-size: 16px; line-height: 1.6; }
.refonte-quiz .refonte-quiz__privacy { margin: 13px 0 0; color: var(--rq-white); font-size: 12px; line-height: 1.7; }
.refonte-quiz .refonte-quiz__board { min-width: 0; padding: clamp(16px, 3cqi, 28px); border-radius: 0 0 22px 22px; }
.refonte-quiz .refonte-quiz__fallback { min-width: 0; margin: clamp(16px, 3cqi, 28px); padding: clamp(16px, 3cqi, 28px); border: 2px solid var(--rq-cobalt); border-radius: 22px; background: var(--rq-white); }
.refonte-quiz .refonte-quiz__fallback h4 { margin: 0 0 16px; font: 800 21px/1.3 var(--rq-display); color: var(--rq-ink); }
.refonte-quiz .refonte-quiz__fallback li { margin: 10px 0; }
.refonte-quiz .refonte-quiz__fallback a { display: inline-block; padding: 6px 0; min-height: 44px; }
.refonte-quiz .refonte-quiz__toolbar { padding: 20px; margin-bottom: 24px; border: 2px solid var(--rq-cobalt); border-radius: 22px; background: var(--rq-white); }
.refonte-quiz .refonte-quiz__counter { margin: 0 0 12px; color: var(--rq-cobalt); font: 800 16px/1.5 var(--rq-display); }
.refonte-quiz .refonte-quiz__progress { appearance: none; display: block; width: 100%; height: 6px; margin: 0; border: 0; border-radius: 6px; background: var(--rq-cobalt-soft); accent-color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__progress::-webkit-progress-bar { background: var(--rq-cobalt-soft); border-radius: 6px; }
.refonte-quiz .refonte-quiz__progress::-webkit-progress-value { background: var(--rq-cobalt); border-radius: 6px; }
.refonte-quiz .refonte-quiz__progress::-moz-progress-bar { background: var(--rq-cobalt); border-radius: 6px; }
.refonte-quiz .refonte-quiz__instructions { margin: 14px 0 0; color: var(--rq-muted); font-size: 13px; line-height: 1.65; }
.refonte-quiz .refonte-quiz__cards { display: grid; gap: 24px; }
.refonte-quiz .refonte-quiz__card { min-width: 0; padding: clamp(16px, 3.5cqi, 30px); border: 2px solid var(--rq-border); border-radius: 22px; background: var(--rq-white); }
.refonte-quiz .refonte-quiz__card-head { display: flex; gap: 12px; align-items: center; }
.refonte-quiz .refonte-quiz__number { display: inline-flex; flex: 0 0 48px; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 14px; background-color: var(--rq-cobalt); background-image: var(--rq-grid); background-size: 34px 34px; color: var(--rq-white); font: 800 18px/1 var(--rq-display); }
.refonte-quiz .refonte-quiz__theme { color: var(--rq-muted); font-size: 13px; font-weight: 500; }
.refonte-quiz .refonte-quiz__question { margin: 16px 0 22px; padding: 0; color: var(--rq-ink); font: 800 clamp(21px, 3.1cqi, 27px)/1.3 var(--rq-display); letter-spacing: -.025em; scroll-margin-top: 100px; }
.refonte-quiz .refonte-quiz__choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.refonte-quiz .refonte-quiz__choice { position: relative; display: flex; width: 100%; min-width: 0; min-height: 64px; gap: 12px; align-items: flex-start; margin: 0; padding: 15px 14px; border: 2px solid var(--rq-cobalt); border-radius: 9px; background: var(--rq-white); color: var(--rq-ink); text-align: left; cursor: pointer; font: 800 14px/1.5 var(--rq-display); transition: transform 150ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)); }
.refonte-quiz .refonte-quiz__choice:hover:not([aria-disabled="true"]) { transform: translateY(-2px); }
.refonte-quiz .refonte-quiz__choice-letter { flex: 0 0 25px; width: 25px; height: 25px; display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--rq-cobalt); border-radius: 7px; color: var(--rq-cobalt); font-size: 12px; }
.refonte-quiz .refonte-quiz__choice-copy { display: grid; gap: 8px; min-width: 0; }
.refonte-quiz .refonte-quiz__choice[aria-disabled="true"] { cursor: default; }
.refonte-quiz .refonte-quiz__choice[data-choice-state="correct"] { border-color: var(--rq-cobalt); background: var(--rq-lime); color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__choice[data-choice-state="wrong"] { border-color: var(--rq-cobalt); background: var(--rq-white); color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__choice[data-choice-state="wrong"]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; border-radius: 7px 0 0 7px; background: var(--rq-pink); pointer-events: none; }
.refonte-quiz .refonte-quiz__choice[data-choice-state] .refonte-quiz__choice-letter { border-color: var(--rq-cobalt); color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__choice-mark { color: var(--rq-cobalt); font: 700 12px/1.5 var(--rq-body); }
.refonte-quiz .refonte-quiz__choice[data-choice-state="wrong"] .refonte-quiz__choice-mark { color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__feedback { margin-top: 22px; padding: 14px 16px; border: 2px solid var(--rq-cobalt); border-radius: 12px; background: var(--rq-white); color: var(--rq-ink); }
.refonte-quiz .refonte-quiz__feedback[data-correct="false"] { background: var(--rq-white); }
.refonte-quiz .refonte-quiz__feedback p { margin: 12px 0; font-size: 14px; line-height: 1.65; }
.refonte-quiz .refonte-quiz__feedback-title { color: var(--rq-ink); }
.refonte-quiz .refonte-quiz__feedback-title > strong { display: inline-block; margin-right: 6px; padding: 4px 8px; border: 1px solid var(--rq-cobalt); border-radius: 7px; background: var(--rq-lime); color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__feedback[data-correct="false"] .refonte-quiz__feedback-title > strong { background: var(--rq-white); color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__feedback[data-correct="false"] .refonte-quiz__feedback-title > strong::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; background: var(--rq-pink); }
.refonte-quiz .refonte-quiz__feedback a { display: inline-block; min-height: 44px; padding: 9px 0; color: var(--rq-cobalt); font-size: 14px; font-weight: 700; }
.refonte-quiz .refonte-quiz__lock-note { margin-bottom: 0 !important; color: var(--rq-muted); font-size: 12px !important; }
.refonte-quiz .refonte-quiz__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin-top: 24px; }
.refonte-quiz .refonte-quiz__actions--toolbar { margin-top: 16px; justify-content: space-between; }
.refonte-quiz .refonte-quiz__button { display: inline-flex; justify-content: center; align-items: center; min-width: 0; min-height: 48px; gap: 8px; padding: 13px 18px; border: 2px solid var(--rq-cobalt); border-radius: 9px; background: var(--rq-cobalt); color: var(--rq-white); font: 800 14px/1.45 var(--rq-display); text-align: center; text-decoration: none; cursor: pointer; transition: transform 150ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)); }
.refonte-quiz .refonte-quiz__button--secondary { background: var(--rq-white); color: var(--rq-cobalt); }
.refonte-quiz .refonte-quiz__button:hover:not(:disabled) { transform: translateY(-2px); }
.refonte-quiz .refonte-quiz__choice:active:not([aria-disabled="true"]), .refonte-quiz .refonte-quiz__button:active:not(:disabled) { transform: translateY(1px); }
.refonte-quiz .refonte-quiz__button:disabled { border-color: var(--rq-cobalt); color: var(--rq-muted); background: var(--rq-white); cursor: default; }
.refonte-quiz .refonte-quiz__result { margin-top: 32px; padding: clamp(18px, 3.5cqi, 30px); border: 2px solid var(--rq-cobalt); border-radius: 22px; background: var(--rq-white); min-width: 0; }
.refonte-quiz .refonte-quiz__tag { display: inline-block; padding: 6px 10px; border-radius: 7px; color: var(--rq-cobalt); background: var(--rq-cobalt-soft); font-size: 12px; font-weight: 700; }
.refonte-quiz .refonte-quiz__result-title { margin: 20px 0; padding: 0; color: var(--rq-ink); font: 800 clamp(25px, 3.5cqi, 35px)/1.2 var(--rq-display); letter-spacing: -.035em; scroll-margin-top: 100px; }
.refonte-quiz .refonte-quiz__result > p { margin: 16px 0; }
.refonte-quiz .refonte-quiz__score { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.refonte-quiz .refonte-quiz__score > strong { color: var(--rq-cobalt); font: 800 40px/1.1 var(--rq-display); letter-spacing: -.035em; }
.refonte-quiz .refonte-quiz__score > span { color: var(--rq-muted); font-size: 14px; }
.refonte-quiz .refonte-quiz__notice { padding: 14px 0; border-top: 1px solid var(--rq-border); border-bottom: 1px solid var(--rq-border); color: var(--rq-muted); font-size: 13px; }
.refonte-quiz .refonte-quiz__subheading { margin: 30px 0 14px; color: var(--rq-ink); font: 800 21px/1.3 var(--rq-display); letter-spacing: -.025em; }
.refonte-quiz .refonte-quiz__small { margin: 15px 0; color: var(--rq-muted); font-size: 13px; line-height: 1.65; }
.refonte-quiz .refonte-quiz__priorities { margin: 20px 0 0; padding-left: 22px; }
.refonte-quiz .refonte-quiz__priority { padding: 0 0 16px 5px; margin-bottom: 16px; border-bottom: 1px solid var(--rq-border); }
.refonte-quiz .refonte-quiz__priority::marker { color: var(--rq-cobalt); font-weight: 700; }
.refonte-quiz .refonte-quiz__priority > strong { display: block; font: 800 16px/1.45 var(--rq-display); }
.refonte-quiz .refonte-quiz__priority p { margin: 10px 0; color: var(--rq-muted); font-size: 14px; }
.refonte-quiz .refonte-quiz__priority a { display: inline-block; min-height: 44px; padding: 9px 0; font-weight: 700; font-size: 14px; }
.refonte-quiz .refonte-quiz__correction { padding: 0; border: 0; border-bottom: 1px solid var(--rq-border); }
.refonte-quiz .refonte-quiz__correction > summary { min-height: 52px; padding: 15px 0; color: var(--rq-ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.refonte-quiz .refonte-quiz__correction-status { display: block; width: fit-content; max-width: 100%; margin: 4px 0 0 19px; padding: 4px 8px; border: 1px solid var(--rq-cobalt); border-radius: 7px; background: var(--rq-white); color: var(--rq-cobalt); font-size: 12px; font-weight: 700; }
.refonte-quiz .refonte-quiz__correction[data-correct="true"] .refonte-quiz__correction-status { background: var(--rq-lime); }
.refonte-quiz .refonte-quiz__correction[data-correct="false"] .refonte-quiz__correction-status { background: var(--rq-white); }
.refonte-quiz .refonte-quiz__correction[data-correct="false"] .refonte-quiz__correction-status::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; background: var(--rq-pink); }
.refonte-quiz .refonte-quiz__correction p { font-size: 14px; margin: 12px 0; }
.refonte-quiz .refonte-quiz__correction a { display: inline-block; padding: 9px 0; min-height: 44px; font-size: 14px; }
.refonte-quiz .refonte-quiz__recap { margin-top: 28px; padding: 12px 0; border-top: 1px solid var(--rq-border); border-bottom: 1px solid var(--rq-border); }
.refonte-quiz .refonte-quiz__recap > summary { padding: 10px 0; min-height: 44px; color: var(--rq-cobalt); font-weight: 700; cursor: pointer; }
.refonte-quiz .refonte-quiz__recap label { display: block; margin-top: 18px; }
.refonte-quiz .refonte-quiz__summary { display: block; width: 100%; min-height: 220px; resize: vertical; margin: 12px 0 16px; padding: 12px; border: 2px solid var(--rq-cobalt); border-radius: 9px; background: var(--rq-white); color: var(--rq-ink); font-size: 16px; line-height: 1.5; }
.refonte-quiz .refonte-quiz__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@container (min-width: 600px) { .refonte-quiz .refonte-quiz__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 400px) {
  .refonte-quiz .refonte-quiz__intro-text { font-size: 14px; }
  .refonte-quiz .refonte-quiz__choice { padding: 13px 11px; gap: 9px; }
  .refonte-quiz .refonte-quiz__actions .refonte-quiz__button { flex: 1 1 100%; }
  .refonte-quiz .refonte-quiz__feedback { padding-left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .refonte-quiz *, .refonte-quiz *::before, .refonte-quiz *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .refonte-quiz .refonte-quiz__choice, .refonte-quiz .refonte-quiz__button { transform: none !important; }
}
@media print {
  .refonte-quiz { border: 0; margin: 0; }
  .refonte-quiz .refonte-quiz__actions, .refonte-quiz .refonte-quiz__recap { display: none; }
  .refonte-quiz[data-complete="true"] .refonte-quiz__cards, .refonte-quiz[data-complete="true"] .refonte-quiz__toolbar { display: none; }
  .refonte-quiz .refonte-quiz__priority, .refonte-quiz .refonte-quiz__card { break-inside: avoid; }
}

/* Révision du 16/10 : retour au clic, sans nouvelle étape ni délai de score. */
.refonte-quiz .refonte-quiz__choice {
  transition: transform 150ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)), opacity 150ms ease-out;
}
.refonte-quiz .refonte-quiz__choice:active:not([aria-disabled="true"]),
.refonte-quiz .refonte-quiz__button:active:not(:disabled) { transition-duration: 100ms; }
.refonte-quiz .refonte-quiz__choice[aria-disabled="true"] { transform: none; }
.refonte-quiz .refonte-quiz__card[data-answered="true"] .refonte-quiz__choice[aria-disabled="true"]:not([data-choice-state]) { opacity: .76; }
.refonte-quiz .refonte-quiz__card[data-answered="true"] .refonte-quiz__choice[aria-disabled="true"]:not([data-choice-state]):focus-visible { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .refonte-quiz .refonte-quiz__choice[data-choice-state] .refonte-quiz__choice-mark { animation: refonte-quiz-mark 220ms ease-out both; transform-origin: left center; }
  .refonte-quiz .refonte-quiz__feedback:not([hidden]) { animation: refonte-quiz-reveal 220ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)) both; }
  .refonte-quiz .refonte-quiz__result:not([hidden]) { animation: refonte-quiz-reveal 260ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)) both; }
}
@keyframes refonte-quiz-mark {
  from { opacity: .72; transform: translateY(2px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes refonte-quiz-reveal {
  from { opacity: .72; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Parcours séquentiel : seule la question affichée entre, sans attente JavaScript. */
@media (prefers-reduced-motion: no-preference) {
  .refonte-quiz .refonte-quiz__card:not([hidden]) { animation: refonte-quiz-question-enter 180ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)) both; }
}
@keyframes refonte-quiz-question-enter {
  from { opacity: .72; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Le décompte réutilise le panneau blanc et les boutons existants. */
.refonte-quiz .refonte-quiz__step-actions { margin-top: 24px; }

/* Jauge décorative : petite piste, aucune animation de mise en page. */
.refonte-quiz .refonte-quiz__countdown-track { height: 6px; margin-top: 12px; border-radius: 6px; overflow: hidden; background: var(--rq-cobalt-soft); }
.refonte-quiz .refonte-quiz__countdown-fill { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--rq-cobalt); transform: scaleX(0); transform-origin: left center; }
.refonte-quiz .refonte-quiz__countdown-fill[data-correct="true"] { background: var(--rq-lime); }
.refonte-quiz .refonte-quiz__countdown-fill[data-correct="false"] { background: var(--rq-pink); }


/* Retour de réponse : un seul mouvement bref sur le choix verrouillé. */
@media (prefers-reduced-motion: no-preference) {
  .refonte-quiz .refonte-quiz__card[data-correct="true"] .refonte-quiz__choice[data-choice-state="correct"] { animation: refonte-quiz-answer-success 280ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)); }
  .refonte-quiz .refonte-quiz__card[data-correct="false"] .refonte-quiz__choice[data-choice-state="wrong"] { animation: refonte-quiz-answer-error 240ms var(--cta-ease, cubic-bezier(.22,.78,.25,1)); }
}
@keyframes refonte-quiz-answer-success {
  0%, 100% { transform: none; }
  40% { transform: translateY(-3px) scale(1.015); }
  70% { transform: translateY(1px) scale(.998); }
}
@keyframes refonte-quiz-answer-error {
  0%, 100% { transform: none; }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
