:root {
  --brand-yellow: #ffd400;
  --brand-navy: #0b2a5f;
  --brand-navy-dark: #07193a;
  --brand-light: #bfe8ff;
  --cream: #fff8e6;
  --bg: var(--brand-yellow);
  --bg-soft: #fffaf2;
  --text: #0b1220;
  --muted: #55667a;
  --border: rgba(11, 18, 32, 0.08);
  --accent: var(--brand-yellow);
  --accent-dark: #e6b800;
  --success: #0f766e;
  --shadow: 0 20px 60px rgba(11, 18, 32, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(91, 94, 247, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-shell {
  min-height: 100vh;
}

/* Reveal animation for initial load */
.reveal {
  opacity: 0;
  transform: translateY(8px) scale(0.998);
  transition: opacity 420ms cubic-bezier(.2,.9,.2,1), transform 520ms cubic-bezier(.2,.9,.2,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  gap: 20px;
  align-items: center;
  padding: 28px 0 34px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.hero h1,
.form-card h2,
.success-card h2 {
  margin: 12px 0 0;
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(2.7rem, 9vw, 5.6rem);
  max-width: 11ch;
}

.hero__subtitle {
  margin: 18px 0 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.hero__actions {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.hero__hint,
.microcopy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.step > .microcopy {
  margin-top: 14px;
}

.hero__panel {
  display: grid;
  gap: 14px;
}

.metric-card,
.form-card,
.success-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 20px;
}

.metric-card--accent {
  background: linear-gradient(180deg, rgba(255, 212, 0, 0.06), rgba(255, 236, 123, 0.03));
}

.metric-card__label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.form-section {
  padding: 12px 0 24px;
  scroll-margin-top: 16px;
}

.form-card {
  padding: 20px;
}

.form-card__head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.form-card h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.progress-meta {
  font-size: 0.92rem;
  color: var(--muted);
  white-space: nowrap;
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.07);
  overflow: hidden;
  margin-bottom: 20px;
}

.progress__bar {
  width: 14.2857%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width 0.35s ease;
}

.step {
  display: none;
  animation: fadeSlide 0.32s ease both;
}

.step.is-active {
  display: block;
}

.field {
  display: grid;
  gap: 14px;
  margin: 0;
}

.field__label {
  font-size: 1rem;
  font-weight: 700;
}

.field__label em {
  color: var(--accent);
  font-style: normal;
}

input,
select,
textarea {
  width: 100%;
  min-height: 54px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  touch-action: manipulation;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(11, 42, 95, 0.45);
  box-shadow: 0 0 0 6px rgba(11, 42, 95, 0.08);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.choice:hover,
.btn:hover {
  transform: translateY(-1px);
}

.choice input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.choice span {
  font-weight: 500;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: rgba(255, 212, 0, 0.06);
}

.form-error {
  min-height: 24px;
  margin-top: 18px;
  color: #b91c1c;
  font-size: 0.94rem;
  font-weight: 600;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
  padding-top: 8px;
}

/* When on final step (email) make back button match submit width on mobile */
.form-actions.is-final {
  grid-template-columns: 1fr;
}

.form-actions.is-final .btn--ghost {
  display: block;
  width: 100%;
}

.form-actions.is-final .btn--submit {
  display: block;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--accent);
  color: #0b1220;
  box-shadow: 0 8px 18px rgba(255, 212, 0, 0.18);
}

.btn--primary:hover {
  background: var(--accent-dark);
}

.btn--ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn--submit {
  display: none;
  position: relative;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.is-loading .spinner {
  display: inline-block;
}

.is-loading .btn__text {
  opacity: 0.85;
}

.success-state {
  padding: 12px 0 0;
}

.success-card {
  padding: 28px 20px;
  text-align: center;
}

.success-card h2 {
  font-size: clamp(2rem, 6vw, 3.2rem);
}

.success-card p {
  margin: 14px auto 24px;
  max-width: 36ch;
  color: var(--muted);
  line-height: 1.6;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 768px) {
  .app {
    width: min(1180px, calc(100% - 48px));
    padding: 40px 0 72px;
  }

  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    padding: 28px 0 44px;
  }

  .hero__actions {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .hero__hint {
    max-width: 28ch;
  }

  .hero__panel {
    grid-template-columns: 1fr;
    align-self: end;
  }

  .form-card {
    padding: 28px;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions {
    grid-template-columns: auto auto 1fr;
    justify-content: end;
  }

  .btn--submit {
    justify-self: end;
  }
}

@media (max-width: 767px) {
  .app {
    width: min(100% - 20px, 100%);
    padding-top: 12px;
  }

  .hero h1 {
    max-width: 13ch;
  }

  .form-card__head {
    align-items: start;
    flex-direction: column;
  }

  .form-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.98) 18%, rgba(248, 250, 252, 1) 100%);
    margin: 18px -20px -20px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    z-index: 4;
  }

  .form-actions .btn {
    min-height: 52px;
  }

  .btn--submit {
    grid-column: 1 / -1;
  }

  .choice {
    padding: 14px;
  }
}
