:root {
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --ink: #0F172A;
  --ink-soft: #475569;
  --ink-muted: #64748B;
  --line: #E2E8F0;
  --line-soft: #EEF2F6;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #EFF6FF;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --warn: #D97706;
  --warn-soft: #FEF3C7;
  --error: #DC2626;
  --error-soft: #FEE2E2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.header {
  text-align: center;
  margin-bottom: 20px;
}
.brand {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.subtitle {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.progress {
  margin-bottom: 16px;
}
.progress-bar {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.progress-text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: right;
}

form {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  border: 1px solid var(--line);
}

.step { display: none; }
.step.active { display: block; }

h2 {
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
h3.section-sub {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 28px 0 10px;
  font-weight: 600;
}
.step-lede {
  color: var(--ink-soft);
  margin: 0 0 24px;
  font-size: 15px;
}

label {
  display: block;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.invalid,
select.invalid {
  border-color: var(--error);
}
input.invalid:focus,
select.invalid:focus {
  box-shadow: 0 0 0 3px var(--error-soft);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.row label { margin-bottom: 14px; }
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; gap: 0; }
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px 16px;
  margin: 0 0 18px;
}
legend {
  padding: 0 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}
.hint {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 13px;
}

.check-inline,
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 16px 6px 0;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.check-inline input,
.radio-inline input {
  margin: 0;
}

.checkbox-inline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.checkbox-inline input {
  margin-top: 3px;
  flex-shrink: 0;
}
.checkbox-inline.declaration {
  background: var(--line-soft);
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.field-hint {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 400;
}

.info-box {
  background: var(--accent-soft);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 14px 0;
}
.info-box strong { color: var(--ink); }

.checklist-box {
  background: var(--warn-soft);
  border: 1px solid #FCD34D;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 22px;
}
.checklist-title {
  margin: 0 0 10px;
  font-weight: 600;
  color: #78350F;
  font-size: 14px;
}
.checklist {
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--ink);
  font-size: 14px;
}
.checklist li { margin-bottom: 5px; }
.checklist-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.btn-primary,
.btn-secondary {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-width: 120px;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.btn-primary:disabled {
  background: var(--ink-muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover {
  background: var(--line-soft);
  border-color: var(--ink-muted);
}

.step.success {
  text-align: center;
  padding: 20px 0;
}
.success-mark {
  color: var(--success);
  margin-bottom: 12px;
}
.step.success h2 { color: var(--ink); margin-bottom: 8px; }
.step.success h3 {
  margin-top: 28px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 600;
}
.step.success .lede { color: var(--ink-soft); font-size: 15px; }
.next-steps {
  max-width: 460px;
  margin: 0 auto 24px;
  padding-left: 24px;
  text-align: left;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
.next-steps li { margin-bottom: 8px; }
.footer-note {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 20px;
}

.step.error {
  text-align: center;
  padding: 32px 20px;
}
.step.error h2 { color: var(--error); }
.step.error .lede { color: var(--ink-soft); margin-bottom: 24px; }

/* submitting state */
#submit-btn.loading {
  background: var(--ink-muted);
  pointer-events: none;
  position: relative;
}
#submit-btn.loading::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }
