/* ───────────────────────────────────────────────────────────────
   Survey — hims-style mobile-first UI
   Margherita green canvas · Fraunces serif headings · white rounded
   option cards · brand-colour selection · sticky green pill CTA
   ─────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Margherita palette — exact values from gruppomargherita.it (Avada vars) */
  --green-primary: #1BA456;    /* main accent / brand green  (awb-color4) */
  --green-dark:    #039B44;    /* hover / deeper green       (awb-color5) */
  --green-light:   #6FCB99;    /* soft green highlights */
  --yellow-accent: #F3CC35;    /* daisy/margherita yellow    (awb-color3) */
  --text-dark:     #2B2B2B;    /* headings / body text       (awb-color7) */
  --text-gray:     #676767;    /* secondary text             (awb-color6) */
  --bg-white:      #FFFFFF;    /* main background            (awb-color1) */
  --bg-light:      #F4F7F4;    /* section / muted background */

  /* app tokens */
  --brand: var(--green-primary);   /* overridden inline from the database */
  --ink: var(--text-dark);
  --ink-soft: var(--text-gray);
  --cream: var(--bg-white);        /* page canvas: pure white, like the site */
  --card: var(--bg-white);
  --line: #E5EAE5;
  --line-strong: #C9D4C9;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(43, 43, 43, .04), 0 6px 18px -8px rgba(43, 43, 43, .10);
  --ease-spring: cubic-bezier(.22, 1, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100dvh;
  font-size: 16.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 22px;
}

/* ── Top bar ─────────────────────────────────────────────── */

.topbar {
  display: flex;
  flex-direction: column;
  background: var(--brand);
  margin: 0 -22px;
  padding: 0 16px 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding-top: env(safe-area-inset-top, 10px);
  padding-top: max(10px, env(safe-area-inset-top));
}

.back {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  text-decoration: none;
  flex: 0 0 36px;
  transition: transform .15s var(--ease-spring), background .15s;
}
.back:active { transform: scale(.92); }
.back--ghost { background: transparent; border-color: transparent; }

/* Inline SVG logo — large, centered, fills available space */
.logo-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 0 10px;
}
.logo-svg svg {
  height: 46px;
  width: auto;
  max-width: 100%;
  display: block;
}
/* Color overrides for Margherita SVG on the green header:
   - white petals (.cls-3) stay white — visible on green by design
   - text (.cls-4) grey → white
   - petal detail lines (.cls-1) grey → semi-transparent white
   - yellow center (.cls-2) unchanged — brand yellow pops on green */
.topbar .cls-4 { fill: #fff; }
.topbar .cls-1 { fill: rgba(255,255,255,0.45); }

.logo { height: 38px; width: auto; filter: brightness(0) invert(1); }
.logo-text {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  color: #fff;
  flex: 1;
  text-align: center;
}
.step-count {
  flex: 0 0 36px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  font-variant-numeric: tabular-nums;
}

/* ── Progress bar (embedded in topbar) ───────────────────── */

.progress {
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,0.28);
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: rgba(255,255,255,0.9);
  transition: width .5s var(--ease-spring);
}

/* ── Screen & transitions ────────────────────────────────── */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 0 130px;          /* room for the sticky CTA */
  animation: fade-in .35s ease both;
}
.screen:has(.sticky-cta--inline) { padding-bottom: 12px; }

/* Content cascades in: from the right going forward, from the
   left coming back (html.nav-back is set by survey.js before paint). */
.screen > * { animation: enter-fwd .55s var(--ease-spring) both; }
html.nav-back .screen > * { animation-name: enter-back; }

/* The form fades as one block so its fixed CTA keeps its viewport
   anchor (a transformed ancestor would re-anchor position: fixed);
   the form's children carry the slide instead. */
.screen > form,
html.nav-back .screen > form { animation-name: fade-in; }
.screen > form > :not(.sticky-cta) { animation: enter-fwd .55s var(--ease-spring) both; }
html.nav-back .screen > form > :not(.sticky-cta) { animation-name: enter-back; }

.screen > *:nth-child(1) { animation-delay: .03s; }
.screen > *:nth-child(2) { animation-delay: .09s; }
.screen > *:nth-child(3) { animation-delay: .15s; }
.screen > *:nth-child(4) { animation-delay: .21s; }
.screen > *:nth-child(n+5) { animation-delay: .27s; }
.screen > form > *:nth-child(2) { animation-delay: .18s; }
.screen > form > *:nth-child(3) { animation-delay: .24s; }
.screen > form > *:nth-child(n+4) { animation-delay: .30s; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes enter-fwd {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: none; }
}
@keyframes enter-back {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: none; }
}

