:root {
  color-scheme: light;
  --ink: #16233b;
  --muted: #657189;
  --paper: #ffffff;
  --line: #dfe5ee;
  --blue: #006491;
  --blue-dark: #004d70;
  --red: #e31837;
  --soft: #f4f7fb;
  --shadow: 0 24px 60px rgba(18, 39, 68, 0.16);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 12%, rgba(0, 100, 145, 0.16), transparent 32rem),
    radial-gradient(circle at 90% 88%, rgba(227, 24, 55, 0.12), transparent 28rem),
    linear-gradient(145deg, #edf3f9 0%, #f8fafc 50%, #eef2f7 100%);
}
.page-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.portal-card {
  width: min(100%, 500px);
  padding: clamp(28px, 7vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}
.brand-mark {
  position: relative; width: 54px; height: 54px; margin-bottom: 22px; overflow: hidden;
  border-radius: 16px; background: linear-gradient(135deg, var(--red) 0 49%, var(--paper) 49% 51%, var(--blue) 51% 100%);
  transform: rotate(45deg); box-shadow: 0 10px 28px rgba(0, 77, 112, 0.22);
}
.brand-mark span { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: white; }
.brand-mark span:nth-child(1) { top: 13px; left: 13px; }
.brand-mark span:nth-child(2) { right: 11px; bottom: 11px; }
.brand-mark span:nth-child(3) { right: 22px; bottom: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .79rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 3rem); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin: 0 0 8px; font-size: 1rem; }
.intro { margin: 18px 0 26px; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.form-panel { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--soft); }
label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 750; }
.phone-field { display: flex; align-items: center; margin-bottom: 12px; overflow: hidden; border: 1px solid #cfd7e4; border-radius: 14px; background: white; }
.country-code { padding: 15px 13px; border-right: 1px solid var(--line); font-weight: 700; }
input[type="tel"], .otp-input { width: 100%; min-width: 0; padding: 15px 13px; border: 1px solid #cfd7e4; border-radius: 14px; color: var(--ink); background: white; font: inherit; }
.phone-field input { border: 0; border-radius: 0; }
.otp-input { margin-bottom: 12px; font-size: 1.5rem; font-weight: 800; letter-spacing: .25em; text-align: center; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(227, 24, 55, .35); outline-offset: 3px; }
button { width: 100%; padding: 15px 18px; border: 0; border-radius: 14px; color: white; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 10px 24px rgba(0, 100, 145, .2); cursor: pointer; font: inherit; font-weight: 800; }
button:disabled { cursor: not-allowed; opacity: .55; }
.status-note { margin: 13px 2px 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.error { color: #991b1b; font-weight: 700; }
.legal-links { display: grid; gap: 10px; margin-top: 22px; }
a { color: var(--blue-dark); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a small, h2 small { color: var(--muted); font-weight: 600; }
.draft-badge { display: inline-block; margin: 18px 0; padding: 7px 10px; border-radius: 999px; color: #7f1d1d; background: #fee2e2; font-size: .75rem; font-weight: 800; }
.back-link { display: inline-block; margin-top: 18px; }
.consent-form { display: grid; gap: 14px; }
.document-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.document-card p { color: var(--muted); line-height: 1.45; }
.check-row { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 8px; margin-top: 12px; line-height: 1.4; }
.check-row input { width: 20px; height: 20px; margin: 0; }
.success-mark { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px; border-radius: 50%; color: white; background: #16803c; font-size: 2rem; }
@media (max-width: 420px) {
  .page-shell { padding: 0; place-items: stretch; }
  .portal-card { width: 100%; min-height: 100vh; border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
