:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #aab1bf;
  --quiet: #788193;
  --page: #090b10;
  --card: rgba(18, 22, 31, 0.92);
  --card-strong: #12161f;
  --field: #0d1119;
  --line: #2b3342;
  --wire: #0785bd;
  --wire-deep: #005b88;
  --wire-text: #0785bd;
  --danger: #ff8e9b;
  --danger-bg: #2a1218;
  --success: #7ee2bd;
  --focus: #0785bd;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html.light {
  color-scheme: light;
  --ink: #102235;
  --muted: #445b70;
  --quiet: #64798d;
  --page: #edf4f8;
  --card: rgba(255, 255, 255, 0.9);
  --card-strong: #f7fbfd;
  --field: #fbfdff;
  --line: #b8cbd8;
  --wire: #0785bd;
  --wire-deep: #005b88;
  --wire-text: #005b88;
  --danger: #a7253c;
  --danger-bg: #fff0f3;
  --success: #176c4f;
  --focus: #005b88;
  --shadow: 0 24px 70px rgba(29, 65, 91, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 4%, rgba(7, 133, 189, 0.11), transparent 31rem),
    linear-gradient(150deg, #090b10 0%, #0d1118 53%, #080a0e 100%);
  font-family: "Poppins", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

a {
  color: var(--wire-text);
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #071017;
  background: var(--focus);
  border-radius: 7px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: calc(14px + env(safe-area-inset-top)) clamp(18px, 4vw, 48px) 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 11, 16, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.brand img {
  display: block;
  width: auto;
  height: 32px;
}

html.dark .editorial-logo-light,
html.light .editorial-logo-dark {
  display: none;
}

.locale-control select {
  min-height: 44px;
  max-width: 190px;
  padding: 8px 34px 8px 12px;
  color: var(--ink);
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 850px);
  margin: 0 auto;
  padding: clamp(34px, 7vw, 70px) clamp(16px, 4vw, 34px) 72px;
  flex: 1 0 auto;
}

.registration-intro {
  margin: 0 0 26px;
}

.eyebrow,
.status-kicker {
  margin: 0 0 9px;
  color: var(--wire-text);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 3.65rem);
  font-weight: 600;
  letter-spacing: -0.048em;
  line-height: 1.02;
}

.lede {
  max-width: 650px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
}

.reference-preview {
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px 11px;
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--wire);
  background: rgba(7, 133, 189, 0.07);
}

.reference-label {
  color: var(--quiet);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reference-preview output {
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.registration-card {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.registration-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--wire), transparent);
}

.design-preview-banner {
  margin: 0 0 24px;
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(7, 133, 189, 0.4);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 91, 136, 0.18), rgba(7, 133, 189, 0.06));
}

.design-preview-banner strong {
  color: var(--wire-text);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.design-preview-banner span,
.design-preview-notice {
  color: var(--muted);
  font-size: 0.875rem;
}

.design-preview-notice {
  margin: 0 0 20px;
  padding: 11px 13px;
  border-left: 3px solid var(--wire);
  background: rgba(7, 133, 189, 0.07);
}

.step-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.step-heading {
  margin-bottom: 10px;
  font-size: clamp(1.08rem, 3vw, 1.35rem);
  line-height: 1.35;
}

#progressText {
  color: var(--quiet);
  font: 600 0.875rem ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #252c38;
}

.progress-fill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wire-deep), var(--wire));
  transition: width 220ms ease;
}

.required-note,
.step-copy,
.recaptcha-notice {
  color: var(--muted);
  font-size: 0.875rem;
}

.required-note {
  margin: 12px 0 21px;
}

.step-copy {
  margin-bottom: 20px;
}

.error-summary {
  margin: 0 0 20px;
  padding: 12px 14px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(255, 142, 155, 0.48);
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 600;
}

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

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

.editorial-phone-field {
  display: grid;
  gap: 7px;
}

.editorial-phone-row {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.editorial-phone-country,
.editorial-phone-number {
  min-width: 0;
  flex: 1 1 0;
}

.editorial-phone-country-control {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0 0 0 12px;
  background: var(--field);
  border: 1px solid #5e6878;
  border-radius: 8px;
}

.editorial-phone-country-control select {
  width: auto;
  min-width: 0;
  min-height: 42px;
  flex: 1 1 auto;
  padding: 10px 34px 10px 0;
  background: transparent;
  border: 0;
  border-radius: 0 8px 8px 0;
}

.editorial-phone-country-control:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.editorial-phone-country-control select:focus-visible {
  outline: none;
}

.editorial-phone-flag {
  flex: 0 0 auto;
  line-height: 0;
}

.editorial-phone-flag img {
  display: block;
  width: 22px;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
}

.phone-warning {
  display: block;
  color: #f3bf73;
  font-size: 0.875rem;
  line-height: 1.45;
}

.phone-warning:empty {
  display: none;
}

.organization-location {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.organization-location-button {
  min-height: 44px;
  padding: 6px 2px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}

.organization-location-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: currentColor;
}

.organization-location-button:hover:not(:disabled) {
  color: var(--wire-text);
  text-decoration: underline;
}

.organization-location-button:disabled {
  opacity: 0.58;
  cursor: wait;
}

#organizationLocationStatus {
  min-height: 1.1em;
}

label:not(.choice) {
  display: grid;
  align-content: start;
  gap: 7px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid #5e6878;
  border-radius: 8px;
  font-size: 1rem;
}

