/* ================================================================
   QUIZ PAGE — Styles
   Follows the MART Automations light-mode design system
   ================================================================ */

/* ── Page layout ── */
.quiz-page {
  min-height: 100vh;
  padding-top: 100px;
  padding-bottom: 60px;
  position: relative;
  overflow: hidden;
}

.quiz-page .hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.quiz-page > .bg-glow--purple {
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
}

.quiz-page > .bg-glow--cyan {
  bottom: -100px;
  right: -200px;
  width: 400px;
  height: 400px;
}

.quiz-page .container {
  position: relative;
  z-index: 1;
  max-width: 740px;
}

/* ================================================================
   INTRO SCREEN
   ================================================================ */
.quiz-intro {
  text-align: center;
  animation: fadeUp 0.6s ease-out both;
}

.quiz-intro__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(90, 63, 212, 0.08), rgba(15, 143, 178, 0.08));
  border: 1px solid rgba(90, 63, 212, 0.12);
  margin-bottom: 24px;
}

.quiz-intro__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.quiz-intro__title .highlight {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quiz-intro__desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 580px;
  margin: 0 auto 32px;
}

.quiz-intro__features {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.quiz-intro__feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.quiz-intro__feature svg {
  color: var(--accent);
  flex-shrink: 0;
}

.quiz-intro__start {
  font-size: 1.05rem;
  padding: 16px 40px;
}

/* ================================================================
   QUIZ CONTAINER & PROGRESS
   ================================================================ */
.quiz-container {
  animation: fadeUp 0.5s ease-out both;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.quiz-progress__bar {
  flex: 1;
  height: 6px;
  background: rgba(90, 63, 212, 0.1);
  border-radius: 100px;
  overflow: hidden;
}

.quiz-progress__fill {
  height: 100%;
  width: 33.33%;
  background: var(--gradient-hero);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ================================================================
   QUIZ STEP
   ================================================================ */
.quiz-step {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.04);
  animation: fadeUp 0.45s ease-out both;
}

.quiz-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-hero);
}

.quiz-step__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-card);
}

.quiz-step__number {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(90, 63, 212, 0.2);
}

.quiz-step__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.quiz-step__subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ================================================================
   QUESTIONS
   ================================================================ */
.quiz-questions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-question {
  padding: 24px;
  background: rgba(249, 250, 251, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.quiz-question:hover {
  border-color: rgba(90, 63, 212, 0.15);
}

.quiz-question__text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.quiz-question__text strong {
  color: var(--accent);
}

.quiz-question__options {
  display: flex;
  gap: 12px;
}

.quiz-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.quiz-option:hover {
  border-color: rgba(90, 63, 212, 0.3);
  color: var(--accent);
  background: rgba(90, 63, 212, 0.04);
}

.quiz-option.selected[data-value="yes"] {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(90, 63, 212, 0.1), rgba(90, 63, 212, 0.05));
  color: var(--accent);
  box-shadow: 0 4px 16px rgba(90, 63, 212, 0.12);
}

.quiz-option.selected[data-value="no"] {
  border-color: #9ca3af;
  background: rgba(156, 163, 175, 0.08);
  color: #6b7280;
  box-shadow: 0 4px 16px rgba(107, 114, 128, 0.08);
}

/* ================================================================
   QUIZ NAVIGATION
   ================================================================ */
.quiz-nav {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.quiz-nav__prev {
  margin-right: auto;
}

.quiz-nav__next:disabled,
.quiz-nav__prev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ================================================================
   RESULTS SCREEN
   ================================================================ */
.quiz-results {
  animation: fadeUp 0.6s ease-out both;
}

.quiz-results__card {
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.04);
}

.quiz-results__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-hero);
}

/* Score Ring */
.quiz-results__ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  margin-bottom: 28px;
}

.quiz-results__ring {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

#result-ring-progress {
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-results__score {
  position: absolute;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.quiz-results__score span {
  font-size: 2.8rem;
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quiz-results__score small {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* Badge */
.quiz-results__badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.quiz-results__badge--low {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.quiz-results__badge--mid {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.quiz-results__badge--high {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.quiz-results__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.quiz-results__desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 520px;
  margin: 0 auto 36px;
}

.quiz-results__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ================================================================
   FOOTER (quiz page override)
   ================================================================ */
.quiz-footer {
  padding: 24px 0;
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .quiz-page {
    padding-top: 80px;
  }

  .quiz-step {
    padding: 28px 24px;
  }

  .quiz-step__header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .quiz-question {
    padding: 20px;
  }

  .quiz-question__options {
    flex-direction: column;
  }

  .quiz-option {
    justify-content: center;
    width: 100%;
  }

  .quiz-results__card {
    padding: 40px 24px;
  }

  .quiz-results__actions {
    flex-direction: column;
    align-items: center;
  }

  .quiz-intro__features {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .quiz-nav {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .quiz-nav__prev {
    margin-right: 0;
    width: 100%;
    justify-content: center;
  }

  .quiz-nav__next {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .quiz-intro__icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .quiz-intro__icon svg {
    width: 40px;
    height: 40px;
  }

  .quiz-step__number {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .quiz-results__ring-wrap {
    width: 120px;
    height: 120px;
  }

  .quiz-results__ring {
    width: 120px;
    height: 120px;
  }

  .quiz-results__score span {
    font-size: 2.2rem;
  }
}
