/* ============================================================
   Petal — Design system base
   UK English, mobile-first, accessibility 45-60yo
   Palette aligned to logo (petals: rose, lilac, sage)
   ============================================================ */

:root {
  --color-surface: #FAF5EE;       /* cream (Clareza base) */
  --color-surface-2: #FFFBF4;     /* lighter cream */
  --color-sand: #EFE6D8;          /* warm sand — alternate section bg */
  --color-rose: #F2A7C4;          /* petal rose (gradients/glow only) */
  --color-primary: #E0608F;       /* rose-magenta CTA (Clareza primary) */
  --color-primary-dark: #C24878;  /* hover */
  --color-lilac: #BFA1E3;         /* lilac accent (Clareza secondary) */
  --color-sage: #A9C6A2;          /* sage (Clareza tertiary) */
  --color-plum: #4A2A44;          /* deep plum — strong headlines + dark sections */
  --color-plum-soft: #6B4565;     /* secondary text */
  --color-neutral: #837377;       /* warm neutral (Clareza neutral) — borders, fine print */
  --color-charcoal: #3B2F2A;      /* warm charcoal — body text */
  --color-charcoal-soft: #5C4A40; /* secondary body */
  --color-plum-mute: #9B7B92;     /* deprecated — use --color-neutral */
  --color-card-border: rgba(131, 115, 119, 0.18);
  --color-shadow: rgba(74, 42, 68, 0.10);

  --font-serif: 'Newsreader', 'EB Garamond', Georgia, serif;
  --font-sans: 'Hanken Grotesk', 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-pill: 9999px;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  --touch: 48px;

  --shadow-soft: 0 8px 32px rgba(74, 42, 68, 0.08);
  --shadow-card: 0 4px 16px rgba(74, 42, 68, 0.06);
  --shadow-cta: 0 8px 24px rgba(224, 96, 143, 0.25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--color-surface);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-size: 18px;            /* base 18px for accessibility */
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ---- Layout ---- */
.shell {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.container {
  width: 100%; max-width: 420px;
  margin: 0 auto;
  padding-left: 20px; padding-right: 20px;
}
.container-wide { max-width: 560px; }
.main {
  flex: 1; display: flex; flex-direction: column;
  padding-top: 24px; padding-bottom: 48px;
}
/* CRITICAL: when .main and .container share the same node, lock the padding
   so the cascade doesn't strip the horizontal padding on mobile. */
.main.container { padding: 24px 20px 48px; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  min-height: var(--touch);
}
.topbar .logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-serif);
  font-style: italic; font-weight: 500;
  font-size: 22px; color: var(--color-plum);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.topbar .logo svg { width: 28px; height: 28px; }

/* ---- Progress bar ---- */
.progress {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 20px 18px;
}
.progress-track {
  height: 5px; background: rgba(189, 161, 227, 0.30);
  border-radius: var(--radius-pill); overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-rose), var(--color-primary));
  border-radius: var(--radius-pill);
  transition: width 350ms ease-out;
}
.progress-label {
  font-size: 14px; color: var(--color-plum-soft);
  font-weight: 600; letter-spacing: 0.04em;
}

/* ---- Typography ---- */
.eyebrow {
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}
h1, .h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 7.5vw, 34px);
  line-height: 1.2;
  font-weight: 500; letter-spacing: -0.015em;
  color: var(--color-plum);
  margin: 0 0 16px;
}
h1 .italic, .h1 .italic { font-style: italic; color: var(--color-primary); }
h2, .h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 6vw, 28px);
  line-height: 1.22;
  font-weight: 500; letter-spacing: -0.01em;
  color: var(--color-plum);
  margin: 0 0 12px;
}
h3, .h3 {
  font-size: 20px; line-height: 1.35;
  font-weight: 600; color: var(--color-plum);
  margin: 0 0 8px;
}
.sub {
  font-size: 18px; line-height: 1.6;
  color: var(--color-plum-soft);
  margin: 0 0 24px;
}

/* ---- Glass card (used everywhere — landing, quiz cards, paywall) ---- */
.glass, .glass-card {
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(74, 42, 68, 0.06);
  padding: 20px;
}

