/* =============================================
   TrainUWise — Quiz Styles
   ============================================= */

/* ==========================================
   DIAGNOSTIC SCROLL-PINNED SECTION
   ========================================== */

/* Wrapper height = scroll depth for 4 cards, ~75vh each */
.diag-wrapper { position: relative; height: 400vh; }

.diag-sticky {
  position: sticky; top: 0; height: 100vh;
  background: #060f2a;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  padding-top: 8rem; padding-bottom: 5rem;
  gap: 2.5rem;
}

/* Persistent title — visible throughout all 4 card stages */
.diag-head-fixed {
  position: absolute; top: 4.5rem; left: 50%; transform: translateX(-50%);
  text-align: center; z-index: 3; pointer-events: none;
  width: 100%; max-width: 800px; padding: 0 2rem;
}
.diag-head-title {
  font-size: clamp(1.5rem, 2.8vw, 2.25rem); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 24px rgba(37,99,235,0.35), 0 0 48px rgba(14,165,233,0.2);
}

/* Orbs */
.diag-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.diag-orb-1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(37,99,235,0.16) 0%, transparent 65%);
  top: -260px; left: -220px;
}
.diag-orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(14,165,233,0.1) 0%, transparent 65%);
  bottom: -180px; right: -120px;
}

/* ---- Stage wrap: fills most of viewport ---- */
.diag-stage-wrap {
  position: relative;
  width: 100%; max-width: 1060px;
  height: calc(100vh - 460px); min-height: 220px;
  padding: 0 3rem;
  flex-shrink: 0;
}

/* Stage fills the stage-wrap */
.diag-stage { position: absolute; inset: 0; }

/* ---- Individual cards ---- */
.diag-card {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 280px 1fr;
  align-items: center; gap: 5rem;
  opacity: 0; pointer-events: none;
  transform: translateY(56px) scale(0.97);
  /* CSS drives the transition at a fixed 0.72s — speed is independent of scroll velocity */
  transition: opacity 0.72s cubic-bezier(0.16,1,0.3,1),
              transform 0.72s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
}
/* Card scrolled past — exit upward */
.diag-card.past {
  opacity: 0;
  transform: translateY(-56px) scale(0.97);
}
/* Active card — fully visible */
.diag-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Left: icon area */
.diag-card-left {
  display: flex; align-items: center; justify-content: center;
}

/* Icon wrapper — consistent across all 4 cards */
.diag-icon-wrap {
  position: relative; width: 180px; height: 180px;
  display: flex; align-items: center; justify-content: center;
}
.diag-icon-glow {
  position: absolute; inset: -40%;
  border-radius: 50%; opacity: 0.28; filter: blur(48px);
  transition: opacity 0.5s;
}
/* Per-card glow colours */
#diagCard0 .diag-icon-glow { background: radial-gradient(circle, #2563eb, transparent 70%); }
#diagCard1 .diag-icon-glow { background: radial-gradient(circle, #f59e0b, transparent 70%); }
#diagCard2 .diag-icon-glow { background: radial-gradient(circle, #f43f5e, transparent 70%); }
#diagCard3 .diag-icon-glow { background: radial-gradient(circle, #8b5cf6, transparent 70%); }
/* Glow brightens when card is active */
.diag-card.active .diag-icon-glow { opacity: 0.5; }

/* Icon SVG — consistent size & style baseline */
.diag-icon {
  width: 160px; height: 160px;
  flex-shrink: 0;
  /* All icons share: stroke-width ~2.2-2.5, white primary, coloured accents */
}

/* Right: text content */
.diag-card-right { min-width: 0; text-align: left; }

.diag-card-num {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25); text-transform: uppercase;
  margin-bottom: 0.875rem;
}
.diag-card-num span { color: rgba(255,255,255,0.15); }

