/* ─── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #2563EB;
  --blue-dark:   #1D4ED8;
  --blue-light:  #EFF6FF;
  --purple:      #7C3AED;
  --teal:        #0891B2;
  --green:       #059669;
  --amber:       #D97706;
  --red:         #DC2626;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #4B5563;
  --gray-800:    #1F2937;
  --gray-900:    #111827;
  --white:       #FFFFFF;
  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:      0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Screen management ───────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   WELCOME SCREEN
═══════════════════════════════════════════════════════════════ */
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }

.site-nav {
  padding: 18px 40px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
}
.nav-logo {
  font-weight: 800; font-size: 1.05rem;
  color: var(--blue-dark); letter-spacing: -0.01em;
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 40px 80px;
  align-items: center;
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 40px 20px 60px; }
  .hero-visual { order: -1; display: flex; justify-content: center; }
  .brain-graphic svg { width: 160px; height: 160px; }
}

.hero-inner { max-width: 540px; }

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-light); padding: 4px 12px;
  border-radius: 20px; margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -0.03em; color: var(--gray-900);
  margin-bottom: 18px;
}

.hero-body {
  font-size: 1.05rem; color: var(--gray-600);
  line-height: 1.7; margin-bottom: 28px;
}

.instrument-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 22px;
}
.instrument-chip {
  background: var(--white); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); padding: 6px 14px;
  font-size: 0.82rem; font-weight: 700; color: var(--gray-800);
}
.instrument-chip span {
  font-weight: 400; color: var(--gray-400);
  margin-left: 4px;
}

.meta-row {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--gray-600);
  margin-bottom: 28px;
}

.btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: var(--white);
  padding: 15px 32px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700; border: none;
  cursor: pointer; transition: background 0.18s, transform 0.1s;
  text-decoration: none; margin-bottom: 24px;
}
.btn-hero:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-hero:active { transform: translateY(0); }

.disclaimer-box {
  background: #FFFBEB; border: 1.5px solid #FCD34D;
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 0.84rem; color: #92400E; line-height: 1.6;
}
.disclaimer-box strong { color: #78350F; }

.hero-visual { display: flex; justify-content: center; align-items: center; }
.brain-graphic {
  background: var(--white); border: 1.5px solid var(--gray-200);
  border-radius: 50%; padding: 10px;
  box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════════════════════════
   QUIZ CHROME (shared by quiz + raadsr screens)
═══════════════════════════════════════════════════════════════ */
.quiz-chrome {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--gray-50);
}

.quiz-top {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 32px;
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
@media (max-width: 600px) { .quiz-top { padding: 12px 16px; gap: 12px; } }

.quiz-logo {
  font-weight: 800; font-size: 0.9rem; color: var(--blue-dark);
  white-space: nowrap; flex-shrink: 0;
}

.quiz-progress-area {
  flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0;
}

.phase-label {
  font-size: 0.75rem; font-weight: 600; color: var(--gray-600);
  white-space: nowrap; flex-shrink: 0;
}
@media (max-width: 500px) { .phase-label { display: none; } }

.progress-bar-outer {
  flex: 1; height: 6px; background: var(--gray-200);
  border-radius: 3px; overflow: hidden;
}
.progress-bar-inner {
  height: 100%; background: var(--blue);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-counter {
  font-size: 0.78rem; font-weight: 600; color: var(--gray-400);
  white-space: nowrap; flex-shrink: 0;
}

/* ─── Question area ───────────────────────────────────────────── */
.quiz-body {
  flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px 20px;
}

.question-wrap {
  width: 100%; max-width: 640px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 40px 32px;
}
@media (max-width: 600px) { .question-wrap { padding: 24px 20px 22px; } }

.question-instrument-tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-light); padding: 3px 10px;
  border-radius: 20px; margin-bottom: 12px;
}

.question-hint {
  font-size: 0.84rem; color: var(--gray-400);
  font-style: italic; margin-bottom: 16px;
  line-height: 1.55;
}

.question-text {
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 600; color: var(--gray-900);
  line-height: 1.5; margin-bottom: 28px;
}

/* ─── Options ─────────────────────────────────────────────────── */
.options-list {
  display: flex; flex-direction: column; gap: 10px;
}

.option-item {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--gray-50); border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.95rem; color: var(--gray-800);
  text-align: left;
  /* important: reset all button defaults */
  appearance: none; -webkit-appearance: none;
  font-family: inherit;
}
.option-item:hover {
  border-color: var(--blue); background: var(--blue-light);
  color: var(--gray-900);
}
.option-item.selected {
  border-color: var(--blue); background: var(--blue-light);
  color: var(--blue-dark); font-weight: 600;
}