/* ---- Editorial gradient backgrounds ---- */
.bg-editorial {
  background:
    radial-gradient(60% 50% at 100% 0%, rgba(242, 167, 196, 0.35) 0%, transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(169, 198, 162, 0.30) 0%, transparent 70%),
    var(--color-surface);
}
.bg-warm {
  background: linear-gradient(180deg, var(--color-surface) 0%, #FFF1ED 100%);
}
.bg-soft {
  background: linear-gradient(180deg, #FFF8F7 0%, var(--color-surface) 100%);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch);
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 17px; font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1), background 200ms, box-shadow 200ms;
  border: none;
  text-decoration: none;
  width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled {
  background: rgba(224, 96, 143, 0.4);
  cursor: not-allowed; box-shadow: none;
  transform: none;
}
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(224, 96, 143, 0.4);
  box-shadow: none;
  font-weight: 500;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-plum);
  border: 1.5px solid var(--color-primary);
}

/* ---- Option cards (quiz choices) — glassmorphism real ---- */
.options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.option {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px;
  padding: 18px 18px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(74, 42, 68, 0.06);
  font-family: var(--font-sans);
  font-size: 18px; font-weight: 500;
  color: var(--color-plum);
  text-align: left;
  cursor: pointer;
  transition: all 200ms;
}
.option:active { transform: scale(0.99); }
.option.selected {
  background: linear-gradient(180deg, rgba(224, 96, 143, 0.14) 0%, rgba(255, 255, 255, 0.55) 100%);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(224, 96, 143, 0.10), 0 8px 24px rgba(224, 96, 143, 0.12);
}
.option-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
}
.option-label { flex: 1; }
.option-check {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-card-border);
  display: flex; align-items: center; justify-content: center;
}
.option.selected .option-check {
  border-color: var(--color-primary);
  background: var(--color-primary);
}
.option.selected .option-check::after {
  content: '';
  width: 12px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-2px);
}

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label {
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-plum-soft);
}
.input {
  width: 100%; min-height: 56px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 19px;
  color: var(--color-plum);
  transition: border-color 200ms, box-shadow 200ms;
}
.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(224, 96, 143, 0.10);
}
.input::placeholder { color: var(--color-plum-mute); }

/* ---- Hero image card ---- */
.hero-img {
  width: 100%; aspect-ratio: 5 / 4;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
}
.hero-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Social proof pill ---- */
.proof-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  font-size: 14px; font-weight: 600;
  color: var(--color-plum);
}
.proof-pill .stars {
  display: inline-flex; gap: 1px;
  color: var(--color-primary);
}

/* ---- Section curved divider (real scoop, used between sections) ---- */
.curved-divider {
  position: relative;
  height: 80px;
  margin: 0 -20px -1px;
  overflow: hidden;
  pointer-events: none;
}
.curved-divider::before {
  content: '';
  position: absolute;
  left: -10%; right: -10%; top: 0; bottom: 50%;
  background: var(--current-bg, var(--color-surface));
}
.curved-divider::after {
  content: '';
  position: absolute;
  left: -10%; right: -10%; top: 0; bottom: 0;
  border-radius: 0 0 50% 50% / 0 0 60px 60px;
  background: var(--current-bg, var(--color-surface));
}
.curved-divider-up::after {
  border-radius: 50% 50% 0 0 / 60px 60px 0 0;
  top: auto; bottom: 0; height: 60px;
}
.section-rose { --current-bg: linear-gradient(180deg, rgba(242,167,196,0.18) 0%, rgba(252,246,245,0) 100%); background: var(--current-bg); padding: 32px 0; margin: 24px -20px; }
.section-sage { --current-bg: linear-gradient(180deg, rgba(169,198,162,0.20) 0%, rgba(252,246,245,0) 100%); background: var(--current-bg); padding: 32px 0; margin: 24px -20px; }
.section-lilac { --current-bg: linear-gradient(180deg, rgba(189,161,227,0.18) 0%, rgba(252,246,245,0) 100%); background: var(--current-bg); padding: 32px 0; margin: 24px -20px; }
.section-rose > *, .section-sage > *, .section-lilac > * { padding-left: 20px; padding-right: 20px; }

/* ---- Stagger animation ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 500ms ease-out both; }
.stagger > *:nth-child(1) { animation: fadeUp 500ms ease-out both 0ms; }
.stagger > *:nth-child(2) { animation: fadeUp 500ms ease-out both 80ms; }
.stagger > *:nth-child(3) { animation: fadeUp 500ms ease-out both 160ms; }
.stagger > *:nth-child(4) { animation: fadeUp 500ms ease-out both 240ms; }
.stagger > *:nth-child(5) { animation: fadeUp 500ms ease-out both 320ms; }
.stagger > *:nth-child(6) { animation: fadeUp 500ms ease-out both 400ms; }
.stagger > *:nth-child(n+7) { animation: fadeUp 500ms ease-out both 480ms; }

/* ---- Back button ---- */
.back-btn {
  position: fixed; top: 16px; left: 16px;
  z-index: 50;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 50%;
  color: var(--color-plum);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  font-size: 20px;
}