.diag-card-tag {
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.35rem 0.875rem; border-radius: 100px;
  display: inline-block; margin-bottom: 1rem;
}
.diag-tag-blue   { background: rgba(37,99,235,0.18);  color: #93c5fd; border: 1px solid rgba(37,99,235,0.3); }
.diag-tag-amber  { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.diag-tag-rose   { background: rgba(244,63,94,0.15);  color: #fda4af; border: 1px solid rgba(244,63,94,0.25); }
.diag-tag-purple { background: rgba(139,92,246,0.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.25); }

.diag-card-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.15; color: #fff; margin-bottom: 1rem;
}
.diag-card-desc {
  font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
  color: rgba(255,255,255,0.45); line-height: 1.8; max-width: 500px;
}

/* ---- CTA — in-flow below stage-wrap, flex sibling ---- */
.diag-cta {
  width: 100%; max-width: 600px; padding: 0 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.125rem;
  text-align: center; z-index: 3; flex-shrink: 0;
  opacity: 0; pointer-events: none;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s var(--ease-out-expo);
}
.diag-cta.visible {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.diag-cta-hook {
  font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600;
  color: rgba(255,255,255,0.65); letter-spacing: -0.02em; margin-bottom: 0.25rem;
}

/* ---- CTA Button ---- */
.quiz-trigger-btn {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff; border: none; border-radius: 100px;
  padding: 1.125rem 2.75rem; font-size: 1.125rem; font-weight: 800;
  cursor: pointer; display: inline-flex; align-items: center; gap: 0.625rem;
  font-family: inherit; letter-spacing: -0.01em;
  box-shadow: 0 8px 32px rgba(37,99,235,0.5);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1), box-shadow 0.25s;
  animation: ctaPulse 2.6s ease-in-out infinite;
  position: relative; overflow: hidden;
}
.quiz-trigger-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.quiz-trigger-btn:hover {
  transform: translateY(-4px) scale(1.03); box-shadow: 0 16px 48px rgba(37,99,235,0.62);
  animation: none;
}
.quiz-trigger-btn:hover::before { opacity: 1; }
@keyframes ctaPulse {
  0%,100% { box-shadow: 0 8px 32px rgba(37,99,235,0.5); }
  50%      { box-shadow: 0 8px 48px rgba(37,99,235,0.7), 0 0 0 10px rgba(37,99,235,0.1); }
}
.qtb-flash { font-size: 1.125rem; animation: flashPop 1.8s ease-in-out infinite; display: inline-block; }
@keyframes flashPop {
  0%,100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.25) rotate(-10deg); }
}
.qs-note { font-size: 0.8125rem; color: rgba(255,255,255,0.3); }

/* ---- Progress pill dots ---- */
.diag-prog {
  position: absolute; bottom: 2.75rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.5rem;
  opacity: 0; transition: opacity 0.4s ease; z-index: 2;
}
.diag-prog.visible { opacity: 1; }
.diag-prog-dot {
  width: 7px; height: 7px; border-radius: 100px;
  background: rgba(255,255,255,0.18);
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1), background 0.35s;
}
.diag-prog-dot.active { width: 28px; background: rgba(255,255,255,0.9); }
.diag-prog-dot.done   { background: rgba(255,255,255,0.42); }

/* ---- Scroll hint ---- */
.diag-hint {
  position: absolute; bottom: 1.75rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  color: rgba(255,255,255,0.22); font-size: 0.625rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  transition: opacity 0.5s ease; z-index: 2; pointer-events: none;
}
.diag-hint.hidden { opacity: 0; }
.diag-hint-arrow {
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.35), transparent);
  animation: hintDrop 1.6s ease-in-out infinite;
}
@keyframes hintDrop {
  0%,100% { transform: translateY(0); opacity: 1; }
  75%      { transform: translateY(12px); opacity: 0; }
}

/* ==========================================
   ICON ANIMATIONS
   (all paused by default, run only when .active)
   ========================================== */