/* Exit: the screen glides out in the travel direction. */
.screen.is-leaving > *,
.screen.is-leaving > form > * { animation: none; }
.screen.is-leaving { animation: leave-fwd .22s ease-in both; }
.screen.is-leaving.is-leaving-back { animation-name: leave-back; }
@keyframes leave-fwd  { to { opacity: 0; transform: translateX(-30px); } }
@keyframes leave-back { to { opacity: 0; transform: translateX(30px); } }

@media (prefers-reduced-motion: reduce) {
  .screen, .screen > *, .screen > form > *, .screen.is-leaving { animation: none; }
}

/* ── Typography ──────────────────────────────────────────── */

.eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand);
  margin-bottom: 14px;
}
h1 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(21px, 5.6vw, 26px);
  line-height: 1.22;
  letter-spacing: -.015em;
  margin-bottom: 10px;
  text-wrap: balance;
}
.subtitle {
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 26px;
}
.hint {
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 14px;
}

/* ── Alert ───────────────────────────────────────────────── */

.alert {
  background: #FBEDEA;
  border: 1px solid #EDC9BF;
  color: #99311C;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14.5px;
  margin-bottom: 20px;
}

/* ── Privacy notice ──────────────────────────────────────── */

.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-height: min(270px, 34dvh);   /* keep the checkbox + button reachable on small phones */
  overflow-y: auto;
  margin-bottom: 18px;
}
.notice p + p { margin-top: 10px; }
.notice strong { color: var(--ink); }
.notice a { color: var(--brand); font-weight: 600; }

/* ── Consent checkbox row ────────────────────────────────── */

