/* ==========================================================================
   HAIR HEALTH & DAMAGE QUIZ - BOTANICAL BEAUTY STYLESHEET
   Aesthetic: Organic Luxury, Earthy Tones, Soft Neutrals, Mobile-First
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-sand: #F8F5F0;
  --bg-linen: #F2ECE4;
  --card-bg: #FFFFFF;
  --surface-warm: #FAF7F2;
  --surface-alt: #F3ECE2;

  --text-dark: #27221F;
  --text-muted: #6B625B;
  --text-light: #9B9188;

  --terracotta-primary: #B5673E;
  --terracotta-hover: #9E5630;
  --terracotta-dark: #7A3F20;
  --terracotta-light: #FBEFE8;
  --terracotta-border: #ECCBB9;

  --sage-accent: #6C7D66;
  --sage-light: #EDF1EC;
  --sage-border: #CFD9CC;

  --amber-gold: #C99757;
  --amber-light: #FBF4EA;

  --border-subtle: #E8E0D7;
  --border-focus: #B5673E;

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows */
  --shadow-soft: 0 10px 30px rgba(50, 40, 35, 0.05);
  --shadow-card: 0 20px 45px rgba(50, 40, 35, 0.08);
  --shadow-hover: 0 12px 28px rgba(181, 103, 62, 0.14);
  --shadow-cta: 0 14px 34px rgba(181, 103, 62, 0.38);

  /* Transitions */
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slide: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-sand);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 24px 16px 40px;
}

/* Decorative Ambient Gradients */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.glow-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(236, 203, 185, 0.65) 0%, rgba(248, 245, 240, 0) 70%);
  top: -80px;
  right: -80px;
}

.glow-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(207, 217, 204, 0.55) 0%, rgba(248, 245, 240, 0) 70%);
  bottom: 5%;
  left: -100px;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-primary);
  background: var(--terracotta-light);
  border: 1px solid var(--terracotta-border);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.leaf-icon {
  font-size: 0.65rem;
  opacity: 0.8;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.15;
  margin-bottom: 8px;
}

.brand-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 380px;
  margin: 0 auto;
}

/* Quiz Card Container */
.quiz-card {
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 24px 20px 28px;
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  transition: min-height 0.4s ease;
}

/* Navigation Header: Back button & Step */
.quiz-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  height: 28px;
}

.back-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.back-btn:hover {
  color: var(--terracotta-primary);
  background: var(--surface-warm);
}

.step-indicator {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Progress Track */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-linen);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--terracotta-primary), var(--amber-gold));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slides Viewport & Slide Transitions */
.slides-viewport {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
  transition: var(--transition-slide);
  display: flex;
  flex-direction: column;
}

.slide.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.slide.prev {
  transform: translateX(-40px);
  opacity: 0;
  pointer-events: none;
}

/* Question Header Typography */
.question-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--terracotta-primary);
  margin-bottom: 8px;
  display: block;
}

.question-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.question-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

.option-card {
  width: 100%;
  background: var(--surface-warm);
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-smooth);
  position: relative;
  font-family: var(--font-sans);
}

.option-card:hover {
  background: #FFFFFF;
  border-color: var(--terracotta-border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.option-card:active {
  transform: scale(0.985);
}

.option-icon {
  font-size: 1.25rem;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.option-label {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-dark);
  flex: 1;
}

/* Custom Radio Indicator */
.radio-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: #FFFFFF;
  position: relative;
  transition: var(--transition-smooth);
  margin-left: 10px;
}

.option-card.selected {
  background: var(--terracotta-light);
  border-color: var(--terracotta-primary);
  box-shadow: 0 4px 14px rgba(181, 103, 62, 0.15);
}

.option-card.selected .radio-indicator {
  border-color: var(--terracotta-primary);
  background: var(--terracotta-primary);
}

.option-card.selected .radio-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFFFFF;
}

/* ==========================================================================
   LOADING / DAMAGE CALCULATION SCREEN
   ========================================================================== */
.loader-slide {
  text-align: center;
  padding: 40px 10px;
  align-items: center;
  justify-content: center;
}

.loader-content {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pulsing-leaf-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--terracotta-light);
  border: 1px solid var(--terracotta-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
}

.pulsing-leaf-circle .leaf-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed var(--terracotta-primary);
  animation: rotateGlow 8s linear infinite;
  opacity: 0.6;
}

.loader-icon {
  font-size: 2.2rem;
  animation: pulseIcon 1.8s ease-in-out infinite alternate;
}

@keyframes pulseIcon {
  0% { transform: scale(0.92); opacity: 0.85; }
  100% { transform: scale(1.08); opacity: 1; }
}

@keyframes rotateGlow {
  100% { transform: rotate(360deg); }
}

