:root {
  color-scheme: dark;
  --background: #07101f;
  --background-deep: #040a14;
  --surface: #101d33;
  --surface-raised: #16243c;
  --surface-input: #142139;
  --border: rgba(149, 174, 216, 0.16);
  --border-strong: rgba(149, 174, 216, 0.28);
  --text: #f5f8ff;
  --muted: #95a5c1;
  --muted-dark: #667896;
  --blue: #4b8df8;
  --blue-light: #79aaff;
  --cyan: #19d4e8;
  --pink: #fd3b8b;
  --danger: #ff7b93;
  --font: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -15%, rgba(41, 104, 210, 0.2), transparent 38rem),
    linear-gradient(180deg, var(--background) 0%, var(--background-deep) 100%);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.intake-header {
  width: min(100% - 2rem, 1120px);
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32);
}

.brand strong {
  font-weight: 700;
}

.portal-link {
  min-height: 42px;
  padding: 0.65rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.portal-link:hover,
.portal-link:focus-visible {
  border-color: rgba(121, 170, 255, 0.65);
  background: rgba(75, 141, 248, 0.1);
  color: var(--text);
}

.progress-track {
  height: 4px;
  overflow: hidden;
  background: rgba(149, 174, 216, 0.09);
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--pink));
  box-shadow: 0 0 18px rgba(75, 141, 248, 0.65);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.intake-shell {
  width: min(100% - 1.25rem, 820px);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.intake-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 38%),
    var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  padding: clamp(1.35rem, 4vw, 3rem);
}

.intake-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 8%;
  width: 48%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(121, 170, 255, 0.55), transparent);
}