/* Shared helpers */
@keyframes diagFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes diagPulse   { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@keyframes diagRingOut { 0% { transform: scale(1); opacity: 0.4; } 100% { transform: scale(2.4); opacity: 0; } }

/* ---- Card 0: Lead Drain ---- */
.ld-dot { opacity: 0; }
.ld-leak { transform-box: fill-box; transform-origin: center; }

#diagCard0.active .ld-dot        { animation: ldDotIn 0.45s ease both; }
#diagCard0.active .ld-d0         { animation-delay: 0.1s; }
#diagCard0.active .ld-d1         { animation-delay: 0.25s; }
#diagCard0.active .ld-d2         { animation-delay: 0.4s; }
#diagCard0.active .ld-leak       { animation: ldLeak 1.8s 0.5s ease-in infinite; }
#diagCard0:not(.active) .ld-dot  { opacity: 0; animation: none; }
#diagCard0:not(.active) .ld-leak { animation: none; }

@keyframes ldDotIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.7); }
  to   { opacity: 1; transform: none; }
}
@keyframes ldLeak {
  0%   { transform: translateX(0)    translateY(0)    scale(1);   opacity: 0.9; }
  70%  { transform: translateX(18px) translateY(14px) scale(0.5); opacity: 0.35; }
  100% { transform: translateX(26px) translateY(28px) scale(0);   opacity: 0; }
}

/* ---- Card 1: Ops Overload ---- */
.oo-gear {
  transform-box: fill-box; transform-origin: center;
  animation: spinGear 5s linear infinite; animation-play-state: paused;
}
#diagCard1.active .oo-gear       { animation-play-state: running; }
#diagCard1:not(.active) .oo-gear { animation-play-state: paused; }
@keyframes spinGear { to { transform: rotate(360deg); } }

/* ---- Card 2: Student Churn ---- */
.sc-rise  { stroke-dasharray: 56;  stroke-dashoffset: 56; }
.sc-fall  { stroke-dasharray: 50;  stroke-dashoffset: 50; }
.sc-arrow { opacity: 0; }
.sc-end   { transform-box: fill-box; transform-origin: center; animation-play-state: paused; }
.sc-ring  { transform-box: fill-box; transform-origin: center; animation-play-state: paused; }
.sc-peak  { opacity: 0; }

#diagCard2.active .sc-rise  { animation: drawPath 0.85s 0.15s cubic-bezier(0.4,0,0.2,1) forwards; }
#diagCard2.active .sc-fall  { animation: drawPath 0.7s  1s    cubic-bezier(0.4,0,0.2,1) forwards; }
#diagCard2.active .sc-peak  { animation: diagFadeIn 0.3s 0.9s ease forwards; }
#diagCard2.active .sc-arrow { animation: diagFadeIn 0.35s 1.7s ease forwards; }
#diagCard2.active .sc-end   { animation: diagPulse 1.1s 1.7s ease-in-out infinite; }
#diagCard2.active .sc-ring  { animation: diagRingOut 1.1s 1.7s ease-out infinite; }

#diagCard2:not(.active) .sc-rise  { stroke-dashoffset: 56; animation: none; }
#diagCard2:not(.active) .sc-fall  { stroke-dashoffset: 50; animation: none; }
#diagCard2:not(.active) .sc-arrow { opacity: 0; animation: none; }
#diagCard2:not(.active) .sc-peak  { opacity: 0; animation: none; }
#diagCard2:not(.active) .sc-end   { animation-play-state: paused; }
#diagCard2:not(.active) .sc-ring  { animation-play-state: paused; }

@keyframes drawPath { to { stroke-dashoffset: 0; } }

/* ---- Card 3: Revenue Blind Spots ---- */
.rb-bar { animation-play-state: paused; }
.rb-qc  { transform-box: fill-box; transform-origin: center; opacity: 0; }
.rb-qm, .rb-qd { opacity: 0; }

