:root {
  /* Match main Nutralis waitlist site (App.tsx / index.html) */
  --blue: #639DCF;
  --blue-deep: #4F7DA5;
  --blue-soft: #EFF6FB;
  --green: #A3E8B0;
  --green-mid: #82C48F;
  --peach: #FFCF96;
  --peach-deep: #E6B87A;
  --ink: #0f172a; /* slate-900 */
  --muted: #64748b; /* slate-500 */
  --line: #e2e8f0;
  --error: #D9534F;
  --card: #FFFFFF;
  --radius: 28px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  /* Same hero gradient language as main site */
  background: linear-gradient(135deg, rgba(99, 157, 207, 0.95) 0%, rgba(163, 232, 176, 0.95) 100%);
  background-attachment: fixed;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px calc(28px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M48 0H0V48' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E");
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin-top: clamp(8px, 3vh, 36px);
}

/* Header / brand */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #fff;
  text-align: center;
}

.brand-mark {
  display: inline-flex;
  text-decoration: none;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
  background: rgba(255, 255, 255, 0.98);
  padding: 10px 16px;
  border-radius: 14px;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.95;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

.brand-title {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
}

.brand-sub {
  font-size: 0.82rem;
  opacity: 0.92;
  font-weight: 500;
}

/* Honeypot — off-screen, not display:none (some bots skip display:none) */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Progress */
.progress-wrap {
  margin-bottom: 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  /* Same brand linear as site divider / FAQ / hero: blue → green */
  background: linear-gradient(90deg, #639DCF 0%, #A3E8B0 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(163, 232, 176, 0.45);
}

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px 20px;
  box-shadow: var(--shadow);
  min-height: min(420px, 70dvh);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.step {
  display: none;
  flex-direction: column;
  flex: 1;
  gap: 0;
  min-height: 0;
}

.step.active {
  display: flex;
  animation: stepIn 0.35s ease;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.tag {
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 1.1px;
}

.step h2 {
  margin: 0;
  font-size: clamp(1.15rem, 3.6vw, 1.4rem);
  line-height: 1.35;
  font-weight: 700;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.req-mark {
  color: var(--error);
  margin-left: 3px;
}

.why {
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.why b {
  color: var(--blue-deep);
}

.hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.hint-tight {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Inputs */
input[type='text'],
input[type='email'],
input[type='tel'],
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(99, 157, 207, 0.2);
}

input.invalid,
textarea.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.15);
}

.error-text {
  color: var(--error);
  font-size: 0.8125rem;
  display: none;
  margin-top: -6px;
}

.error-text.show {
  display: block;
}

/* Chips */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  appearance: none;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 11px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.chip:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.chip.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 157, 207, 0.35);
}

.chip.selected:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

/* Stars */
.stars-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.stars {
  display: flex;
  gap: 6px;
  user-select: none;
}

.stars button {
  appearance: none;
  border: none;
  background: transparent;
  padding: 4px;
  font-size: clamp(2rem, 8vw, 2.35rem);
  line-height: 1;
  color: #E1E7EC;
  cursor: pointer;
  transition: color 0.12s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.stars button.filled,
.stars button.preview {
  color: #82C48F;
}

.stars button:hover {
  transform: scale(1.08);
}

.stars button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.star-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-deep);
  min-height: 1.25em;
}

/* NPS grid */
.nps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nps-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (min-width: 520px) {
  .nps-grid {
    grid-template-columns: repeat(11, 1fr);
  }
}

.nps-btn {
  appearance: none;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 12px;
  aspect-ratio: 1;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nps-btn:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.nps-btn.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 157, 207, 0.35);
}

.nps-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  gap: 8px;
}

.nps-labels span:last-child {
  text-align: right;
}

/* Contact follow-up block */
.followup-contact {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  background: #F8FBFD;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.followup-contact.show {
  display: flex;
}

.followup-contact label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* Nav */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 4px;
}

.nav {
  appearance: none;
  border: none;
  padding: 13px 22px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nav.next {
  /* Match main site “Join Waitlist” CTA — peach */
  background: var(--peach);
  color: var(--ink);
  margin-left: auto;
  box-shadow: 0 6px 18px rgba(255, 207, 150, 0.45);
}

.nav.next:hover:not(:disabled) {
  background: var(--peach-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(230, 184, 122, 0.5);
}

.nav.next:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.nav.back {
  background: transparent;
  color: var(--muted);
  padding-left: 4px;
  padding-right: 4px;
}

.nav.back:hover {
  color: var(--ink);
}

.nav.back[hidden] {
  visibility: hidden;
  pointer-events: none;
}

.nav.submit {
  background: var(--peach);
  color: var(--ink);
}

/* Thank you */
.thankyou {
  text-align: center;
}

.thankyou .step-body {
  align-items: center;
  justify-content: center;
  padding: 12px 0 8px;
}

.thank-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-soft), #E8F8EC);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 4px;
  animation: pop 0.55s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.thankyou h2 {
  font-size: clamp(1.3rem, 4vw, 1.65rem);
}

.tagline {
  color: var(--blue);
  font-weight: 700;
  margin: 4px 0 0;
  font-size: 1rem;
}

.thank-cta {
  display: inline-flex;
  margin-top: 18px;
  padding: 12px 22px;
  background: var(--peach);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(255, 207, 150, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thank-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(230, 184, 122, 0.5);
}

.site-footer {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.footer-social a {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.92;
}

.footer-social a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 1;
}

.footer-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.5;
  max-width: 36rem;
  margin-inline: auto;
}

.footer-note a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 100;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: calc(100% - 32px);
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Larger screens */
@media (min-width: 640px) {
  body {
    padding: 32px 24px 40px;
    align-items: center;
  }

  .card {
    padding: 36px 36px 24px;
    min-height: 440px;
  }

  .brand-logo {
    height: 48px;
  }
}

/* Very small phones */
@media (max-width: 360px) {
  .chip {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .nav {
    padding: 12px 16px;
  }
}
