:root {
  --page: #f7f9fc;
  --surface: #ffffff;
  --surface-strong: #f3f6fb;
  --paper-shade: #e8edf5;
  --ink: #0b1a2b;
  --muted: #44566c;
  --line: rgba(11, 26, 43, 0.14);
  --line-strong: rgba(11, 26, 43, 0.34);
  --primary: #1a4dff;
  --primary-bright: #4d75ff;
  --primary-dim: #12309e;
  --primary-ink: #ffffff;
  --mint: #23c98d;
  --navy: #0b1a2b;
  --navy-deep: #06111e;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --success: #15803d;
  --shadow-sheet:
    0 1px 2px rgba(6, 17, 30, 0.14),
    0 20px 44px -24px rgba(6, 17, 30, 0.42);
  --shadow-control: 0 10px 24px -18px rgba(6, 17, 30, 0.55);
  --font-sans: "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

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

html {
  min-width: 320px;
  background: var(--navy-deep);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(52rem 32rem at 80% -14%, rgba(26, 77, 255, 0.44), transparent 62%),
    radial-gradient(34rem 26rem at -8% 24%, rgba(77, 117, 255, 0.2), transparent 64%),
    radial-gradient(26rem 20rem at 58% 16%, rgba(35, 201, 141, 0.12), transparent 68%),
    linear-gradient(180deg, var(--navy-deep) 0, var(--navy) 340px, var(--page) 780px);
  background-size: 44px 44px, 44px 44px, auto, auto, auto, auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(100%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.onboarding-container {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.onboarding-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 17, 30, 0.88);
  backdrop-filter: blur(16px);
}

.onboarding-header-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  min-width: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 12px 24px -14px rgba(26, 77, 255, 0.9);
  flex: 0 0 auto;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.brand-wordmark span:last-child {
  color: #c6d3ff;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #d6e1ff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.header-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.profile-corner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pending-approval-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(251, 191, 36, 0.48);
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: help;
}

.pending-approval-pill[hidden] {
  display: none !important;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid rgba(198, 211, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.profile-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffffff;
}

.profile-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #8ca8ff;
  flex: 0 0 auto;
}

.profile-pill[data-signed-in="true"] .profile-dot {
  background: var(--mint);
}

.onboarding-main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 88px;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 32px;
  align-items: start;
}

.hero-copy {
  padding: 16px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(77, 117, 255, 0.55);
  border-radius: 999px;
  background: rgba(26, 77, 255, 0.18);
  color: #e3ebff;
  font-size: 13px;
  font-weight: 600;
}

.hero-copy h1 {
  margin: 18px 0 16px;
  color: #ffffff;
  font-size: clamp(2.25rem, 4.5vw, 3.6rem);
  line-height: 1.04;
  font-weight: 700;
  max-width: 720px;
}

.hero-lede {
  margin: 0;
  color: #cdd8ec;
  font-size: 1.125rem;
  line-height: 1.55;
  max-width: 640px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 28px -18px rgba(26, 77, 255, 0.9);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--primary-bright);
  border-color: var(--primary-bright);
}

.btn:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.btn.secondary {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-control);
}

.btn.secondary:hover {
  border-color: rgba(26, 77, 255, 0.45);
  background: #f3f6ff;
  color: var(--primary-dim);
}

.btn.hero-ghost {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
}

.btn.hero-ghost:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.btn.full {
  width: 100%;
}

.submit-tier-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.assurance-list {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: #dce5f5;
  font-size: 14px;
  font-weight: 600;
}

.assurance-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assurance-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(35, 201, 141, 0.2);
  color: #82f0c3;
  font-size: 12px;
  flex: 0 0 auto;
}

.surface-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow-sheet);
}

.surface-card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
}

.surface-card .card-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.step-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #e5ecff;
  color: var(--primary-dim);
  font-size: 15px;
  font-weight: 700;
}

.step-item strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 4px;
}

.step-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.pillar-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-control);
}

.pillar-card .pillar-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pillar-card strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.pillar-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.pillar-card .btn {
  margin-top: 10px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-block-end: 18px;
}

.field label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.field .hint {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 16px);
  line-height: 1.4;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(26, 77, 255, 0.18);
}

:is(.field input, .field select, .field textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

:is(.field input, .field select, .field textarea):is(:user-invalid, .user-invalid-fallback) + .field-error {
  display: block;
}

:is(.field input, .field select, .field textarea):is(:user-valid, .user-valid-fallback) {
  border-color: var(--success);
}

.field-error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.optional-details {
  margin: 8px 0 20px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.optional-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.optional-details summary span {
  color: var(--muted);
  font-weight: 500;
}

.optional-details[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.form-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(185, 28, 28, 0.3);
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.form-status {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(26, 77, 255, 0.28);
  border-radius: 10px;
  background: #eef3ff;
  color: var(--primary-dim);
  font-size: 14px;
  font-weight: 600;
}

.success-panel {
  display: grid;
  gap: 14px;
}

.success-panel h3 {
  margin: 0;
  color: var(--success);
  font-size: 1.35rem;
}

.password-row {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.password-row input {
  flex: 1 1 auto;
}

.password-toggle {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.password-toggle:hover {
  background: #e9effa;
}

.onboarding-footer {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.onboarding-footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.onboarding-footer a {
  text-decoration: none;
  font-weight: 600;
}

.onboarding-footer a:hover {
  color: var(--primary);
}

/* Native Modal Dialog */
dialog.auth-dialog {
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(460px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px -24px rgba(6, 17, 30, 0.72);
}

dialog.auth-dialog:modal {
  overscroll-behavior: contain;
}

dialog.auth-dialog::backdrop {
  background: rgba(6, 17, 30, 0.62);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.auth-dialog-body {
  padding: 24px;
}

.auth-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-dialog-head h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--ink);
}

.auth-dialog-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.dialog-close {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.dialog-close:hover {
  background: var(--surface-strong);
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.auth-mode-tab {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-mode-tab[aria-pressed="true"] {
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-control);
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: var(--line);
}

.dialog-fallback-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 10px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.dialog-fallback-link:hover {
  text-decoration: underline;
}

.tooltip-badge {
  position: relative;
}

.tooltip-badge[data-tooltip]:hover::after,
.tooltip-badge[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--navy-deep);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-sheet);
  pointer-events: none;
}

@media (pointer: coarse) {
  .btn,
  .profile-pill,
  .dialog-close,
  .password-toggle,
  .field input,
  .field select,
  .field textarea {
    min-height: 52px;
  }
}

@media (max-width: 960px) {
  .hero-split,
  .pillar-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .form-grid-2,
  .provider-grid {
    grid-template-columns: 1fr;
  }

  .header-nav {
    display: none;
  }
}
