/* ─── KINETIC — Quiz page styles ─── */

.quiz-wrap { max-width: 820px; margin: 0 auto; padding: 32px 24px 80px; position: relative; }
.quiz-blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.quiz-blobs .b1 { width: 500px; height: 500px; top: 5%; left: -120px; }
.quiz-blobs .b2 { width: 500px; height: 500px; bottom: -120px; right: -80px; }

.quiz-shell {
  position: relative; z-index: 2;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-lg);
  border-radius: 40px;
  padding: 48px 56px 44px;
  min-height: 520px;
  display: flex; flex-direction: column;
}

/* ── Top bar ── */
.quiz-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 36px; gap: 20px; flex-shrink: 0;
}
.quiz-topleft { display: flex; align-items: center; gap: 14px; }
.progress-ring { position: relative; width: 64px; height: 64px; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .bg { stroke: rgba(14,11,31,.08); }
.progress-ring .fg { stroke: var(--ink); transition: stroke-dashoffset .5s ease; }
.progress-ring .pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 17px; letter-spacing: .04em;
}
.quiz-step-label { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; color: var(--gray); }
.quiz-bloc { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 22px; letter-spacing: .05em; color: var(--ink); line-height: 1; margin-top: 2px; }
.back-btn {
  background: transparent; border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 100px;
  font-size: 12px; font-weight: 600; color: var(--gray);
  cursor: pointer; font-family: inherit; transition: all .2s;
  min-height: 40px; /* touch target proche du 44px WCAG */
}
.back-btn:hover { border-color: var(--ink); color: var(--ink); }
.back-btn:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-color: var(--violet); }

/* ── Question text ── */
.question-text {
  font-family: 'Archivo Narrow', Impact, sans-serif;
  font-weight: 700; font-size: clamp(30px, 4.5vw, 56px);
  line-height: 1; letter-spacing: -0.02em; text-transform: uppercase;
  margin: 0 0 12px; text-wrap: balance; flex-shrink: 0;
}
.question-hint {
  font-size: 13px; color: var(--gray); margin-bottom: 32px; font-weight: 500;
}

/* Transition fluide entre questions (fade-in léger) */
@keyframes questionFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#question-body, .question-text {
  animation: questionFadeIn .25s ease-out;
}

/* ── Motivation cards ── */
.motivation-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 32px; flex: 1;
}
.mot-card {
  background: rgba(255,255,255,.65); border: 2px solid var(--glass-border);
  border-radius: 20px; padding: 20px 22px; cursor: pointer; transition: all .22s;
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3;
  user-select: none; font-family: inherit; text-align: left; width: 100%;
}
.mot-card:hover { background: white; border-color: var(--ink); transform: translateY(-1px); }
.mot-card:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.mot-card.selected {
  background: var(--ink); color: white; border-color: var(--ink);
  box-shadow: 0 8px 24px rgba(14,11,31,.22);
}
.mot-card .mot-check {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(14,11,31,.06); flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; transition: all .2s;
}
.mot-card.selected .mot-check { background: var(--orange); }

/* ── Scale (16personalities circles) ── */
.scale-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; justify-content: center; padding: 8px 0 24px; }
.scale-row {
  display: flex; align-items: center; gap: 16px; width: 100%; max-width: 560px; margin: 0 auto;
}
.scale-label { font-size: 12px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .08em; flex: 1; line-height: 1.3; }
.scale-label.right { text-align: right; }
.scale-circles { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.scale-circle {
  border-radius: 50%; border: 2.5px solid var(--border);
  background: rgba(255,255,255,.7); cursor: pointer;
  transition: all .18s; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.scale-circle:nth-child(1) { width: 52px; height: 52px; }
.scale-circle:nth-child(2) { width: 42px; height: 42px; }
.scale-circle:nth-child(3) { width: 32px; height: 32px; }
.scale-circle:nth-child(4) { width: 42px; height: 42px; }
.scale-circle:nth-child(5) { width: 52px; height: 52px; }
.scale-circle:hover { border-color: var(--orange); transform: scale(1.12); }
.scale-circle:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.scale-circle[data-i="0"].selected,
.scale-circle[data-i="1"].selected { background: var(--violet); border-color: var(--violet); box-shadow: 0 4px 16px rgba(108,71,255,.3); }
.scale-circle[data-i="2"].selected { background: var(--ink); border-color: var(--ink); }
.scale-circle[data-i="3"].selected,
.scale-circle[data-i="4"].selected { background: var(--orange); border-color: var(--orange); box-shadow: 0 4px 16px rgba(255,90,31,.3); }
.scale-tick-row { display: flex; justify-content: space-between; width: 100%; max-width: 560px; margin: 8px auto 0; padding: 0 4px; }
.scale-tick { font-size: 10px; font-weight: 700; color: var(--gray-light); text-transform: uppercase; letter-spacing: .08em; }
.scale-auto-hint { font-size: 11px; color: var(--gray-light); margin-top: 24px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }

/* ── Quiz footer bar ── */
.quiz-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-top: auto; padding-top: 24px; flex-shrink: 0;
}
.quiz-foot .hint { font-size: 11px; color: var(--gray-light); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.btn-next { padding: 18px 32px; font-size: 15px; }
.btn-next:focus-visible, .btn-xl:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Disabled state propre pour les boutons (remplace les hacks opacity inline) */
.btn[disabled], .btn-xl[disabled], .btn-next[disabled] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Question progress bar (bottom) ── */
.progress-bar {
  height: 3px; background: rgba(14,11,31,.07); border-radius: 99px; overflow: hidden; margin-top: 20px; flex-shrink: 0;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--orange)); border-radius: 99px; transition: width .4s ease; }