.option-dot {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.option-item.selected .option-dot {
  border-color: var(--blue); background: var(--blue);
}
.option-item.selected .option-dot::after {
  content: ''; display: block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--white);
}

/* ─── Quiz footer ─────────────────────────────────────────────── */
.quiz-footer {
  background: var(--white); border-top: 1px solid var(--gray-200);
  padding: 16px 32px;
  display: flex; justify-content: space-between; align-items: center;
}
@media (max-width: 600px) { .quiz-footer { padding: 14px 16px; } }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-size: 0.92rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.btn-back {
  background: transparent; color: var(--gray-600);
  border-color: var(--gray-200);
}
.btn-back:hover:not(:disabled) {
  background: var(--gray-100); border-color: var(--gray-300);
}

.btn-next {
  background: var(--blue); color: var(--white); border-color: var(--blue);
}
.btn-next:hover:not(:disabled) {
  background: var(--blue-dark); border-color: var(--blue-dark);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--purple); color: var(--white); border-color: var(--purple);
  padding: 12px 24px;
}
.btn-accent:hover:not(:disabled) {
  background: #6D28D9; border-color: #6D28D9;
}

.btn-ghost {
  background: transparent; color: var(--gray-600);
  border-color: var(--gray-200);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
}

.btn-outline {
  background: transparent; color: var(--blue);
  border-color: var(--blue);
}
.btn-outline:hover:not(:disabled) {
  background: var(--blue-light);
}

/* ═══════════════════════════════════════════════════════════════
   ANALYSING SCREEN
═══════════════════════════════════════════════════════════════ */
#screen-analysing.active {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--gray-50);
}

.analysing-wrap {
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  padding: 40px 20px;
}

.spinner-ring {
  width: 56px; height: 56px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.analysing-wrap h2 {
  font-size: 1.35rem; font-weight: 700; color: var(--gray-900);
}
.analysing-wrap p {
  color: var(--gray-600); font-size: 0.95rem;
}

.analysing-steps {
  list-style: none; margin-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; max-width: 360px;
}
.step-li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.88rem; color: var(--gray-600);
  opacity: 0; transform: translateY(6px);
  animation: fadeUp 0.4s ease forwards;
}
.step-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gray-300); flex-shrink: 0;
}
.step-li.done  .step-dot { background: var(--green); }
.step-li.done  { color: var(--gray-800); }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS SCREEN
═══════════════════════════════════════════════════════════════ */
#screen-results.active { display: block; background: var(--gray-50); }

.results-page {
  max-width: 960px; margin: 0 auto;
  padding: 40px 24px 80px;
}

.results-top {
  text-align: center; margin-bottom: 36px;
}
.quiz-logo {
  font-weight: 800; font-size: 0.85rem; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.07em;
  display: block; margin-bottom: 10px;
}
.results-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.03em; color: var(--gray-900);
  margin-bottom: 6px;
}
.results-by { color: var(--gray-400); font-size: 0.9rem; }

/* ─── Result card ─────────────────────────────────────────────── */
.result-card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 28px 32px; margin-bottom: 20px;
}
.result-card h3 {
  font-size: 1rem; font-weight: 700; color: var(--gray-900);
  margin-bottom: 16px;
}
@media (max-width: 500px) { .result-card { padding: 20px 18px; } }

/* ─── Results layout ──────────────────────────────────────────── */
.results-layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 20px;
  align-items: start;
}
@media (max-width: 680px) {
  .results-layout { grid-template-columns: 1fr; }
}

/* ─── Radar chart ─────────────────────────────────────────────── */
.chart-card { display: flex; flex-direction: column; }
.chart-container {
  position: relative; width: 100%;
  max-width: 300px; margin: 0 auto 10px;
}
.chart-note {
  font-size: 0.75rem; color: var(--gray-400);
  text-align: center; font-style: italic; line-height: 1.5;
}

/* ─── Score blocks ────────────────────────────────────────────── */
.score-blocks {
  display: flex; flex-direction: column; gap: 14px;
}

.score-block {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  border-left: 4px solid var(--gray-300);
}
.score-block.level-low    { border-left-color: var(--green); }
.score-block.level-border { border-left-color: var(--amber); }
.score-block.level-high   { border-left-color: var(--red);   }

.score-block-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 8px; margin-bottom: 10px;
}
.score-block-name {
  font-size: 0.88rem; font-weight: 700; color: var(--gray-800);
}

