:root {
  --color-primary: #9B682B;
  --color-primary-hover: #835621;
  --color-secondary: #9CE579;
  --color-bg-page: #F3E6D8;
  --color-bg-quiz: #E6D1BC;
  --color-text: #0A0908;
  --color-text-muted: #403F3F;
  --color-border: #EAEAEB;
  --color-white: #FFFFFF;
  --color-success: #1F9926;
  --color-progress-fill: #4CAF50;
  --color-track-bg: #D4E8D4;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  min-height: 100%;
  background-color: var(--color-bg-page);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--color-bg-page);
  padding: 18px 16px;
}

.site-header__inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.back-btn.is-visible {
  display: flex;
}

.back-btn:hover {
  background-color: rgba(139, 139, 158, 0.18);
}

.back-btn svg {
  width: 22px;
  height: 22px;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

/* Top Progress Bar */
.top-progress {
  width: 100%;
  height: 4px;
  background-color: var(--color-white);
  overflow: hidden;
}

.top-progress__fill {
  height: 100%;
  width: 6%;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

/* Quiz Main Container */
.quiz-shell {
  min-height: calc(100vh - 82px);
  background-color: var(--color-bg-quiz);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 64px;
}

.quiz-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Step Animation */
.quiz-step {
  display: none;
  animation: stepFadeIn 0.22s ease-out;
}

.quiz-step.is-active {
  display: block;
}

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

/* Typography */
.step-hero-title {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.32;
  text-align: center;
  color: var(--color-text);
  margin-bottom: 14px;
}

.step-subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  color: var(--color-text);
  margin-bottom: 18px;
}

.step-question {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  color: var(--color-text);
  margin-top: 8px;
  margin-bottom: 18px;
}

.step-question--sm {
  font-size: 20px;
  margin-top: 12px;
  margin-bottom: 14px;
}

.step-helper {
  font-size: 15px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: -10px;
  margin-bottom: 18px;
  line-height: 1.45;
}

/* Age Grid (Step 1 - Half Solid Image Cards) */
.age-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 10px;
  margin-bottom: 18px;
}

.age-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-primary);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  text-align: left;
  padding: 0;
  font-family: inherit;
}

.age-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(155, 104, 43, 0.22);
}

.age-card__image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  overflow: hidden;
}

.age-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.age-card:hover .age-card__image {
  transform: scale(1.03);
}

.age-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 700;
}

.age-card__arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.age-card__arrow svg {
  width: 14px;
  height: 14px;
}

.skip-quiz-wrap {
  text-align: center;
  margin-top: 8px;
}

.skip-quiz-link {
  display: inline-block;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  letter-spacing: 0.3px;
  padding: 8px 12px;
  transition: opacity 0.15s ease;
}

.skip-quiz-link:hover {
  opacity: 0.75;
}

/* Option List (Outline Solid Cards) */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 16px;
}

.option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background-color: var(--color-white);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.option-btn:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.option-btn.is-selected {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.option-btn__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.option-btn__icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background-color: #fff;
  padding: 2px;
}

.option-btn__checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #C5C5C7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-white);
  color: var(--color-primary);
  transition: all 0.15s ease;
}

.option-btn.is-selected .option-btn__checkbox {
  border-color: var(--color-white);
  background: var(--color-white);
  color: var(--color-primary);
}

.option-btn__checkbox svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.option-btn.is-selected .option-btn__checkbox svg {
  opacity: 1;
}

/* Primary Continue / CTA Button */
.continue-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.12s ease;
  margin-top: 10px;
}

.continue-btn:hover {
  background-color: var(--color-primary-hover);
}

.continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Featured Image Card (Step 7, Step 11, Step 17) */
.feature-image-wrap {
  margin: 14px 0 18px;
  border-radius: 16px;
  overflow: hidden;
}

.feature-image {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

/* Why We Ask Info Box (Steps 12 & 13) */
.why-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(155, 104, 43, 0.22);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
}

