/* ── Theme: Dark ── */
.cqo-theme-dark {
  --cqo-header-bg: linear-gradient(180deg, #0f1225 0%, #181d3a 100%);
  --cqo-surface: #141829;
  --cqo-shadow: none;
  --cqo-text: #e2e8f0;
  --cqo-text-bright: #fff;
  --cqo-text-muted: rgba(255, 255, 255, 0.5);
  --cqo-text-faint: rgba(255, 255, 255, 0.3);
  --cqo-border: rgba(255, 255, 255, 0.06);
  --cqo-border-hover: rgba(255, 255, 255, 0.18);
  --cqo-choice-bg: rgba(255, 255, 255, 0.03);
  --cqo-choice-hover: rgba(255, 255, 255, 0.06);
  --cqo-letter-bg: rgba(255, 255, 255, 0.07);
  --cqo-letter-hover: rgba(255, 255, 255, 0.14);
  --cqo-accent: #7c3aed;
  --cqo-accent-border: rgba(167, 139, 250, 0.5);
  --cqo-accent-bg: rgba(124, 58, 237, 0.15);
  --cqo-badge: #f472b6;
  --cqo-badge-bg: rgba(244, 114, 182, 0.12);
  --cqo-badge-border: rgba(244, 114, 182, 0.2);
  --cqo-badge-label: #f9a8d4;
  --cqo-progress-done: linear-gradient(90deg, #22d3ee, #10b981);
  --cqo-progress-cur: rgba(255, 255, 255, 0.2);
  --cqo-progress-bg: rgba(255, 255, 255, 0.08);
  --cqo-btn-bg: linear-gradient(135deg, #e11d48 0%, #f97316 100%);
  --cqo-btn-shadow: rgba(225, 29, 72, 0.3);
  --cqo-input-bg: rgba(255, 255, 255, 0.04);
  --cqo-input-focus: rgba(244, 114, 182, 0.5);
  --cqo-input-glow: rgba(244, 114, 182, 0.1);
  --cqo-correct: #22c55e;
  --cqo-correct-bg: rgba(34, 197, 94, 0.15);
  --cqo-correct-lite: rgba(34, 197, 94, 0.1);
  --cqo-correct-border: rgba(34, 197, 94, 0.2);
  --cqo-wrong: #ef4444;
  --cqo-wrong-bg: rgba(239, 68, 68, 0.12);
  --cqo-wrong-lite: rgba(239, 68, 68, 0.1);
  --cqo-wrong-border: rgba(239, 68, 68, 0.2);
  --cqo-ring-start: #e11d48;
  --cqo-ring-end: #f97316;
  --cqo-ring-bg: rgba(255, 255, 255, 0.06);
}

/* ── Theme: Light ── */
.cqo-theme-light {
  --cqo-header-bg: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  --cqo-surface: #ffffff;
  --cqo-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --cqo-text: #475569;
  --cqo-text-bright: #0f172a;
  --cqo-text-muted: #64748b;
  --cqo-text-faint: #94a3b8;
  --cqo-border: #e2e8f0;
  --cqo-border-hover: #cbd5e1;
  --cqo-choice-bg: #f8fafc;
  --cqo-choice-hover: #f1f5f9;
  --cqo-letter-bg: #e2e8f0;
  --cqo-letter-hover: #cbd5e1;
  --cqo-accent: #6366f1;
  --cqo-accent-border: #818cf8;
  --cqo-accent-bg: rgba(99, 102, 241, 0.08);
  --cqo-badge: #ec4899;
  --cqo-badge-bg: rgba(236, 72, 153, 0.08);
  --cqo-badge-border: rgba(236, 72, 153, 0.2);
  --cqo-badge-label: #db2777;
  --cqo-progress-done: linear-gradient(90deg, #06b6d4, #10b981);
  --cqo-progress-cur: #cbd5e1;
  --cqo-progress-bg: #e2e8f0;
  --cqo-btn-bg: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --cqo-btn-shadow: rgba(99, 102, 241, 0.3);
  --cqo-input-bg: #f8fafc;
  --cqo-input-focus: #818cf8;
  --cqo-input-glow: rgba(129, 140, 248, 0.15);
  --cqo-correct: #16a34a;
  --cqo-correct-bg: rgba(22, 163, 74, 0.1);
  --cqo-correct-lite: rgba(22, 163, 74, 0.06);
  --cqo-correct-border: rgba(22, 163, 74, 0.15);
  --cqo-wrong: #dc2626;
  --cqo-wrong-bg: rgba(220, 38, 38, 0.08);
  --cqo-wrong-lite: rgba(220, 38, 38, 0.05);
  --cqo-wrong-border: rgba(220, 38, 38, 0.12);
  --cqo-ring-start: #6366f1;
  --cqo-ring-end: #8b5cf6;
  --cqo-ring-bg: #e2e8f0;
}

/* ── Theme: Neon ── */
.cqo-theme-neon {
  --cqo-header-bg: linear-gradient(180deg, #0a0a1a 0%, #1a0a2e 100%);
  --cqo-surface: #12122a;
  --cqo-shadow: 0 0 40px rgba(168, 85, 247, 0.08), 0 0 80px rgba(168, 85, 247, 0.04);
  --cqo-text: #c4b5fd;
  --cqo-text-bright: #f0abfc;
  --cqo-text-muted: rgba(196, 181, 253, 0.6);
  --cqo-text-faint: rgba(196, 181, 253, 0.35);
  --cqo-border: rgba(168, 85, 247, 0.15);
  --cqo-border-hover: rgba(168, 85, 247, 0.35);
  --cqo-choice-bg: rgba(168, 85, 247, 0.06);
  --cqo-choice-hover: rgba(168, 85, 247, 0.12);
  --cqo-letter-bg: rgba(168, 85, 247, 0.12);
  --cqo-letter-hover: rgba(168, 85, 247, 0.25);
  --cqo-accent: #a855f7;
  --cqo-accent-border: #c084fc;
  --cqo-accent-bg: rgba(192, 132, 252, 0.15);
  --cqo-badge: #22d3ee;
  --cqo-badge-bg: rgba(34, 211, 238, 0.1);
  --cqo-badge-border: rgba(34, 211, 238, 0.25);
  --cqo-badge-label: #67e8f9;
  --cqo-progress-done: linear-gradient(90deg, #c084fc, #22d3ee);
  --cqo-progress-cur: rgba(168, 85, 247, 0.25);
  --cqo-progress-bg: rgba(168, 85, 247, 0.1);
  --cqo-btn-bg: linear-gradient(135deg, #a855f7 0%, #06b6d4 100%);
  --cqo-btn-shadow: rgba(168, 85, 247, 0.35);
  --cqo-input-bg: rgba(168, 85, 247, 0.06);
  --cqo-input-focus: rgba(192, 132, 252, 0.5);
  --cqo-input-glow: rgba(168, 85, 247, 0.15);
  --cqo-correct: #22c55e;
  --cqo-correct-bg: rgba(34, 197, 94, 0.12);
  --cqo-correct-lite: rgba(34, 197, 94, 0.08);
  --cqo-correct-border: rgba(34, 197, 94, 0.2);
  --cqo-wrong: #ef4444;
  --cqo-wrong-bg: rgba(239, 68, 68, 0.12);
  --cqo-wrong-lite: rgba(239, 68, 68, 0.08);
  --cqo-wrong-border: rgba(239, 68, 68, 0.2);
  --cqo-ring-start: #a855f7;
  --cqo-ring-end: #06b6d4;
  --cqo-ring-bg: rgba(168, 85, 247, 0.1);
}

/* ── Base ── */
.cqo-root {
  margin: 28px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Outer wrapper ── */
.cqo-wrap {
  max-width: 640px;
}

.cqo-header {
  text-align: center;
  padding: 24px 16px 18px;
  background: var(--cqo-header-bg);
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--cqo-border);
  border-bottom: none;
}

.cqo-header-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cqo-badge-label);
  margin-bottom: 8px;
}

.cqo-header-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--cqo-text-bright);
}

.cqo-header-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--cqo-text-muted);
}

/* ── Card ── */
.cqo-card {
  position: relative;
  border-radius: 0 0 20px 20px;
  padding: 22px 22px 20px;
  background: var(--cqo-surface);
  border: 1px solid var(--cqo-border);
  border-top: none;
  color: var(--cqo-text);
  box-shadow: var(--cqo-shadow);
  animation: cqoFadeIn 0.25s ease;
}

.cqo-card.is-standalone {
  border-radius: 20px;
  border-top: 1px solid var(--cqo-border);
}

/* ── Progress bar ── */
.cqo-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cqo-progress {
  flex: 1;
  display: flex;
  gap: 4px;
  margin-right: 14px;
}

.cqo-progress-seg {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--cqo-progress-bg);
  transition: background 0.35s ease;
}

