/* =====================================================================
   BRAND KIT — change these 6 values to rebrand the whole page.
   Drop your logo at assets/logo.svg (or .png and update the <img> src).
   ===================================================================== */
:root {
  --brand:        #6f4e37;   /* primary — buttons, selected states, accents   */
  --brand-dark:   #4a3325;   /* darker shade for text/pressed states          */
  --accent:       #c8862b;   /* highlight — stars, small pops                 */
  --bg:           #f5efe6;   /* page background (warm cream)                  */
  --card:         #fffdf9;   /* card surface                                  */
  --ink:          #2c2017;   /* body text                                     */

  --font-display: "Fraunces", Georgia, serif;   /* headings */
  --font-body:    "Inter", system-ui, sans-serif; /* everything else */

  /* derived — usually no need to touch */
  --muted: color-mix(in srgb, var(--ink) 55%, transparent);
  --line:  color-mix(in srgb, var(--brand) 18%, transparent);
  --brand-soft: color-mix(in srgb, var(--brand) 10%, transparent);
  --radius: 16px;
  --shadow: 0 6px 30px color-mix(in srgb, var(--brand-dark) 14%, transparent);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- card ---------- */
.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 22px 26px;
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- hero ---------- */
.hero { text-align: center; margin-bottom: 22px; }
.logo { height: auto; width: auto; max-width: min(240px, 72%); max-height: 72px; margin: 0 auto 16px; display: block; object-fit: contain; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  line-height: 1.1;
  margin: 0 0 8px;
  color: var(--brand-dark);
}
.hero__sub { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---------- question block ---------- */
.q { margin: 0 0 22px; }
.q__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  margin: 0 0 4px;
  color: var(--brand-dark);
}
.q__hint { margin: 0 0 10px; color: var(--muted); font-size: .88rem; }
.q__label .opt {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.chip {
  font: inherit;
  font-weight: 500;
  padding: 10px 15px;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- stars ---------- */
.stars { display: flex; gap: 6px; margin-top: 8px; }
.star {
  font-size: 2.4rem;
  line-height: 1;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  color: var(--line);
  transition: transform .1s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.star:active { transform: scale(1.2); }
.star.is-on { color: var(--accent); }
.scale-hint {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: .76rem;
  color: var(--muted);
}

/* ---------- segmented ---------- */
.segmented { display: flex; gap: 9px; margin-top: 10px; }
.seg {
  flex: 1;
  font: inherit;
  font-weight: 600;
  padding: 13px 6px;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.seg:active { transform: scale(.96); }
.seg[aria-checked="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- text inputs ---------- */
textarea, input[type="email"] {
  width: 100%;
  font: inherit;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------- errors ---------- */
.error { display: none; margin: 7px 0 0; color: #b3261e; font-size: .82rem; }
.q.invalid .error { display: block; }
.form-error { text-align: center; color: #b3261e; font-size: .9rem; margin: 12px 0 0; }

/* ---------- submit ---------- */
.submit {
  position: relative;
  width: 100%;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 14px;
  padding: 16px;
  min-height: 54px;
  margin-top: 8px;
  cursor: pointer;
  transition: transform .12s, background .15s, opacity .15s;
}
.submit:hover { background: var(--brand-dark); }
.submit:active { transform: scale(.98); }
.submit:disabled { opacity: .7; cursor: default; }
.submit__spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  margin: -9px 0 0 -9px;
  animation: spin .7s linear infinite;
}
.submit.is-loading .submit__label { visibility: hidden; }
.submit.is-loading .submit__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- thank-you ---------- */
.thanks { text-align: center; padding: 36px 8px; animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.thanks__mark {
  font-size: 4rem;
  animation: pop .6s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes pop { from { transform: scale(0); } }
.thanks__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  margin: 10px 0 8px;
  color: var(--brand-dark);
}
.thanks__sub { margin: 0; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