.step-toolbar {
  min-height: 44px;
  margin-bottom: clamp(1.75rem, 5vw, 2.75rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.step-toolbar:has(.back-button:not([hidden])) {
  justify-content: space-between;
}

.back-button,
.step-badge {
  min-height: 42px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.step-badge {
  padding: 0.7rem 1rem;
  border-color: rgba(75, 141, 248, 0.35);
  background: rgba(75, 141, 248, 0.08);
  color: var(--blue-light);
}

.back-button {
  padding: 0.65rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: none;
}

.back-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.back-button:hover,
.back-button:focus-visible {
  border-color: rgba(121, 170, 255, 0.55);
  color: var(--text);
}

.step-content {
  animation: step-in 320ms ease both;
}

.step-content.is-leaving {
  animation: step-out 150ms ease both;
}

.eyebrow,
.success-label {
  margin: 0 0 0.8rem;
  color: var(--blue-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2rem, 7.4vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h1 .accent {
  background: linear-gradient(120deg, var(--cyan), var(--blue-light), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step-intro {
  margin: 1rem 0 clamp(1.5rem, 5vw, 2.25rem);
  color: var(--muted);
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
}

.option-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  border: 0;
}

.option-card {
  position: relative;
  min-height: 86px;
  padding: 0.85rem 3rem 0.85rem 0.85rem;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-raised);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.option-card:hover {
  border-color: rgba(121, 170, 255, 0.38);
  transform: translateY(-1px);
}

.option-card:has(input:focus-visible) {
  outline: 3px solid rgba(121, 170, 255, 0.38);
  outline-offset: 3px;
}

.option-card:has(input:checked) {
  border-color: var(--blue-light);
  background: linear-gradient(90deg, rgba(75, 141, 248, 0.16), rgba(22, 36, 60, 0.98));
  box-shadow:
    0 0 0 3px rgba(75, 141, 248, 0.13),
    0 12px 32px rgba(4, 10, 20, 0.28);
}

.option-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.option-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(121, 170, 255, 0.24);
  border-radius: 14px;
  background: rgba(75, 141, 248, 0.1);
  color: var(--blue-light);
}

.option-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.option-copy {
  min-width: 0;
}

.option-title,
.option-helper {
  display: block;
}

.option-title {
  color: var(--text);
  font-size: clamp(0.98rem, 3vw, 1.08rem);
  font-weight: 600;
  line-height: 1.3;
}

.option-helper {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: clamp(0.78rem, 2.4vw, 0.9rem);
  line-height: 1.4;
}

.option-arrow {
  position: absolute;
  top: 50%;
  right: 1.1rem;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--muted-dark);
  border-right: 2px solid var(--muted-dark);
  transform: translateY(-50%) rotate(45deg);
}

.option-card:has(input:checked) .option-arrow {
  border-color: var(--blue-light);
}

.field-grid {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.optional {
  color: var(--muted-dark);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: var(--surface-input);
  color: var(--text);
  padding: 0.95rem 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field input {
  min-height: 54px;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-dark);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue-light);
  background: #172740;
  box-shadow: 0 0 0 3px rgba(75, 141, 248, 0.13);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.76rem;
}

.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 123, 147, 0.35);
  border-radius: 12px;
  background: rgba(255, 123, 147, 0.08);
  color: #ffc2ce;
  font-size: 0.82rem;
}

.form-error:empty {
  display: none;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  margin-top: 1.4rem;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(120deg, #2576ec, #5f9bff 62%, #4fd6e8);
  box-shadow: 0 14px 34px rgba(37, 118, 236, 0.25);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(37, 118, 236, 0.34);
}

.primary-button:disabled {
  cursor: wait;
  filter: saturate(0.6);
  opacity: 0.75;
}

.consent-note {
  margin: 1rem auto 0;
  max-width: 600px;
  color: var(--muted-dark);
  font-size: 0.75rem;
  text-align: center;
}

.trust-note {
  margin: 1.4rem 0 0;
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  color: var(--muted-dark);
  font-size: 0.74rem;
  font-weight: 500;
  text-align: center;
}

.success-state {
  padding-block: clamp(3rem, 10vw, 5rem);
  text-align: center;
}

.success-state[hidden],
.intake-card[hidden] {
  display: none;
}

.success-mark {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(25, 212, 232, 0.35);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(25, 212, 232, 0.16), rgba(75, 141, 248, 0.14));
  color: var(--cyan);
  box-shadow: 0 0 40px rgba(25, 212, 232, 0.12);
}

.success-mark svg {
  width: 35px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.success-state h1 {
  margin-inline: auto;
}

.success-state > p:not(.success-label) {
  max-width: 550px;
  margin: 1rem auto 0;
  color: var(--muted);
}

.success-state .primary-button {
  max-width: 360px;
  margin-inline: auto;
}

.text-link {
  margin-top: 1.1rem;
  display: inline-block;
  color: var(--muted);
  font-size: 0.85rem;
  text-underline-offset: 0.25em;
}

.noscript-message {
  width: min(100% - 2rem, 720px);
  margin: 1rem auto;
  color: var(--danger);
  text-align: center;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}

@keyframes step-out {
  to {
    opacity: 0;
    transform: translateX(-10px);
  }
}

@media (min-width: 680px) {
  .intake-shell {
    padding-top: 3.25rem;
  }

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

  .field-wide {
    grid-column: 1 / -1;
  }

  .option-card {
    min-height: 94px;
    padding-left: 1rem;
  }
}

@media (max-width: 440px) {
  .intake-header {
    min-height: 76px;
  }

  .portal-link {
    padding-inline: 0.8rem;
    font-size: 0.7rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .intake-shell {
    width: min(100% - 0.8rem, 820px);
    padding-top: 1.25rem;
  }

  .intake-card {
    border-radius: 23px;
  }

  .step-toolbar {
    margin-bottom: 1.6rem;
  }

  .back-button,
  .step-badge {
    min-height: 38px;
    font-size: 0.68rem;
  }

  .option-card {
    grid-template-columns: 46px 1fr;
    gap: 0.75rem;
    min-height: 80px;
  }

  .option-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .trust-note {
    gap: 0.4rem;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