.cqo-progress-seg.is-done {
  background: var(--cqo-progress-done);
}

.cqo-progress-seg.is-current {
  background: var(--cqo-progress-cur);
}

.cqo-step-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--cqo-text-faint);
}

/* ── Score badge ── */
.cqo-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cqo-badge);
  background: var(--cqo-badge-bg);
  border: 1px solid var(--cqo-badge-border);
  border-radius: 20px;
  padding: 3px 12px;
}

/* ── Question text ── */
.cqo-question {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 18px;
  color: var(--cqo-text-bright);
}

/* ── Choices ── */
.cqo-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cqo-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--cqo-border);
  background: var(--cqo-choice-bg);
  color: var(--cqo-text);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

.cqo-choice-letter {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: var(--cqo-letter-bg);
  color: var(--cqo-text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.cqo-choice:hover:not(:disabled) {
  border-color: var(--cqo-border-hover);
  background: var(--cqo-choice-hover);
  transform: translateY(-1px);
}

.cqo-choice:hover:not(:disabled) .cqo-choice-letter {
  background: var(--cqo-letter-hover);
  color: var(--cqo-text-bright);
}

.cqo-choice:disabled {
  cursor: default;
  transform: none;
}

.cqo-choice.is-selected {
  border-color: var(--cqo-accent-border);
  background: var(--cqo-accent-bg);
}

.cqo-choice.is-selected .cqo-choice-letter {
  background: var(--cqo-accent);
  color: #fff;
}

.cqo-choice.is-correct-reveal {
  border-color: var(--cqo-correct);
  background: var(--cqo-correct-bg);
}

.cqo-choice.is-correct-reveal .cqo-choice-letter {
  background: var(--cqo-correct);
  color: #fff;
}

.cqo-choice.is-wrong-reveal {
  border-color: var(--cqo-wrong);
  background: var(--cqo-wrong-bg);
}

.cqo-choice.is-wrong-reveal .cqo-choice-letter {
  background: var(--cqo-wrong);
  color: #fff;
}

/* ── Explanation ── */
.cqo-inline-explanation {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cqo-text);
  animation: cqoSlideUp 0.3s ease;
}

.cqo-inline-explanation.is-correct {
  background: var(--cqo-correct-lite);
  border: 1px solid var(--cqo-correct-border);
}

.cqo-inline-explanation.is-wrong {
  background: var(--cqo-wrong-lite);
  border: 1px solid var(--cqo-wrong-border);
}

.cqo-inline-explanation .cqo-exp-icon {
  margin-right: 6px;
}

/* ── Next / CTA button ── */
.cqo-next-btn,
.cqo-submit {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--cqo-btn-bg);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.cqo-next-btn:hover,
.cqo-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--cqo-btn-shadow);
}