select option,
select optgroup {
  color: #111;
  background: #fff;
}

.field-hint {
  color: var(--quiet);
  font-size: 0.875rem;
  font-weight: 400;
}

.field-error {
  min-height: 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
}

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

[aria-invalid="true"] {
  border-color: var(--danger) !important;
  outline: 1px solid var(--danger);
}

.choice-fieldset,
.permission-box,
.agreement-box {
  margin: 0 0 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.choice-fieldset legend,
.permission-box legend,
.agreement-box legend {
  padding: 0 7px;
  font-size: 0.875rem;
  font-weight: 600;
}

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

.radio-row {
  display: flex;
  gap: 22px;
}

.choice {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
}

.choice input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--wire);
}

.permission-box p {
  color: var(--muted);
  font-size: 0.875rem;
}

#coverageOtherWrap {
  margin-bottom: 20px;
}

.password-field {
  position: relative;
  display: flex;
}

.password-field input {
  padding-right: 64px !important;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 58px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--wire-text);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}

.password-strength {
  height: 4px;
  margin-top: -1px;
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.password-strength > i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #dc2626;
  transition: width 200ms ease, background 200ms ease;
}

.password-strength-word {
  min-height: 1em;
  margin-top: -3px;
  color: var(--quiet);
  font-size: 0.875rem;
  font-weight: 400;
}

.recaptcha-notice {
  margin: 22px 0 0;
  font-size: 0.875rem;
}

.review-panel {
  margin-bottom: 22px;
  padding: 5px 16px;
  border-left: 3px solid var(--wire);
  background: rgba(255, 255, 255, 0.025);
}

.review-panel dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.6fr);
  gap: 9px 16px;
  font-size: 0.875rem;
}

.review-panel dt {
  color: var(--quiet);
}

.review-panel dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.form-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.button {
  min-height: 44px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #0785bd, #005b88);
  border: 1px solid #0785bd;
  box-shadow: 0 8px 25px rgba(0, 91, 136, 0.22);
}

.button-secondary {
  color: var(--ink);
  background: transparent;
  border: 1px solid #616b79;
}

.button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.state-panel {
  padding: 8px 0 0;
}

.state-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.state-panel > p {
  color: var(--muted);
  font-size: 0.875rem;
}

#otpInput {
  max-width: 250px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.32em;
}

.completion-panel {
  text-align: left;
}

.customer-id-card {
  width: fit-content;
  margin: 25px 0;
  padding: 14px 18px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(7, 133, 189, 0.45);
  border-radius: 9px;
  background: rgba(7, 133, 189, 0.08);
}

.customer-id-card span {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.customer-id-card strong {
  font: 700 clamp(1.15rem, 4vw, 1.55rem) ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.08em;
}

.feature-unavailable p {
  max-width: 580px;
  color: var(--muted);
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 25px 18px calc(25px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--quiet);
  text-align: center;
  font-size: 0.7rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.site-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
}

.site-footer p {
  margin: 6px 0 0;
}

html.light body {
  background:
    radial-gradient(circle at 14% 4%, rgba(7, 133, 189, 0.14), transparent 31rem),
    linear-gradient(150deg, #f8fcfe 0%, #eaf3f8 53%, #f4f9fc 100%);
}

html.light body::before {
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(0, 91, 136, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 91, 136, 0.055) 1px, transparent 1px);
}

html.light .site-header {
  border-bottom-color: rgba(29, 65, 91, 0.14);
  background: rgba(247, 251, 253, 0.84);
}

html.light .reference-preview,
html.light .design-preview-notice {
  background: rgba(7, 133, 189, 0.07);
}

html.light .design-preview-banner {
  border-color: rgba(7, 133, 189, 0.34);
  background: linear-gradient(
    135deg,
    rgba(0, 91, 136, 0.12),
    rgba(255, 255, 255, 0.72)
  );
}

html.light .progress-track {
  background: #cfdee7;
}

html.light .error-summary {
  border-color: rgba(167, 37, 60, 0.4);
}

html.light .editorial-phone-country-control,
html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select {
  border-color: #829cad;
}

html.light .editorial-phone-flag img {
  border-color: rgba(16, 34, 53, 0.2);
}

html.light .phone-warning {
  color: #87520a;
}

html.light .review-panel {
  background: rgba(0, 91, 136, 0.045);
}

html.light .button-secondary {
  border-color: #829cad;
  background: rgba(255, 255, 255, 0.5);
}

html.light .customer-id-card {
  border-color: rgba(7, 133, 189, 0.35);
  background: rgba(7, 133, 189, 0.07);
}

html.light .site-footer {
  border-top-color: rgba(29, 65, 91, 0.14);
}

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

.step-heading:focus,
.state-panel h2:focus {
  outline: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 650px) {
  .site-header {
    align-items: center;
  }

  .brand img {
    height: 27px;
  }

  .locale-control select {
    max-width: 145px;
    font-size: 0.78rem;
  }

  .field-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .form-actions {
    grid-template-columns: 1fr 1fr;
  }

  .form-actions > span {
    display: none;
  }

  .form-actions .button {
    width: 100%;
  }

  #backButton[hidden] ~ #nextButton {
    grid-column: 1 / -1;
  }

  .form-actions .button:only-of-type {
    grid-column: 1 / -1;
  }

  .review-panel dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .review-panel dd {
    margin-bottom: 8px;
  }
}

@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;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #778293;
    --muted: #c7ccd5;
    --quiet: #abb3c1;
  }
}
