/* ============================================
   DK Dynamic Ventures — Quiz Funnel
   Mobile-first, one-question-per-screen
   ============================================ */

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

:root {
  --black: #0A0A0A;
  --dark-grey: #1C1C1C;
  --card-bg: #242424;
  --card-hover: #2E2E2E;
  --card-selected: #1a3a5a;
  --blue: #5BB8FF;
  --blue-glow: #A8D8FF;
  --blue-dim: #3a8ad4;
  --off-white: #F5F5F5;
  --text-muted: #999;
  --text-hint: #777;
  --success: #4ade80;
  --error: #ef4444;
  --font-body: 'Exo 2', sans-serif;
  --font-heading: 'Exo 2', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 480px;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--off-white);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#quiz-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --- Progress Bar --- */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--dark-grey);
  z-index: 100;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--blue-glow));
  transition: width 0.5s ease;
  border-radius: 0 2px 2px 0;
}

/* --- Welcome Header (logo pinned to top) --- */
.welcome-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 20px 0;
}

.welcome-header .quiz-logo {
  margin-bottom: 0;
}

/* --- Screens --- */
.screen {
  display: none;
  flex: 1;
  min-height: 100vh;
  padding: 60px 20px 40px;
  animation: fadeSlideIn 0.4s ease forwards;
  position: relative;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-content {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Logo (icon + title) --- */
.quiz-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 32px;
}

.quiz-logo img {
  height: 44px;
  width: 44px;
  object-fit: contain;
}

.quiz-logo span {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--off-white);
  letter-spacing: 0.5px;
}

.quiz-logo.result-logo {
  margin-bottom: 24px;
}

.quiz-logo.result-logo img {
  height: 36px;
  width: 36px;
}

.quiz-logo.result-logo span {
  font-size: 1rem;
}

/* --- Result Page Hero Image --- */
.result-hero-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 24px;
  opacity: 0.9;
}

/* --- Option Cards with Images (for client funnels) --- */
.option-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.option-card.has-image {
  padding: 8px;
  gap: 4px;
}

.option-card.has-image .option-text {
  padding: 4px 0;
}

/* --- Typography --- */
h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  margin-bottom: 16px;
  color: var(--off-white);
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 24px;
  color: var(--off-white);
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--off-white);
}

.subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.time-note {
  font-size: 0.85rem;
  color: var(--text-hint);
  text-align: center;
  margin-bottom: 32px;
}

.question-label {
  font-size: 0.8rem;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- Buttons --- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--blue);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

.btn-primary:hover {
  background: var(--blue-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: var(--dark-grey);
  color: var(--off-white);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid #333;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

.btn-secondary:hover {
  background: var(--card-bg);
  border-color: var(--blue);
}

.btn-outline {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  color: var(--blue);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
}

.btn-outline:hover {
  background: rgba(91, 184, 255, 0.1);
}

/* --- Option Cards (Q1 grid) --- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
  min-height: 100px;
}

.option-card:hover {
  background: var(--card-hover);
  border-color: var(--blue);
}

.option-card:active {
  background: var(--card-selected);
  border-color: var(--blue);
}

.option-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.option-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--off-white);
  text-align: center;
  line-height: 1.3;
}

/* --- Option Buttons (Q2-Q7) --- */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: var(--card-bg);
  color: var(--off-white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.option-btn:hover {
  background: var(--card-hover);
  border-color: var(--blue);
}

.option-btn:active {
  background: var(--card-selected);
  border-color: var(--blue);
}

/* --- Form --- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--card-bg);
  color: var(--off-white);
  border: 2px solid #333;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.form-group input::placeholder {
  color: var(--text-hint);
}

.form-group input:focus {
  border-color: var(--blue);
  background: #1a1a2e;
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: var(--error);
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-hint);
  margin-top: 4px;
}

.optional {
  font-weight: 300;
  color: var(--text-hint);
}

#contactForm .btn-primary {
  margin-top: 8px;
}

/* --- Result Pages --- */
.result-page {
  text-align: center;
}

.result-page h2 {
  text-align: center;
}

.result-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(91, 184, 255, 0.15);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.result-intro {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

/* --- Service Recommendation Cards --- */
.result-services {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.service-rec-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--dark-grey);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  transition: var(--transition);
}

.service-rec-card:hover {
  border-color: rgba(91, 184, 255, 0.3);
}

.service-rec-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(91, 184, 255, 0.1);
  border-radius: 10px;
  color: var(--blue);
  font-size: 1.1rem;
}

.service-rec-content {
  flex: 1;
  min-width: 0;
}

.service-rec-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 4px;
}

.service-rec-desc {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Keep old class for low-score result page */
.result-recommendation {
  background: var(--dark-grey);
  border-left: 3px solid var(--blue);
  padding: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 24px;
  text-align: left;
}

.result-recommendation p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--off-white);
}

.result-recommendation p + p {
  margin-top: 12px;
}

.social-proof {
  padding: 16px 20px;
  background: rgba(91, 184, 255, 0.05);
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
}

.social-proof p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
}

.cta-section {
  padding-top: 8px;
}

.cta-section h3 {
  text-align: center;
}