.consent-row {
  margin-bottom: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.consent-row input { position: absolute; opacity: 0; pointer-events: none; }
.consent-row .checkmark {
  flex: 0 0 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 8px;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
  transition: all .18s var(--ease-spring);
}
.consent-row .checkmark svg { width: 15px; height: 15px; opacity: 0; transform: scale(.4); transition: all .18s var(--ease-spring); }
.consent-row:has(input:checked),
.consent-row.is-checked { border-color: var(--brand); }
.consent-row:has(input:checked) .checkmark,
.consent-row.is-checked .checkmark { background: var(--brand); border-color: var(--brand); }
.consent-row:has(input:checked) .checkmark svg,
.consent-row.is-checked .checkmark svg { opacity: 1; transform: scale(1); }
.consent-text { font-size: 14.5px; line-height: 1.55; }

/* ── Input fields ────────────────────────────────────────── */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.55; }
/* custom dropdown arrow (native one is removed by appearance:none) */
.field select {
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237A8472' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
.field input::placeholder,
.field textarea::placeholder { color: #A2AC9B; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent), var(--shadow);
}

/* Promoter: the second question heading (above the stars) needs breathing room
   after the dropdown. It uses the normal <h1> styling, just extra top margin. */
.q-restated { margin-top: 30px; }

/* Custom dropdown — themed so the OPEN list matches the design too
   (native <select> option lists can't be styled). */
.cselect { position: relative; }
.cselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  font-size: 17px;
  text-align: left;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.cselect-trigger.is-placeholder .cselect-value { color: #A2AC9B; }
.cselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-arrow {
  width: 22px; height: 22px; flex: 0 0 auto;
  color: #7A8472;
  transition: transform .2s var(--ease-spring);
}
.cselect.is-open .cselect-trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent), var(--shadow);
}
.cselect.is-open .cselect-arrow { transform: rotate(180deg); }
.cselect-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 30;
  margin: 0; padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 44px -12px rgba(0, 0, 0, .28);
  max-height: 264px;
  overflow-y: auto;
  display: none;
  animation: cselect-pop .16s var(--ease-spring);
}
.cselect.is-open .cselect-list { display: block; }
@keyframes cselect-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cselect-option {
  padding: 13px 14px;
  border-radius: 11px;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: background .12s;
}
.cselect-option:hover,
.cselect-option:focus { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.cselect-option.is-selected {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .cselect-list { animation: none; }
  .cselect-arrow { transition: none; }
}

/* live per-field validation */
.field.has-error input,
.field.has-error textarea {
  border-color: #C2451E;
  box-shadow: 0 0 0 4px rgba(194, 69, 30, .10), var(--shadow);
}
.field-error {
  display: none;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.4;
  color: #A8341A;
  animation: error-in .2s ease-out;
}
.field.has-error .field-error { display: block; }
@keyframes error-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

/* ── Option cards (legacy list — kept for any existing non-grid usage) ── */

.options { display: flex; flex-direction: column; gap: 12px; }
.option { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.option input { position: absolute; opacity: 0; pointer-events: none; }

.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 56px 18px 20px;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.35;
  transition: border-color .18s, background .18s, transform .12s var(--ease-spring);
}
.option:active .option-card { transform: scale(.98); }

.option .tick {
  position: absolute;
  right: 16px;
  top: 50%;
  translate: 0 -50%;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: #fff;
  transition: all .18s var(--ease-spring);
}
.option .tick svg { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: all .18s var(--ease-spring); }

.option input:checked + .option-card {
  border-color: var(--brand);
  border-width: 2px;
  padding: 17.5px 55.5px 17.5px 19.5px;
  background: color-mix(in srgb, var(--brand) 4%, #fff);
  animation: card-pop .35s var(--ease-spring);
}
@keyframes card-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}
.option input:checked + .option-card .tick {
  background: var(--brand);
  border-color: var(--brand);
}
.option input:checked + .option-card .tick svg { opacity: 1; transform: scale(1); }

/* ── Single-select: 2-column card grid ───────────────────── */

.options--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.option-grid { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.option-grid input { position: absolute; opacity: 0; pointer-events: none; }
.option-grid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 130px;
  padding: 22px 12px 18px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: border-color .18s, background .18s, transform .12s var(--ease-spring);
}
.option-grid:active .option-grid-card { transform: scale(.97); }
.option-grid-emoji { font-size: 38px; line-height: 1; }
.option-grid-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.option-grid input:checked + .option-grid-card {
  border-color: var(--brand);
  border-width: 2px;
  background: color-mix(in srgb, var(--brand) 5%, #fff);
  animation: card-pop .35s var(--ease-spring);
}

/* ── Multiple-select: wrapping pill chips ────────────────── */

.options--pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.option-pill { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.option-pill input { position: absolute; opacity: 0; pointer-events: none; }
.option-pill span {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color .18s, background .18s, color .18s, transform .12s var(--ease-spring);
}
.option-pill:active span { transform: scale(.96); }
.option-pill input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  animation: card-pop .35s var(--ease-spring);
}

/* ── Star rating ─────────────────────────────────────────── */

/* Row is visually reversed so "this star and all before it" can be
   expressed with sibling selectors: checked ~ label = stars to the LEFT. */
.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 6px;
  padding: 18px 0 6px;
}
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease-spring);
}
.stars label:active { transform: scale(.88); }
.stars svg {
  width: 52px; height: 52px;
  display: block;
  fill: transparent;
  stroke: var(--line-strong);
  stroke-width: 1.6;
  transition: fill .15s, stroke .15s, transform .2s var(--ease-spring);
}
.stars input:checked + label svg,
.stars input:checked + label ~ label svg {
  fill: var(--yellow-accent);
  stroke: #D9B722;
}
.stars input:checked + label svg { transform: scale(1.12); }
.stars-hint {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
  min-height: 20px;
}
/* Range labels under the 1★ (left) and 5★ (right) ends of the scale. */
.stars-scale {
  display: flex;
  justify-content: space-between;
  max-width: 284px;
  margin: 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ── Opt-in screen: the two buttons are the answer ──────── */

.sticky-cta--optin {
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}
.optin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 376px;
  pointer-events: auto;
}
.btn--ghost {
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.btn--ghost:hover { background: var(--card); border-color: var(--ink); }
.optin-note {
  pointer-events: auto;
  max-width: 376px;
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
  padding: 0 6px;
}
.screen:has(.sticky-cta--optin) { padding-bottom: 240px; }

/* ── Hero optin (full-page image + overlay buttons) ──────── */

.screen--hero {
  padding: 0 !important;
}
.screen--hero > form {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* override the slide-in; image fades in instead */
  animation: fade-in .4s ease both;
}
.optin-hero {
  flex: 1;
  position: relative;
  margin: 0 -22px;   /* break out of app side padding */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.optin-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.optin-hero-overlay {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 22px calc(36px + env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.52) 38%,
    rgba(0,0,0,0.18) 62%,
    transparent 100%
  );
}
.optin-hero-body {
  margin-bottom: 28px;
}
.optin-hero-body h1 {
  color: #fff;
  font-size: clamp(26px, 7.5vw, 34px);
  margin-bottom: 10px;
}
.optin-hero-body .subtitle {
  color: rgba(255,255,255,0.82);
  margin-bottom: 0;
}
.optin-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
/* "No, grazie" ghost button on dark image background */
.optin-hero-no {
  background: rgba(255,255,255,0.14);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff;
  box-shadow: none;
}
.optin-hero-no:hover { background: rgba(255,255,255,0.22); }
.optin-hero .optin-note {
  color: rgba(255,255,255,0.55);
  text-align: center;
  font-size: 11.5px;
  line-height: 1.5;
  padding: 0;
  margin: 0;
}

/* info screens: image + text, no answer */
.info-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-bottom: 4vh;
}
.info-screen h1 { margin-top: 26px; }
.info-screen .subtitle { margin-bottom: 0; }
.info-image {
  width: 100%;
  max-height: 42dvh;
  object-fit: contain;
  border-radius: var(--radius);
  animation: badge-pop .6s var(--ease-spring) .1s both;
}