.why-box__icon {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.why-box__icon svg {
  width: 24px;
  height: 24px;
}

.why-box__content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
}

.why-box__content strong {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

/* ===== Step 14: Hairloss Assessment Card ===== */
.hairloss-wrapper {
  width: 100%;
  margin: 12px 0 18px;
}

.hairloss-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  margin-bottom: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.hairloss-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 10px;
}

.hairloss-card__title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}

.hairloss-severity-badge {
  background: #fff0f0;
  color: #e74c4c;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 50px;
  border: 1.5px solid #fcd5d5;
  white-space: nowrap;
}

.hairloss-photo {
  display: flex;
  justify-content: center;
  margin-bottom: -40px;
}

.hairloss-photo img {
  width: 100%;
  max-width: 260px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

.hairloss-slider {
  position: relative;
  margin-bottom: 8px;
  padding-top: 50px;
}

.hairloss-slider__tooltip {
  position: absolute;
  top: 4px;
  background: #2d2d2d;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 10px;
  white-space: nowrap;
  transform: translateX(-50%);
  left: 10%;
  opacity: 0;
}

.quiz-step.is-active .hairloss-slider__tooltip {
  animation: tooltipSlide 1.8s ease-out 0.3s forwards;
}

.hairloss-slider__tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #2d2d2d;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

@keyframes tooltipSlide {
  0% { left: 10%; opacity: 0; }
  20% { opacity: 1; }
  100% { left: 82%; opacity: 1; }
}

.hairloss-slider__track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #a8d8ea, #7ec8e3, #59c9a5, #b8e986, #f7e76d, #f5c842, #f0a030, #eb6b4a, #e74c4c);
  overflow: visible;
}

.hairloss-slider__thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border: 3px solid #fff;
  left: 10%;
}

.quiz-step.is-active .hairloss-slider__thumb {
  animation: thumbSlide 1.8s ease-out 0.3s forwards, pulseGlow 1.5s ease-in-out 2.1s infinite;
}

@keyframes thumbSlide {
  0% { left: 10%; }
  100% { left: 82%; }
}

.hairloss-slider__dim-overlay {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: rgba(255,255,255,0.55);
  border-radius: 0 6px 6px 0;
  width: 90%;
}

.quiz-step.is-active .hairloss-slider__dim-overlay {
  animation: overlaySlide 1.8s ease-out 0.3s forwards;
}

@keyframes overlaySlide {
  0% { width: 90%; }
  100% { width: 18%; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 2px 8px rgba(231,76,76,0.18); }
  50% { box-shadow: 0 2px 20px rgba(231,76,76,0.45); }
}

.hairloss-slider__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: #888;
  font-weight: 500;
  padding: 0 2px;
}

.hairloss-alert {
  margin-top: 20px;
  background: #fff0f0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hairloss-alert__icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: #fcd5d5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #e74c4c;
  font-weight: 700;
}

.hairloss-alert__title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 2px;
  text-align: left;
}

.hairloss-alert__description {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  text-align: left;
}

.hairloss-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hairloss-metric-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}

