/* ERIVAA research survey — premium, warm, mobile-first.
   Separate design system from the dark landing page: this is meant to read
   like a consumer brand questionnaire, not a SaaS form. */

:root {
  --cream: #faf6f0;
  --cream-deep: #f3ece2;
  --card: #ffffff;
  --blush: #f4dfd9;
  --blush-deep: #e8c3ba;
  --rose: #b3665b;
  --espresso: #3a2a22;
  --espresso-dim: #7a685d;
  --border: #e7ddd0;
  --border-soft: #efe7db;
  --ok: #4c7a5a;
  --danger: #a4453a;
  --shadow: 0 2px 10px rgba(58, 42, 34, 0.06), 0 1px 2px rgba(58, 42, 34, 0.04);
  --shadow-lift: 0 10px 30px rgba(58, 42, 34, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; }

a { color: var(--rose); }

.survey-shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 max(24px, env(safe-area-inset-bottom));
}

/* ---------- header / brand / progress ---------- */

.survey-header {
  padding: 22px 20px 16px;
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.brand-logo { display: block; width: 175px; height: auto; }

.brand-tag {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
  margin-top: 2px;
}

.step-indicator {
  text-align: right;
  font-size: 12.5px;
  color: var(--espresso-dim);
  white-space: nowrap;
}

.step-indicator .pct { display: block; font-size: 11px; color: var(--espresso-dim); margin-top: 1px; }

.progress-track {
  height: 6px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blush-deep), var(--rose));
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ---------- body / cards ---------- */

.survey-body {
  flex: 1;
  padding: 8px 20px 12px;
}

.page {
  animation: page-in 0.28s ease both;
}

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

.question-block { margin-bottom: 30px; }
.question-block:last-child { margin-bottom: 8px; }

.q-headline {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--espresso);
}

.q-support {
  font-size: 14.5px;
  color: var(--espresso-dim);
  margin: 0 0 16px;
  line-height: 1.5;
}

.q-label {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--espresso);
}

.q-label .req { color: var(--rose); margin-left: 3px; }

.q-helper {
  font-size: 13px;
  color: var(--espresso-dim);
  margin: 0 0 12px;
}

.step-intro {
  margin-bottom: 22px;
}

/* card grid for choice options */

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-grid.cols-1 { grid-template-columns: 1fr; }

@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 56px;
}

.choice-card:hover { border-color: var(--blush-deep); }

.choice-card.selected {
  border-color: var(--rose);
  background: var(--blush);
  box-shadow: var(--shadow);
}

.choice-card .c-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose);
}

.choice-card .c-icon svg { width: 24px; height: 24px; }

.choice-card .c-label {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--espresso);
  flex: 1;
}

.choice-card .c-mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  position: relative;
}

.choice-card.multi .c-mark { border-radius: 6px; }

.choice-card.selected .c-mark {
  border-color: var(--rose);
  background: var(--rose);
}

.choice-card.selected .c-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  background: var(--card);
  border-radius: 50%;
}

.choice-card.multi.selected .c-mark::after {
  border-radius: 1px;
  width: 5px;
  height: 9px;
  background: none;
  border-right: 2px solid var(--card);
  border-bottom: 2px solid var(--card);
  transform: rotate(45deg) translate(-1px, -2px);
}

/* list-style single-choice (radio rows), used for longer text options */

.choice-list { display: flex; flex-direction: column; gap: 8px; }

.choice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  cursor: pointer;
  min-height: 48px;
}

.choice-row.selected { border-color: var(--rose); background: var(--blush); }

.choice-row .c-mark {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  position: relative;
}

.choice-row.selected .c-mark { border-color: var(--rose); background: var(--rose); }
.choice-row.selected .c-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 7px;
  height: 7px;
  background: var(--card);
  border-radius: 50%;
}

.choice-row .c-label { font-size: 14.5px; color: var(--espresso); }

.other-specify {
  margin-top: 8px;
}

/* text inputs */

textarea, input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--espresso);
  background: var(--card);
  resize: vertical;
}

textarea:focus, input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(179, 102, 91, 0.12);
}

textarea { min-height: 96px; line-height: 1.5; }

.char-count {
  text-align: right;
  font-size: 11.5px;
  color: var(--espresso-dim);
  margin-top: 4px;
}

/* product reveal */