.loader-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.loader-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  min-height: 24px;
  margin-bottom: 24px;
  font-style: italic;
}

.loader-progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-linen);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border-subtle);
}

.loader-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--terracotta-primary), var(--amber-gold));
  border-radius: 999px;
  transition: width 0.15s linear;
}

.loader-percentage {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--terracotta-primary);
  margin-bottom: 24px;
}

.loader-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag-item {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-warm);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ==========================================================================
   RESULT SCREEN & CONVERSION STYLES
   ========================================================================== */
.result-slide {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-badge-wrap {
  text-align: center;
  margin-bottom: -6px;
}

.result-badge {
  display: inline-block;
  background: var(--sage-light);
  color: var(--sage-accent);
  border: 1px solid var(--sage-border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
}

/* Damage Score Card */
.damage-score-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface-warm);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 18px 16px;
}

.score-circle {
  width: 86px;
  height: 86px;
  position: relative;
  flex-shrink: 0;
}

.score-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

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

.score-ring-fill {
  fill: none;
  stroke: var(--terracotta-primary);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.score-value {
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--terracotta-dark);
  line-height: 1;
}

.score-caption {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  font-weight: 600;
  margin-top: 2px;
}

.score-text-details {
  flex: 1;
}

.urgency-pill {
  display: inline-block;
  background: #FEECEB;
  color: #B93826;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.diagnosis-headline {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 4px;
}

.diagnosis-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Natural Restoration Alert Callout */
.restoration-alert-box {
  background: #FCF9F4;
  border-left: 4px solid var(--terracotta-primary);
  border-radius: 0 16px 16px 0;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.alert-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-content h4 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--terracotta-dark);
  margin-bottom: 4px;
}

.alert-content p {
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.45;
}

.alert-content strong {
  color: var(--terracotta-dark);
}

/* Recommendation Spotlight Card */
.recommendation-card {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--surface-warm) 100%);
  border: 2px solid var(--terracotta-border);
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow: 0 10px 28px rgba(181, 103, 62, 0.08);
  position: relative;
}

.recom-header {
  text-align: center;
  margin-bottom: 18px;
}

.top-rated-tag {
  display: inline-block;
  background: var(--amber-light);
  color: var(--amber-gold);
  border: 1px solid rgba(201, 151, 87, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.recom-product-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--terracotta-dark);
  line-height: 1.15;
  margin-bottom: 6px;
}

.recom-product-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
}

/* Benefits Checklist */
.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-dark);
}

.benefit-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sage-light);
  color: var(--sage-accent);
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Trust Badges */
.trust-grid {
  display: flex;
  justify-content: space-around;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 10px 8px;
  border: 1px dashed var(--border-subtle);
  margin-bottom: 22px;
}

.trust-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   MASSIVE CALL TO ACTION (CTA) BUTTON
   High conversion, organic glowing pulse, unmissable presence
   ========================================================================== */
.cta-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: linear-gradient(135deg, #B5673E 0%, #8E441D 100%);
  color: #FFFFFF !important;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 20px 24px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  animation: ctaPulse 3s infinite;
}

.cta-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 40px rgba(181, 103, 62, 0.48);
  background: linear-gradient(135deg, #C27247 0%, #9B4B22 100%);
}

.cta-button:active {
  transform: translateY(0) scale(0.99);
}

.cta-text {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cta-arrow {
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.cta-button:hover .cta-arrow {
  transform: translateX(5px);
}

/* Shimmer Highlight Effect */
.cta-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: shineSweep 4s infinite;
}

@keyframes shineSweep {
  0% { left: -100%; }
  25% { left: 200%; }
  100% { left: 200%; }
}

@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 14px 34px rgba(181, 103, 62, 0.38);
  }
  50% {
    box-shadow: 0 18px 42px rgba(181, 103, 62, 0.6);
  }
}

.cta-subtext {
  font-size: 0.72rem;
  color: var(--text-light);
  text-align: center;
  font-weight: 500;
}

/* Retake Quiz Button */
.retake-btn {
  align-self: center;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  margin-top: 4px;
  transition: var(--transition-smooth);
}

.retake-btn:hover {
  color: var(--terracotta-primary);
  background: var(--surface-warm);
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.74rem;
  color: var(--text-light);
}

/* ==========================================================================
   DESKTOP & LARGER SCREENS ENHANCEMENT
   ========================================================================== */
@media (min-width: 600px) {
  body {
    padding: 40px 20px 60px;
  }

  .app-container {
    max-width: 520px;
  }

  .quiz-card {
    padding: 30px 28px 34px;
    border-radius: 28px;
  }

  .brand-title {
    font-size: 2.35rem;
  }

  .question-title {
    font-size: 1.8rem;
  }

  .options-grid:not(.vertical) {
    grid-template-columns: 1fr 1fr;
  }
}