.btn-cta {
  font-size: 1.05rem;
  padding: 18px 24px;
}

.cta-note {
  font-size: 0.8rem;
  color: var(--text-hint);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

.cta-divider {
  font-size: 0.85rem;
  color: var(--text-hint);
  text-align: center;
  margin: 16px 0;
}

/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (min-width: 600px) {
  .screen {
    padding: 80px 24px 60px;
  }

  h1 {
    font-size: 2.1rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .option-card {
    padding: 24px 16px;
    min-height: 120px;
  }

  .option-text {
    font-size: 0.9rem;
  }
}

@media (min-width: 768px) {
  :root {
    --max-width: 520px;
  }
}

/* ============================================
   Confetti — Result Page Celebration
   ============================================ */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -30px;
  opacity: 0;
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) scale(0.5);
  }
  10% {
    opacity: 1;
  }
  80% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg) scale(0.3);
  }
}

@keyframes confettiDrift {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  15% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translateY(85vh) translateX(30px) rotate(540deg);
  }
}

.confetti-piece.fall {
  animation: confettiFall linear forwards;
}

.confetti-piece.drift {
  animation: confettiDrift linear forwards;
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none;
  }
  .progress-bar {
    transition: none;
  }
  .confetti-piece {
    animation: none;
    display: none;
  }
}

.option-card:focus-visible,
.option-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-outline:focus-visible {
  outline: 2px solid var(--blue-glow);
  outline-offset: 2px;
}

/* ============================================
   Light Theme — Social Media / Shared Links
   Auto-applied via ?theme=light or social referrer
   ============================================ */

[data-theme="light"] {
  --black: #FFFFFF;
  --dark-grey: #F2F4F7;
  --card-bg: #FFFFFF;
  --card-hover: #E8F0FE;
  --card-selected: #D4E8FF;
  --blue: #2B7FD4;
  --blue-glow: #1A6ABF;
  --blue-dim: #4A9AE8;
  --off-white: #1A1A1A;
  --text-muted: #555;
  --text-hint: #888;
  --success: #16a34a;
  --error: #dc2626;
}

/* Body & base */
[data-theme="light"] body {
  background: #FFFFFF;
  color: #1A1A1A;
}

/* Cards need visible borders on white */
[data-theme="light"] .option-card {
  border: 2px solid #E0E4EA;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

[data-theme="light"] .option-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(43,127,212,0.12);
}

[data-theme="light"] .option-btn {
  border: 2px solid #E0E4EA;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

[data-theme="light"] .option-btn:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(43,127,212,0.12);
}

/* Form inputs */
[data-theme="light"] .form-group input {
  background: #FFFFFF;
  color: #1A1A1A;
  border: 2px solid #D0D5DD;
}

[data-theme="light"] .form-group input::placeholder {
  color: #999;
}

[data-theme="light"] .form-group input:focus {
  border-color: var(--blue);
  background: #F0F7FF;
}

/* Primary button — blue on white needs dark text */
[data-theme="light"] .btn-primary {
  background: var(--blue);
  color: #FFFFFF;
}

[data-theme="light"] .btn-primary:hover {
  background: var(--blue-glow);
  color: #FFFFFF;
}

/* Secondary button */
[data-theme="light"] .btn-secondary {
  background: #F2F4F7;
  color: #1A1A1A;
  border-color: #D0D5DD;
}

[data-theme="light"] .btn-secondary:hover {
  background: #E8F0FE;
  border-color: var(--blue);
}

/* Outline button */
[data-theme="light"] .btn-outline {
  color: var(--blue);
  border-color: var(--blue);
}

[data-theme="light"] .btn-outline:hover {
  background: rgba(43,127,212,0.08);
}

/* Progress bar */
[data-theme="light"] .progress-bar-container {
  background: #E0E4EA;
}

[data-theme="light"] .progress-bar {
  background: linear-gradient(90deg, var(--blue), var(--blue-dim));
}

/* Result badges and cards */
[data-theme="light"] .result-badge {
  background: rgba(43,127,212,0.1);
  color: var(--blue);
}

[data-theme="light"] .service-rec-card {
  background: #F8F9FB;
  border-color: #E0E4EA;
}

[data-theme="light"] .service-rec-card:hover {
  border-color: rgba(43,127,212,0.4);
}

[data-theme="light"] .service-rec-icon {
  background: rgba(43,127,212,0.1);
  color: var(--blue);
}

[data-theme="light"] .result-recommendation {
  background: #F2F4F7;
  border-left-color: var(--blue);
}

[data-theme="light"] .social-proof {
  background: rgba(43,127,212,0.04);
}

/* Spinner on light */
[data-theme="light"] .spinner {
  border-top-color: #FFFFFF;
}

/* Logo text color */
[data-theme="light"] .quiz-logo span {
  color: #1A1A1A;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 200;
  background: var(--card-bg);
  border: 1px solid #333;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  color: var(--off-white);
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--blue);
  background: var(--card-hover);
}

[data-theme="light"] .theme-toggle {
  border-color: #D0D5DD;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

[data-theme="light"] .theme-toggle:hover {
  border-color: var(--blue);
}