/* ── Disclosure ── */
.cqo-disclosure {
  color: var(--cqo-text-faint);
  font-size: 11px;
  margin-top: 14px;
  line-height: 1.5;
  text-align: center;
}

.cqo-disclosure a {
  color: var(--cqo-text-muted);
  text-decoration: underline;
}

/* ── Result screen ── */
.cqo-result-header {
  text-align: center;
  padding-bottom: 6px;
}

.cqo-score-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
}

.cqo-score-ring {
  display: block;
  transform: rotate(-90deg);
}

.cqo-score-ring-bg {
  fill: none;
  stroke: var(--cqo-ring-bg);
  stroke-width: 10;
}

.cqo-score-ring-progress {
  fill: none;
  stroke: url(#cqoRingGrad);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.cqo-score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cqo-score-value {
  font-size: 38px;
  font-weight: 800;
  color: var(--cqo-text-bright);
  line-height: 1;
}

.cqo-score-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--cqo-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.cqo-result-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--cqo-text-bright);
  margin: 8px 0 4px;
  text-align: center;
}

.cqo-result-subtitle {
  font-size: 14px;
  color: var(--cqo-text-muted);
  margin: 0 0 18px;
  text-align: center;
}

/* ── Email input ── */
.cqo-optin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cqo-card input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 2px solid var(--cqo-border);
  border-radius: 14px;
  background: var(--cqo-input-bg);
  color: var(--cqo-text-bright);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.cqo-card input[type="email"]::placeholder {
  color: var(--cqo-text-faint);
}

.cqo-card input[type="email"]:focus {
  border-color: var(--cqo-input-focus);
  box-shadow: 0 0 0 3px var(--cqo-input-glow);
}

/* ── Status / success ── */
.cqo-status {
  text-align: center;
  font-size: 14px;
  color: var(--cqo-text-muted);
  margin-top: 8px;
}

.cqo-success-msg {
  text-align: center;
  font-weight: 700;
  color: var(--cqo-correct);
  font-size: 16px;
  margin-bottom: 12px;
}

/* ── Answer summary ── */
.cqo-answer-summary {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--cqo-border);
}

.cqo-answer-summary h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--cqo-text-muted);
  margin: 0 0 12px;
}

.cqo-summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cqo-summary-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--cqo-border);
  background: var(--cqo-choice-bg);
}

.cqo-summary-item.is-correct {
  border-color: var(--cqo-correct-border);
  background: var(--cqo-correct-lite);
}

.cqo-summary-item.is-wrong {
  border-color: var(--cqo-wrong-border);
  background: var(--cqo-wrong-lite);
}

.cqo-summary-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--cqo-text-bright);
  margin: 0 0 4px;
}

.cqo-summary-detail {
  font-size: 13px;
  color: var(--cqo-text-muted);
  margin: 2px 0;
}

.cqo-summary-explanation {
  font-size: 13px;
  color: var(--cqo-text-faint);
  margin-top: 4px;
  font-style: italic;
}

/* ── Animations ── */
@keyframes cqoSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cqoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .cqo-header {
    padding: 18px 14px 14px;
  }

  .cqo-header-title {
    font-size: 22px;
  }

  .cqo-card {
    padding: 18px 14px 16px;
  }

  .cqo-question {
    font-size: 17px;
  }

  .cqo-choice {
    padding: 12px 14px;
    font-size: 14px;
  }

  .cqo-result-title {
    font-size: 20px;
  }

  .cqo-score-wrap {
    width: 130px;
    height: 130px;
  }

  .cqo-score-value {
    font-size: 32px;
  }
}