#diagCard3.active .rb-b0  { animation: rbPulse 1.8s 0.2s ease-in-out infinite; }
#diagCard3.active .rb-b1  { animation: rbPulse 1.8s 0.55s ease-in-out infinite; }
#diagCard3.active .rb-b2  { animation: rbPulse 1.8s 0.9s ease-in-out infinite; }
#diagCard3.active .rb-qc  { animation: qcPop 0.5s 0.35s cubic-bezier(0.16,1,0.3,1) forwards; }
#diagCard3.active .rb-qm  { animation: diagFadeIn 0.4s 0.85s ease forwards; }
#diagCard3.active .rb-qd  { animation: diagFadeIn 0.4s 0.85s ease forwards; }

#diagCard3:not(.active) .rb-bar { animation-play-state: paused; }
#diagCard3:not(.active) .rb-qc  { opacity: 0; animation: none; }
#diagCard3:not(.active) .rb-qm, #diagCard3:not(.active) .rb-qd { opacity: 0; animation: none; }

@keyframes rbPulse  { 0%,100% { opacity: 0.8; } 50% { opacity: 0.25; } }
@keyframes qcPop    {
  from { opacity: 0; transform: scale(0.4) rotate(-15deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ==========================================
   FLOATING BUTTON
   ========================================== */
.quiz-float {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--gradient); color: #fff; border: none;
  border-radius: 100px; padding: 0.875rem 1.5rem;
  font-size: 0.875rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(37,99,235,0.45);
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out-expo), box-shadow 0.2s;
  z-index: 90; opacity: 0; transform: translateY(20px) scale(0.95);
  pointer-events: none; font-family: inherit; white-space: nowrap;
}
.quiz-float.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.quiz-float:hover   { transform: translateY(-2px) scale(1); box-shadow: 0 12px 32px rgba(37,99,235,0.55); }

/* ==========================================
   MODAL
   ========================================== */
.quiz-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.quiz-modal.open { opacity: 1; pointer-events: all; }

.quiz-overlay {
  position: absolute; inset: 0;
  background: rgba(10,15,40,0.65);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.quiz-panel {
  position: relative; background: #fff; border-radius: 20px;
  width: 100%; max-width: 540px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.04);
  transform: scale(0.93) translateY(24px);
  transition: transform 0.42s var(--ease-out-expo);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.quiz-modal.open .quiz-panel { transform: scale(1) translateY(0); }
.quiz-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--gradient); z-index: 1;
}

/* ==========================================
   HEADER — compact
   ========================================== */