.reveal-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 18px 0 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.reveal-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
}

.reveal-step .r-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blush);
  color: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reveal-step .r-icon svg { width: 20px; height: 20px; }

.reveal-step .r-text { font-size: 14px; font-weight: 600; color: var(--espresso); letter-spacing: 0.01em; }

.reveal-arrow {
  text-align: center;
  color: var(--blush-deep);
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

/* A/B product comparison */

.ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

@media (max-width: 480px) {
  .ab-grid { grid-template-columns: 1fr; }
}

.ab-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ab-card.selected { border-color: var(--rose); box-shadow: var(--shadow-lift); }

.ab-card .ab-media {
  background: var(--cream-deep);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.ab-card.erivaa .ab-media { background: var(--blush); }

.ab-card .ab-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ab-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.ab-title { font-weight: 700; font-size: 14.5px; color: var(--espresso); }

.ab-sub { font-size: 12.5px; color: var(--espresso-dim); line-height: 1.4; }

.ab-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.ab-features li {
  font-size: 12.5px;
  color: var(--espresso-dim);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.ab-features li .f-icon { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; color: var(--rose); }
.ab-features li .f-icon svg { width: 14px; height: 14px; }

.ab-select {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--espresso);
}

.ab-card.selected .ab-select { border-color: var(--rose); background: var(--blush); font-weight: 600; }

.ab-select .c-mark {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--card); position: relative; flex: 0 0 auto;
}
.ab-card.selected .ab-select .c-mark { border-color: var(--rose); background: var(--rose); }
.ab-card.selected .ab-select .c-mark::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; background: var(--card); border-radius: 50%;
}

/* price sensitivity */

.price-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 20px;
  margin-bottom: 16px;
}

.price-question { font-size: 14.5px; font-weight: 600; color: var(--espresso); margin: 0 0 14px; line-height: 1.4; }

.price-value {
  text-align: center;
  font-family: var(--serif);
  font-size: 30px;
  color: var(--rose);
  margin: 6px 0 14px;
  min-height: 38px;
}

.price-value.untouched { color: var(--espresso-dim); font-family: var(--sans); font-size: 14px; font-style: italic; }

.price-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border-soft);
  outline: none;
  margin: 6px 0;
}

.price-slider.untouched { opacity: 0.55; }

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rose);
  border: 3px solid var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  margin-top: -1px;
}

.price-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rose);
  border: 3px solid var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.price-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--espresso-dim);
}

.price-order-msg {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--blush);
  color: var(--rose);
  font-size: 13px;
  line-height: 1.4;
}

/* prototype / contact */

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-top: 6px;
  cursor: pointer;
}

.consent-row input[type="checkbox"] { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--rose); flex: 0 0 auto; }
.consent-row span { font-size: 13px; color: var(--espresso-dim); line-height: 1.45; }

.contact-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--espresso); margin-bottom: 6px; }

.privacy-note {
  font-size: 12px;
  color: var(--espresso-dim);
  margin-top: 14px;
  line-height: 1.5;
}

/* thank you */

.thanks-wrap {
  text-align: center;
  padding: 60px 8px 20px;
}

.thanks-emoji { font-size: 40px; margin-bottom: 14px; }

.thanks-headline { font-family: var(--serif); font-size: 28px; margin: 0 0 12px; }

.thanks-copy { color: var(--espresso-dim); font-size: 15px; line-height: 1.6; max-width: 440px; margin: 0 auto 8px; }

/* footer nav */

.survey-footer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(250,246,240,0) 0%, var(--cream) 32%);
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 15px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 50px;
  transition: filter 0.15s ease, opacity 0.15s ease, transform 0.05s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--espresso);
  color: var(--cream);
  flex: 1;
}

.btn-primary:hover { filter: brightness(1.12); }

.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--espresso-dim);
  border: 1.5px solid var(--border);
  flex: 0 0 auto;
  padding: 15px 18px;
}

.btn-secondary:hover { border-color: var(--blush-deep); color: var(--espresso); }

.error-banner {
  background: #fbeceb;
  color: var(--danger);
  border: 1px solid #f0cfcb;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  margin: 0 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* #survey-body is focused programmatically on each page change purely to
   move screen-reader focus to the new content -- it should never show a
   visible ring itself. */
#survey-body:focus { outline: none; }