.q-image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

/* ── Sticky CTA ──────────────────────────────────────────── */

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 28px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cream) 55%, transparent);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}
/* In-flow variant for screens with text inputs: a fixed button would be
   hidden behind the mobile virtual keyboard, so it scrolls with the form. */
.sticky-cta--inline {
  position: static;
  padding: 10px 0 32px;
  background: none;
}

/* The CTA rises in last, after the content cascade. */
.sticky-cta { animation: cta-in .5s var(--ease-spring) .32s both; }
@keyframes cta-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.screen.is-leaving .sticky-cta { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .sticky-cta { animation: none; }
}

.btn {
  pointer-events: auto;
  width: 100%;
  max-width: 376px;
  height: 58px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 55%, transparent);
  transition: transform .15s var(--ease-spring), opacity .2s, box-shadow .2s, background .2s;
}
.btn:hover { background: color-mix(in srgb, var(--brand) 82%, black); }
.btn:active { transform: scale(.97); }
.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Thank-you screen ────────────────────────────────────── */

.thanks {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 8vh;
}
.thanks h1 { margin-bottom: 12px; }
.thanks .subtitle { margin-bottom: 0; }

/* Large emoji icon (configurable) */
.thanks-icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 24px;
  animation: badge-pop .6s var(--ease-spring) .15s both;
}

/* Fallback badge (checkmark circle) for surveys without a custom emoji */
.thanks-badge {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--yellow-accent);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  animation: badge-pop .6s var(--ease-spring) .15s both;
}
.thanks-badge svg { width: 38px; height: 38px; }
.thanks-badge svg path {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: draw-check .45s ease-out .55s forwards;
}
@keyframes draw-check { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .thanks-badge svg path { stroke-dashoffset: 0; animation: none; }
  .thanks-icon { animation: none; }
}
@keyframes badge-pop {
  from { transform: scale(.3); opacity: 0; }
  60%  { transform: scale(1.08); }
  to   { transform: scale(1); opacity: 1; }
}
.thanks-note {
  margin-top: 34px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* "Visit our site" closing link — subtle, branded, with a nudging arrow */
.thanks-site {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 34px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .2s;
}
.thanks-site strong { color: var(--brand); font-weight: 700; }
.thanks-site svg {
  width: 17px; height: 17px;
  flex: 0 0 auto;
  color: var(--brand);
  transition: transform .2s var(--ease-spring);
}
.thanks-site:hover { color: var(--ink); }
.thanks-site:hover svg { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .thanks-site:hover svg { transform: none; }
}

/* WhatsApp CTA button */
.thanks-wa {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 16px 28px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 20px -8px rgba(37, 211, 102, .55);
  transition: transform .15s var(--ease-spring), background .2s;
}
.thanks-wa:hover { background: #1dac55; }
.thanks-wa:active { transform: scale(.97); }
.thanks-wa svg { width: 22px; height: 22px; flex: 0 0 auto; }

/* review links on the thank-you screen */
.review-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 30px;
}
.review-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s var(--ease-spring), border-color .2s;
}
.review-btn:active { transform: scale(.97); }
.review-btn:hover { border-color: var(--brand); }
.review-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }

/* staggered entrance for option lists — they rise vertically while
   their container slides in, giving a soft layered feel */
.options .option,
.options--grid .option-grid,
.options--pills .option-pill { animation: rise-in .45s var(--ease-spring) both; }
.options .option:nth-child(1),
.options--grid .option-grid:nth-child(1),
.options--pills .option-pill:nth-child(1) { animation-delay: .16s; }
.options .option:nth-child(2),
.options--grid .option-grid:nth-child(2),
.options--pills .option-pill:nth-child(2) { animation-delay: .22s; }
.options .option:nth-child(3),
.options--grid .option-grid:nth-child(3),
.options--pills .option-pill:nth-child(3) { animation-delay: .28s; }
.options .option:nth-child(4),
.options--grid .option-grid:nth-child(4),
.options--pills .option-pill:nth-child(4) { animation-delay: .34s; }
.options .option:nth-child(5),
.options--grid .option-grid:nth-child(5),
.options--pills .option-pill:nth-child(5) { animation-delay: .40s; }
.options .option:nth-child(n+6),
.options--grid .option-grid:nth-child(n+6),
.options--pills .option-pill:nth-child(n+6) { animation-delay: .46s; }
.screen.is-leaving .options .option,
.screen.is-leaving .options--grid .option-grid,
.screen.is-leaving .options--pills .option-pill { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .options .option,
  .options--grid .option-grid,
  .options--pills .option-pill { animation: none; }
}
