* { box-sizing: border-box; }


button, input { font: inherit; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.form-card {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 52px);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(32, 31, 57, .12);
}

.form-card__intro { margin-bottom: 38px; }
.form-card__intro p, .success p { margin: 0; color: var(--muted); line-height: 1.65; }

.form-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-step[hidden] { display: none; }
.form-step.is-active { animation: step-in .28s ease both; }
.form-step legend { padding: 0; font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 800; letter-spacing: -.040em; }
.step-hint { margin: 8px 0 22px; color: var(--muted); }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice-grid--compact { grid-template-columns: repeat(3, 1fr); }
.choice-card { position: relative; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span {
  min-height: 70px;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.choice-card:hover span { transform: translateY(-2px); border-color: #c8c3ff; }
.choice-card input:checked + span { color: var(--accent-dark); border-color: var(--accent-dark); background: #f1efff; box-shadow: 0 7px 18px rgba(109, 93, 252, .13); }
.choice-card input:focus-visible + span { outline: 3px solid rgba(109, 93, 252, .28); outline-offset: 3px; }

.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: grid; gap: 8px; color: #444454; font-size: .9rem; font-weight: 700; }
.field--wide { grid-column: 1 / -1; }
.field input {
  width: 100%;
  padding: 15px 16px;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(109, 93, 252, .12); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; color: #444454; font-weight: 650; }
.toggle input { position: absolute; opacity: 0; }
.toggle__control { width: 46px; height: 26px; flex: 0 0 auto; padding: 3px; border-radius: 99px; background: #d8d8e1; transition: background .18s; }
.toggle__control::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .18s; }
.toggle input:checked + .toggle__control { background: var(--accent); }
.toggle input:checked + .toggle__control::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle__control { outline: 3px solid rgba(109, 93, 252, .28); outline-offset: 3px; }

.form-message { min-height: 22px; margin: 18px 0 0; color: var(--danger); font-size: .9rem; font-weight: 650; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }
.button { min-height: 49px; padding: 0 24px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 750; transition: transform .18s, box-shadow .18s, background .18s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(109, 93, 252, .3); outline-offset: 3px; }
.button--primary { color: #000000; background: var(--accent); box-shadow: 0 10px 24px rgba(109, 93, 252, .25); }
.button--primary:hover { background: var(--accent); }
.button--secondary { color: #4d4d5d; background: #ebebf1; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }

.progress { margin-top: 34px; }
.progress__meta { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.progress__track { height: 7px; overflow: hidden; border-radius: 99px; background: #e9e9ef; }
.progress__track span { display: block; width: 25%; height: 100%; border-radius: inherit; background: var(--accent-dark); transition: width .3s ease; }

.success { padding: 18px 0 6px; text-align: center; animation: step-in .35s ease both; }
.success__icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 20px; color: #fff; border-radius: 50%; background: #32b47a; font-size: 1.8rem; font-weight: 800; }
.success h2 { margin: 0 0 10px; font-size: 2rem; }

@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 620px) {
  .page-shell { align-items: start; padding: 14px; }
  .form-card { padding: 26px 19px; border-radius: 18px; }
  .form-card__intro { margin-bottom: 30px; }
  .choice-grid, .choice-grid--compact, .field-grid { grid-template-columns: 1fr; }
  .choice-card span { min-height: 58px; }
  .field--wide { grid-column: auto; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .form-actions .button:only-child { grid-column: 2; }
}

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