.hairloss-metric-card__icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.hairloss-metric-card__icon--aging { background: #fff8e6; }
.hairloss-metric-card__icon--improvement { background: #e8f7ee; }
.hairloss-metric-card__icon--trigger { background: #eef3ff; }
.hairloss-metric-card__icon--impact { background: #fef3e6; }

.hairloss-metric-card__label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
  margin-bottom: 2px;
}

.hairloss-metric-card__value {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

/* ===== Step 15: Monthly Growth Chart ===== */
.chart-target-date {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-success);
  margin: 6px 0 14px;
}

.monthly-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 24px 20px 18px;
  justify-content: center;
}

.monthly-chart__bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}

.monthly-chart__track {
  width: 72px;
  height: 260px;
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.monthly-chart__fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 15px;
  transform-origin: bottom;
  transform: scaleY(0);
}

.quiz-step.is-active .monthly-chart__fill {
  animation: monthlyChartFillUp 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes monthlyChartFillUp {
  to { transform: scaleY(1); }
}

.monthly-chart__fill--1 {
  height: 105px;
  background: #9CE579;
  animation-delay: 0.15s !important;
}
.monthly-chart__fill--2 {
  height: 150px;
  background: #F4E69D;
  animation-delay: 0.3s !important;
}
.monthly-chart__fill--3 {
  height: 175px;
  background: #E6B18C;
  animation-delay: 0.45s !important;
}
.monthly-chart__fill--4 {
  height: 205px;
  background: #F4CC9C;
  animation-delay: 0.6s !important;
}
.monthly-chart__fill--5 {
  height: 242px;
  background: #E6978C;
  animation-delay: 0.75s !important;
}

.monthly-chart__label {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  min-height: 20px;
}

.monthly-chart__goal {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
}

.quiz-step.is-active .monthly-chart__goal {
  animation: monthlyChartShowGoal 0.5s ease 1.5s forwards;
}

@keyframes monthlyChartShowGoal {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.monthly-chart__goal-badge {
  background: #34a853;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.monthly-chart__goal-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #34a853;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.monthly-chart__goal-icon::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34a853;
}

/* ===== Step 16: Interactive 3-Step Loader + Popup ===== */
.stepper {
  width: 100%;
  max-width: 540px;
  padding: 28px 16px;
  margin: 0 auto;
}

.loader-step {
  margin-bottom: 26px;
  transition: opacity 0.4s ease;
}

.loader-step__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.loader-step__label {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.loader-step__info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.loader-step__check {
  color: var(--color-progress-fill);
  display: none;
}

.loader-step__check.is-visible {
  display: block;
}

.loader-progress {
  width: 100%;
  height: 12px;
  background: var(--color-track-bg);
  border-radius: 6px;
  overflow: hidden;
}

.loader-progress__fill {
  height: 100%;
  width: 0%;
  background: var(--color-progress-fill);
  border-radius: 6px;
  transition: width 0.05s linear;
}

/* Popup Modal */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 30, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.popup-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.popup-card {
  background: #fff;
  border-radius: 18px;
  padding: 26px 24px;
  max-width: 410px;
  width: 100%;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.25s ease;
  box-shadow: 0 16px 40px rgba(0,0,0,0.22);
}

.popup-overlay.is-active .popup-card {
  transform: scale(1);
}

.popup-card__subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
}

.popup-card__title {
  color: var(--color-text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 22px;
}

.popup-card__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.popup-card__btn {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  background: var(--color-progress-fill);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.12s ease;
}

.popup-card__btn:hover {
  opacity: 0.9;
}

/* ===== Step 17: Final Plan Screen ===== */
.plan-copy {
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 14px;
}

.plan-copy strong {
  font-weight: 700;
}

.plan-highlight-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.38;
  text-align: center;
  color: var(--color-text);
  margin: 14px 0 10px;
}

.cta-final-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 8px 22px rgba(155, 104, 43, 0.3);
  transition: background-color 0.18s ease, transform 0.15s ease;
  margin-top: 12px;
}

.cta-final-btn:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* Mobile Adjustments */
@media (max-width: 576px) {
  .site-header {
    background-color: var(--color-bg-quiz);
    padding: 14px 12px;
  }

  .brand-logo {
    height: 44px;
  }

  .quiz-shell {
    padding: 20px 14px 48px;
  }

  .step-hero-title {
    font-size: 24px;
  }

  .step-question {
    font-size: 22px;
  }

  .option-btn {
    font-size: 16px;
    padding: 14px 16px;
  }

  .hairloss-card {
    padding: 20px 16px;
  }

  .hairloss-card__title {
    font-size: 19px;
  }

  .hairloss-metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .monthly-chart {
    gap: 8px;
    padding: 18px 6px 12px;
  }

  .monthly-chart__track {
    width: 52px;
    height: 230px;
    border-radius: 12px;
  }

  .monthly-chart__label {
    font-size: 12px;
  }
}
