:root {
  color-scheme: light;
  --ink: #102d3d;
  --ink-soft: #536c79;
  --brand: #00b8e8;
  --brand-dark: #007fae;
  --brand-pale: #e8f9fd;
  --surface: #ffffff;
  --canvas: #f4fafc;
  --line: #d7e6eb;
  --line-strong: #b7d2db;
  --danger: #b42318;
  --danger-bg: #fff2f0;
  --success: #087a55;
  --shadow: 0 22px 70px rgba(25, 74, 94, .12);
  font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; padding: 32px; color: var(--ink); background: linear-gradient(180deg, #eefafd 0, var(--canvas) 280px); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(0, 184, 232, .25); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 20; left: 16px; top: -80px; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: white; text-decoration: none; transition: top .2s ease; }
.skip-link:focus { top: 16px; }

.page-shell { width: min(100%, 980px); min-height: calc(100vh - 64px); margin: 0 auto; }
.brand-logo { display: block; width: 152px; height: auto; }
.eyebrow { display: block; color: var(--brand-dark); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.form-panel { min-width: 0; min-height: calc(100vh - 64px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(0, 127, 174, .12); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.page-brand { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 40px; border-bottom: 1px solid var(--line); background: #fff; }
.page-brand > span { color: #718a96; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.form-wrap { width: min(760px, calc(100% - 64px)); margin: auto; padding: 50px 0 46px; }
.form-header { margin-bottom: 28px; }
.step-count { margin: 0 0 6px; color: var(--brand-dark); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.form-header h2, .success h2 { margin: 0; font-size: clamp(31px, 4vw, 45px); line-height: 1.1; letter-spacing: -.035em; }
.form-header > p:last-child { margin: 10px 0 0; color: var(--ink-soft); }

.progress { display: grid; grid-template-columns: auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto; align-items: start; margin: 0 0 40px; }
.progress > i { height: 1px; margin-top: 17px; background: var(--line); }
.progress-item { display: grid; justify-items: center; gap: 6px; min-width: 66px; padding: 0; border: 0; background: transparent; color: #8ba0aa; }
.progress-item span { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 12px; font-weight: 800; transition: .2s ease; }
.progress-item small { font-size: 11px; font-weight: 700; }
.progress-item.is-active, .progress-item.is-complete { color: var(--brand-dark); }
.progress-item.is-active span { border-color: var(--brand); background: var(--brand); color: #043448; box-shadow: 0 0 0 5px var(--brand-pale); }
.progress-item.is-complete span { border-color: #8bdcf0; background: var(--brand-pale); }

.alert { margin: -18px 0 26px; padding: 13px 15px; border: 1px solid #f0b7b1; border-radius: 11px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .08); }
.field-error, .email-status.is-error { color: var(--danger) !important; }
.email-status.is-checking { color: #5d7480 !important; }
.email-status.is-available { color: #16794c !important; font-weight: 700; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-step { min-width: 0; margin: 0; padding: 0; border: 0; animation: step-in .28s ease both; }
.form-step legend { padding: 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.step-intro { margin: 6px 0 25px; color: var(--ink-soft); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { min-width: 0; display: grid; align-content: start; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field > span:first-child { min-height: 20px; color: #213d4c; font-size: 13px; font-weight: 750; }
.field b, .consent b { color: var(--brand-dark); }
.field em { float: right; color: #80959f; font-size: 10px; font-style: normal; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfe; color: var(--ink); padding: 12px 13px; outline: none; transition: border .18s ease, box-shadow .18s ease, background .18s ease; }
.field input, .field select { min-height: 48px; }
.field textarea { resize: vertical; min-height: 104px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: white; box-shadow: 0 0 0 4px rgba(0, 184, 232, .1); }
.field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid { border-color: #df8178; }
.field small { color: #81939b; font-size: 11px; }
.phone-control { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
.phone-control select, .phone-control input { border-radius: 0; }
.phone-control select { position: relative; z-index: 1; border-radius: 10px 0 0 10px; background: #f3f9fb; }
.phone-control input { margin-left: -1px; border-radius: 0 10px 10px 0; }
.field.has-error .phone-control select, .field.has-error .phone-control input { border-color: var(--danger); }
.admin-notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid #bce8f3; border-radius: 11px; background: var(--brand-pale); color: #315563; }
.admin-notice > span { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 50%; background: white; color: var(--brand-dark); font-size: 12px; }
.admin-notice p { margin: 0; }
.admin-notice strong, .admin-notice small { display: block; }
.admin-notice strong { font-size: 13px; }
.admin-notice small { margin-top: 3px; color: #52707d; font-size: 12px; line-height: 1.55; }

.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.review-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfe; }
.review-card:first-child { grid-column: 1 / -1; }
.review-card > span { display: block; margin-bottom: 6px; color: var(--brand-dark); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.review-card strong, .review-card small { display: block; overflow-wrap: anywhere; }
.review-card strong { font-size: 14px; }
.review-card small { margin-top: 3px; color: var(--ink-soft); font-size: 12px; }
.consent { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #395361; font-size: 13px; cursor: pointer; }
.consent input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand-dark); }
.secure-submit { display: flex; gap: 11px; align-items: flex-start; margin-top: 14px; padding: 14px 15px; border-radius: 11px; background: var(--brand-pale); color: #315563; }
.secure-submit > span { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; background: white; color: var(--success); font-size: 12px; font-weight: 900; }
.secure-submit p { margin: 0; }
.secure-submit strong, .secure-submit small { display: block; }
.secure-submit strong { font-size: 12px; }
.secure-submit small { margin-top: 2px; font-size: 11px; }

.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 10px; padding: 11px 21px; font-weight: 800; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .68; transform: none; }
.button-primary { margin-left: auto; border: 1px solid var(--brand); background: var(--brand); color: #063448; box-shadow: 0 8px 24px rgba(0, 184, 232, .2); }
.button-primary:hover { background: #09c4f3; box-shadow: 0 10px 28px rgba(0, 184, 232, .26); }
.button-secondary { border: 1px solid var(--line); background: white; color: #36515e; }
.spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(6, 52, 72, .25); border-top-color: #063448; border-radius: 50%; animation: spin .7s linear infinite; }
.button.is-loading .spinner { display: block; }
.button.is-loading .button-label { opacity: .7; }

.success { text-align: center; animation: step-in .4s ease both; }
.success-mark { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 50%; background: var(--brand-pale); border: 1px solid #a5e6f5; color: var(--success); font-size: 31px; font-weight: 900; box-shadow: 0 0 0 10px #f5fcfe; }
.success .eyebrow { margin-bottom: 9px; }
.success > p { max-width: 560px; margin: 14px auto; color: var(--ink-soft); }
.reference { max-width: 480px; margin: 28px auto 0; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfe; text-align: left; }
.reference span, .reference strong { display: block; }
.reference span { color: #78909b; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.reference strong { margin-top: 4px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.success-footnote { font-size: 12px; }
.form-footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px 32px; border-top: 1px solid var(--line); color: #879aa3; font-size: 11px; }

@keyframes step-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  body { padding: 20px; }
  .page-shell, .form-panel { min-height: calc(100vh - 40px); }
}

@media (max-width: 680px) {
  body { padding: 0; background: white; }
  .page-shell, .form-panel { min-height: 100vh; }
  .form-panel { border: 0; border-radius: 0; box-shadow: none; }
  .page-brand { padding: 18px; }
  .brand-logo { width: 136px; }
  .page-brand > span { font-size: 10px; }
  .form-wrap { width: min(100% - 36px, 760px); padding: 34px 0 36px; }
  .form-header { margin-bottom: 22px; }
  .form-header h2 { font-size: 31px; }
  .progress { margin-bottom: 32px; }
  .progress-item { min-width: 42px; }
  .progress-item small { display: none; }
  .progress > i { margin-top: 15px; }
  .progress-item span { width: 31px; height: 31px; }
  .field-grid, .review-grid { grid-template-columns: 1fr; gap: 17px; }
  .phone-control { grid-template-columns: 105px minmax(0, 1fr); }
  .field-wide, .review-card:first-child { grid-column: auto; }
  .form-actions { position: sticky; z-index: 4; bottom: 0; margin: 28px -18px -36px; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); box-shadow: 0 -9px 25px rgba(24, 66, 84, .07); backdrop-filter: blur(12px); }
  .button { flex: 1; padding-inline: 14px; }
  .button-primary { margin-left: 0; }
  .form-footer { padding-inline: 18px; }
}

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