.quiz-header {
  padding: 1.125rem 1.375rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.quiz-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.875rem;
}
.quiz-step-label {
  font-size: 0.6875rem; font-weight: 700; color: var(--text-dim);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.quiz-close {
  width: 28px; height: 28px; background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1rem; line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s; font-family: inherit;
}
.quiz-close:hover { background: #fee2e2; color: var(--red); border-color: #fecaca; }

/* Progress dots */
.quiz-dots { display: flex; align-items: center; gap: 0; }
.qdot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 800; color: var(--text-dim);
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.35s var(--ease-out-expo);
  flex-shrink: 0;
}
.qdot-connector {
  flex: 1; height: 2px; background: var(--border); position: relative; overflow: hidden;
}
.qdot-connector::after {
  content: ''; position: absolute; inset: 0; background: var(--gradient);
  transform-origin: left; transform: scaleX(0); transition: transform 0.4s var(--ease-out-expo);
}
.qdot-connector.filled::after { transform: scaleX(1); }
.qdot.active { background: var(--gradient); border-color: transparent; color: #fff; transform: scale(1.15); }
.qdot.done   { background: #dcfce7; border-color: #bbf7d0; color: var(--green); }

/* ==========================================
   BODY
   ========================================== */
.quiz-body { padding: 1.25rem 1.375rem 1.375rem; flex: 1; overflow: hidden; }

/* ==========================================
   QUESTION
   ========================================== */
.quiz-question { animation: qSlideIn 0.36s var(--ease-out-expo) both; }
.quiz-question.exit { animation: qSlideOut 0.24s ease both; }
@keyframes qSlideIn {
  from { opacity: 0; transform: translateX(28px) scale(0.99); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes qSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-28px); }
}

.q-text {
  font-size: 1.0625rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.025em; line-height: 1.35; margin-bottom: 1rem;
}

/* 2×2 answer grid */
.q-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.q-option {
  background: var(--bg-subtle); border: 2px solid var(--border); border-radius: 12px;
  padding: 0.75rem 0.875rem; cursor: pointer;
  display: flex; align-items: center; gap: 0.625rem;
  font-family: inherit; width: 100%;
  transition: border-color 0.16s, background 0.16s, transform 0.2s var(--ease-out-expo), box-shadow 0.16s;
  position: relative; text-align: left;
}
.q-option:hover {
  border-color: var(--accent); background: var(--accent-light);
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}
.q-option.selected { border-color: var(--accent); background: var(--accent-light); transform: scale(0.98); }
.q-opt-icon {
  flex-shrink: 0; width: 32px; height: 32px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.2s, transform 0.25s var(--ease-out-expo);
}
.q-option:hover .q-opt-icon { background: var(--accent-light); transform: scale(1.08); }
.q-option.selected .q-opt-icon { background: var(--accent-light); }
.q-opt-text {
  font-size: 0.8125rem; font-weight: 600; color: var(--text); line-height: 1.35; flex: 1;
}
.q-check {
  position: absolute; top: 7px; right: 7px;
  width: 17px; height: 17px; background: var(--accent); color: #fff;
  border-radius: 50%; display: none; align-items: center; justify-content: center;
}
.q-option.selected .q-check { display: flex; }

/* ==========================================
   RESULT — no scroll
   ========================================== */
.quiz-result { animation: qSlideIn 0.45s var(--ease-out-expo) both; }

/* Compact result header */
.result-header {
  display: flex; align-items: center; gap: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.result-icon-wrap {
  width: 52px; height: 52px; background: var(--accent-light);
  border: 1px solid rgba(37,99,235,0.15); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; animation: resultPop 0.45s var(--ease-out-expo) 0.05s both;
}
@keyframes resultPop {
  from { transform: scale(0.55) rotate(-8deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}
.result-title {
  font-size: 1.0625rem; font-weight: 900; letter-spacing: -0.025em;
  color: var(--text); line-height: 1.2; margin-bottom: 0.2rem;
}
.result-subtitle { font-size: 0.75rem; color: var(--text-dim); font-weight: 500; }

/* Score bar */
.result-score-wrap { margin-bottom: 1rem; }
.result-score-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.result-score-meta span:first-child { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.result-score-num  { font-size: 1.125rem; font-weight: 900; color: var(--accent); }
.result-score-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.result-score-fill  { height: 100%; background: var(--gradient); border-radius: 4px; width: 0%; transition: width 1.3s var(--ease-out-expo); }

/* Desc */
.result-desc {
  font-size: 0.8125rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 0.75rem;
}

/* Solution callout */
.result-solution {
  background: var(--accent-light); border: 1px solid rgba(37,99,235,0.15);
  border-radius: 10px; padding: 0.75rem 1rem;
  font-size: 0.8375rem; color: var(--text); line-height: 1.6; margin-bottom: 0.875rem;
}
.result-solution strong { color: var(--accent); font-weight: 700; }

/* Feature pills — 2 per row */
.result-features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem;
}
.result-feature {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 0.4rem 0.75rem; font-size: 0.775rem; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.375rem;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out-expo);
}
.result-feature::before { content: '✓'; color: var(--green); font-weight: 700; font-size: 0.65rem; flex-shrink: 0; }
.result-feature.visible { opacity: 1; transform: translateY(0); }

/* Shared CTA — lives outside quiz-body, common to all 4 results */
.quiz-result-cta {
  display: flex; gap: 0.625rem;
  padding: 0 1.375rem;
  padding-bottom: 0; max-height: 0; overflow: hidden;
  flex-shrink: 0;
  transition: max-height 0.4s var(--ease-out-expo), padding-bottom 0.35s ease, opacity 0.3s ease 0.05s;
  opacity: 0; pointer-events: none;
}
.quiz-result-cta.visible {
  max-height: 80px; padding-bottom: 1.375rem;
  opacity: 1; pointer-events: all;
}
.quiz-result-cta .btn-primary { flex: 1; justify-content: center; padding: 0.75rem 1.25rem; font-size: 0.875rem; }
.btn-retake {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text-muted); padding: 0.75rem 1.125rem; border-radius: 10px;
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: var(--transition); font-family: inherit; white-space: nowrap;
}
.btn-retake:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ==========================================
   CONFETTI
   ========================================== */
.confetti-piece {
  position: absolute; border-radius: 2px;
  animation: confettiFall linear forwards; pointer-events: none; z-index: 10;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(240px) rotate(720deg); opacity: 0; }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  .diag-card { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
  .diag-cta  { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
}

@media (max-width: 900px) {
  .diag-stage-wrap { padding: 0 1.5rem; }
  .diag-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 2rem; }
  .diag-card-left { justify-content: flex-start; }
  .diag-icon-wrap { width: 120px; height: 120px; }
  .diag-icon { width: 110px; height: 110px; }
}

@media (max-width: 768px) {
  /* Disable sticky on mobile — show all cards in normal flow */
  .diag-wrapper    { height: auto; overflow: hidden; }
  .diag-sticky     { position: static; height: auto; padding: 3rem 0 4rem; align-items: stretch; flex-direction: column; gap: 0; }

  /* Title: pull out of absolute positioning into normal flow */
  .diag-head-fixed {
    position: static; transform: none; left: auto;
    text-align: left; padding: 0 1.5rem 2rem;
    max-width: 100%;
  }
  .diag-head-title { font-size: clamp(1.5rem, 6vw, 2rem); }

  .diag-stage-wrap { position: static; height: auto; padding: 0 1.5rem; }
  .diag-stage      { position: static; display: flex; flex-direction: column; gap: 1.25rem; }

  /* Cards: title-only compact rows */
  .diag-card {
    position: static; display: flex; align-items: center; gap: 1rem;
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16,1,0.3,1) !important;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
    pointer-events: auto;
  }
  .diag-card.mobile-visible { opacity: 1 !important; transform: translateY(0) !important; }

  /* Left accent per card */
  #diagCard0 { border-left: 3px solid #3b82f6; }
  #diagCard1 { border-left: 3px solid #f59e0b; }
  #diagCard2 { border-left: 3px solid #f43f5e; }
  #diagCard3 { border-left: 3px solid #a855f7; }

  /* Hide everything except number + title */
  .diag-card-left  { display: none; }
  .diag-card-right { display: contents; }
  .diag-card-tag   { display: none; }
  .diag-card-desc  { display: none; }
  .diag-card-num   { font-size: 0.7rem; font-weight: 800; color: rgba(255,255,255,0.25); white-space: nowrap; flex-shrink: 0; }
  .diag-card-num span { display: none; }
  .diag-card-title { font-size: 0.975rem; font-weight: 700; color: rgba(255,255,255,0.85); line-height: 1.35; margin: 0; }

  .diag-cta        { opacity: 1 !important; transform: none !important;
                     pointer-events: auto; padding: 2rem 1.5rem 0; align-items: flex-start; width: 100%; }
  .diag-hint, .diag-prog { display: none; }
  .quiz-float      { bottom: 1.25rem; right: 1.25rem; font-size: 0.8125rem; padding: 0.75rem 1.25rem; }
}
@media (max-width: 480px) {
  .diag-card { grid-template-columns: 1fr; }
  .quiz-trigger-btn { padding: 1rem 2rem; font-size: 1rem; }
  .quiz-panel   { border-radius: 16px; }
  .quiz-body    { padding: 1rem 1.125rem 1.125rem; }
  .quiz-header  { padding: 1rem 1.125rem 0.875rem; }
  .q-options    { grid-template-columns: 1fr; }
  .result-features { grid-template-columns: 1fr; }
}