.score-pill {
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.level-low    .score-pill { background: #D1FAE5; color: #065F46; }
.level-border .score-pill { background: #FEF3C7; color: #92400E; }
.level-high   .score-pill { background: #FEE2E2; color: #991B1B; }

.score-bar-row {
  display: flex; align-items: center; gap: 10px;
}
.score-track {
  flex: 1; height: 8px; background: var(--gray-100);
  border-radius: 4px; position: relative; overflow: visible;
}
.score-fill {
  height: 100%; border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.level-low    .score-fill { background: var(--green); }
.level-border .score-fill { background: var(--amber); }
.level-high   .score-fill { background: var(--red);   }

.score-threshold {
  position: absolute; top: -5px; bottom: -5px;
  width: 2px; background: var(--gray-400); border-radius: 1px;
}
.score-threshold::after {
  content: 'threshold';
  position: absolute; top: -17px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem; color: var(--gray-400);
  white-space: nowrap; font-weight: 500;
}

.score-nums {
  font-size: 0.78rem; color: var(--gray-400);
  white-space: nowrap; font-weight: 600;
}

.score-detail {
  font-size: 0.8rem; color: var(--gray-400);
  margin-top: 8px; line-height: 1.55;
}

/* ─── Interpretation ──────────────────────────────────────────── */
.interp-body { font-size: 0.93rem; color: var(--gray-600); line-height: 1.75; }
.interp-body p { margin-bottom: 12px; }
.interp-body p:last-child { margin-bottom: 0; }
.interp-body strong { color: var(--gray-900); }

.result-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #7C3AED, #2563EB);
  color: white; font-size: 0.85rem; font-weight: 700;
  padding: 6px 16px; border-radius: 20px; margin-bottom: 14px;
}

/* ─── Steps ───────────────────────────────────────────────────── */
.steps-list {
  display: flex; flex-direction: column; gap: 12px;
  list-style: none; counter-reset: steps;
}
.step-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 18px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
}
.step-num {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%; background: var(--blue); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
}
.step-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 3px; }
.step-desc  { font-size: 0.84rem; color: var(--gray-600); line-height: 1.55; }

/* ─── RAADS-R upsell ──────────────────────────────────────────── */
.raadsr-card {
  background: linear-gradient(135deg, #F5F3FF 0%, #EFF6FF 100%);
  border-color: #C4B5FD;
}
.raadsr-inner {
  display: flex; justify-content: space-between;
  align-items: center; gap: 20px; flex-wrap: wrap;
}
.raadsr-inner h3 { color: var(--purple); }
.raadsr-inner p  { font-size: 0.9rem; color: var(--gray-600); margin: 6px 0 0; }

/* ─── Results actions ─────────────────────────────────────────── */
.results-actions {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; padding: 10px 0 20px;
}

/* ─── AdSense slots ───────────────────────────────────────────── */
.ad-slot {
  margin: 0 0 20px;
  min-height: 90px;
  background: var(--gray-50);
  border-radius: var(--radius);
  overflow: hidden;
}
.ad-slot-homepage {
  max-width: 960px; margin: 0 auto;
  padding: 0 24px 32px;
  min-height: 90px;
}

/* ─── Books section ───────────────────────────────────────────── */
.books-card { margin-bottom: 20px; }

.books-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.books-header h3 { margin-bottom: 4px; }
.books-subhead {
  font-size: 0.85rem; color: var(--gray-400);
  font-weight: 400;
}
.affiliate-note {
  font-size: 0.72rem; color: var(--gray-400);
  background: var(--gray-100); border-radius: 6px;
  padding: 4px 10px; white-space: nowrap; flex-shrink: 0;
  align-self: flex-start; margin-top: 4px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 600px) {
  .books-grid { grid-template-columns: 1fr; }
}

.book-card {
  display: flex; gap: 14px;
  padding: 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: var(--white);
}
.book-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(37,99,235,0.1);
  transform: translateY(-2px);
}

.book-cover {
  width: 64px; height: 80px; flex-shrink: 0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.book-emoji { font-size: 1.8rem; }

.book-info { flex: 1; min-width: 0; }
.book-title {
  font-weight: 700; font-size: 0.92rem;
  color: var(--gray-900); margin-bottom: 2px;
  line-height: 1.3;
}
.book-author {
  font-size: 0.78rem; color: var(--gray-400);
  margin-bottom: 6px;
}
.book-desc {
  font-size: 0.8rem; color: var(--gray-600);
  line-height: 1.55; margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-cta {
  font-size: 0.78rem; font-weight: 700;
  color: var(--blue);
}
.book-card:hover .book-cta { text-decoration: underline; }

/* ─── Print ───────────────────────────────────────────────────── */
@media print {
  .screen { display: none !important; }
  #screen-results { display: block !important; }
  .results-actions, .raadsr-card, .ad-slot, .books-card { display: none !important; }
  .result-card { box-shadow: none; break-inside: avoid; }
  body { background: white; }
}