/* ── Auto-advance countdown bar ── */
.autoadvance-bar {
  height: 3px; background: rgba(14,11,31,.07); border-radius: 99px; overflow: hidden;
  margin-top: 12px; flex-shrink: 0; opacity: 0; transition: opacity .15s;
}
.autoadvance-bar.active { opacity: 1; }
.autoadvance-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--orange), var(--violet));
  border-radius: 99px;
}
.autoadvance-bar.active .autoadvance-fill {
  animation: countdown 900ms linear forwards;
}
@keyframes countdown { from { width: 0% } to { width: 100% } }

@media (prefers-reduced-motion: reduce) {
  .autoadvance-bar { display: none; }
  /* Désactive toutes les transitions/animations du quiz pour users motion-sensitive */
  .quiz-wrap *, .quiz-shell *,
  .mot-card, .bubble, .scale-circle, .tinder-card, .tinder-btn,
  .top-card, .alt-card, .top-card-wrap {
    transition: none !important;
    animation: none !important;
  }
  .mot-card:hover, .bubble:hover, .scale-circle:hover,
  .tinder-btn:hover, .top-card:hover, .alt-card:hover {
    transform: none !important;
  }
  /* Garde le scroll smooth optionnel mais retire le slide */
  html { scroll-behavior: auto !important; }
}

/* ── Profile reveal ── */
.profile-reveal {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; flex: 1; padding: 20px 0 8px;
}
.profile-emoji-big {
  font-size: 88px; line-height: 1; margin-bottom: 20px;
  animation: popIn .5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes popIn { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.profile-label-sm { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--gray); margin-bottom: 8px; }
.profile-name-big {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(52px, 10vw, 96px); letter-spacing: .04em;
  color: var(--ink); line-height: .95; margin-bottom: 16px;
}
.profile-desc-text { font-size: 16px; color: var(--gray); max-width: 440px; line-height: 1.5; margin-bottom: 24px; }
.profile-traits { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
.profile-trait {
  background: rgba(14,11,31,.06); border-radius: 100px;
  padding: 6px 14px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.btn-xl { padding: 20px 44px; font-size: 16px; }

@media (max-width: 640px) {
  .quiz-wrap { padding: 16px 12px 40px; }
  .quiz-shell { padding: 22px 18px 22px; border-radius: 24px; min-height: 460px; }
  .quiz-top { flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
  .progress-ring { width: 52px; height: 52px; }
  .progress-ring svg { width: 52px; height: 52px; }
  .progress-ring .pct { font-size: 14px; }
  .quiz-bloc { font-size: 18px; }
  .back-btn { padding: 10px 14px; min-height: 40px; }
  .question-text { font-size: clamp(26px, 7vw, 38px); margin: 0 0 8px; }
  .question-hint { font-size: 12px; margin-bottom: 20px; }
  .motivation-grid { grid-template-columns: 1fr; gap: 8px; margin-bottom: 20px; }
  .mot-card { padding: 16px 18px; font-size: 14px; min-height: 56px; border-radius: 16px; }
  .scale-circles { gap: 8px; }
  .scale-circle:nth-child(1), .scale-circle:nth-child(5) { width: 44px; height: 44px; }
  .scale-circle:nth-child(2), .scale-circle:nth-child(4) { width: 36px; height: 36px; }
  .scale-circle:nth-child(3) { width: 28px; height: 28px; }
  .scale-row { gap: 10px; }
  .scale-label { font-size: 10px; }
  .quiz-foot { padding-top: 16px; gap: 10px; }
  .btn-next { padding: 14px 22px; font-size: 14px; }
  .profile-emoji-big { font-size: 70px; margin-bottom: 14px; }
  .profile-name-big { font-size: clamp(40px, 12vw, 64px); margin-bottom: 12px; }
  .profile-desc-text { font-size: 14px; margin-bottom: 18px; }
  .profile-traits { margin-bottom: 28px; }
  .btn-xl { padding: 16px 28px; font-size: 14px; width: 100%; max-width: 320px; }
}

/* iPhone SE et petits écrans */
@media (max-width: 390px) {
  .quiz-shell { padding: 18px 14px; border-radius: 22px; }
  .question-text { font-size: clamp(22px, 7vw, 32px); }
  .progress-ring { width: 44px; height: 44px; }
  .progress-ring svg { width: 44px; height: 44px; }
  .progress-ring .pct { font-size: 12px; }
  .quiz-step-label { font-size: 9px; }
  .quiz-bloc { font-size: 16px; }
}