/* ---- Pulse loader ---- */
.pulse-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 96, 143, 0.4) 0%, transparent 70%);
  animation: pulse 1.6s ease-in-out infinite;
  margin: 32px auto;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50%      { transform: scale(1.05); opacity: 1.0; }
}

/* ---- Score gauge (used in 17-result) ---- */
.score-gauge { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 24px 0; }
.score-gauge-ring {
  position: relative;
  width: 160px; height: 160px;
}
.score-gauge-ring svg { transform: rotate(-90deg); }
.score-gauge-ring .track { fill: none; stroke: rgba(189, 161, 227, 0.25); stroke-width: 10; }
.score-gauge-ring .fill  { fill: none; stroke: url(#gauge-gradient); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease-out; }
.score-gauge-value {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-serif);
}
.score-gauge-value .num { font-size: 44px; font-weight: 500; color: var(--color-plum); }
.score-gauge-value .max { font-size: 16px; color: var(--color-plum-mute); }

/* ---- Plan card (paywall) ---- */
.plan-card {
  position: relative;
  background: linear-gradient(180deg, rgba(224, 96, 143, 0.06) 0%, rgba(255, 255, 255, 0.7) 100%);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 12px 32px rgba(224, 96, 143, 0.12);
}
.plan-card .badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 4px 14px;
  background: var(--color-primary); color: #fff;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.plan-card .strike { text-decoration: line-through; color: var(--color-plum-mute); margin-right: 8px; }
.plan-card .price-now {
  font-family: var(--font-serif);
  font-size: 36px; font-weight: 500;
  color: var(--color-plum);
}
.plan-card .price-equiv {
  font-size: 15px; color: var(--color-plum-soft); margin-top: 4px;
}

/* ---- Footer ---- */
.foot {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--color-plum-mute);
}
.foot a { color: var(--color-plum-soft); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Microcopy / Trust row ---- */
.trust-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 0; font-size: 15px;
  color: var(--color-plum-soft);
}
.trust-row .item { display: flex; align-items: center; gap: 8px; }

/* ---- Severity segmented control (telas 7-9) ---- */
.severity-stack {
  display: flex; flex-direction: column;
  gap: 14px; margin: 28px 0 24px;
}
.severity-btn {
  width: 100%; min-height: 64px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(74, 42, 68, 0.06);
  font-family: var(--font-sans);
  font-size: 18px; font-weight: 600;
  color: var(--color-plum);
  text-align: left;
  cursor: pointer; display: flex; align-items: center; gap: 14px;
  transition: all 200ms;
  position: relative;
}
.severity-btn:active { transform: scale(0.99); }
.severity-btn .level-bar {
  flex-shrink: 0; width: 60px; height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(189, 161, 227, 0.30);
  overflow: hidden; position: relative;
}
.severity-btn .level-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--color-sage), var(--color-rose), var(--color-primary));
  border-radius: var(--radius-pill);
  width: var(--lvl, 25%);
  transition: width 250ms;
}
.severity-btn.selected {
  background: linear-gradient(180deg, rgba(224, 96, 143, 0.14) 0%, rgba(255, 255, 255, 0.55) 100%);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(224, 96, 143, 0.10), 0 8px 24px rgba(224, 96, 143, 0.12);
}

/* ---- Ambient background glow (per screen) ---- */
.ambient-glow {
  position: fixed; inset: 0;
  z-index: -1; overflow: hidden;
  pointer-events: none;
}
.ambient-glow::before, .ambient-glow::after {
  content: ''; position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.ambient-glow::before {
  width: 340px; height: 340px;
  top: -80px; right: -80px;
  background: var(--color-lilac);
}
.ambient-glow::after {
  width: 380px; height: 380px;
  bottom: 10%; left: -100px;
  background: var(--color-rose);
}
.ambient-glow.rose::before { background: var(--color-rose); }
.ambient-glow.sage::after { background: var(--color-sage); }

/* ---- Editorial section curve (real scoop, not just border-radius) ---- */
.section-curve-top    { border-radius: 50% 50% 0 0 / 36px 36px 0 0; }
.section-curve-bottom { border-radius: 0 0 50% 50% / 0 0 36px 36px; }
.editorial-curve      { clip-path: ellipse(150% 100% at 50% 100%); }
.editorial-curve-top  { clip-path: ellipse(150% 100% at 50% 0%); }
