:root {
  --ink: #122039;
  --ink-soft: #53627a;
  --line: #dbe2ec;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --brand: #3157e8;
  --brand-dark: #1835a8;
  --accent: #4de1c1;
  --focus: #8db7ff;
  --danger-soft: #fff7db;
  --danger-ink: #765b00;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--surface); }
a { color: var(--brand-dark); text-underline-offset: 3px; }
button, input { font: inherit; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(560px, 56%) minmax(420px, 44%); }
.auth-panel { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 34px clamp(34px, 6vw, 96px) 28px; background: var(--surface); }
.brand-header, .auth-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .18em; text-decoration: none; }
.brand-mark { position: relative; width: 30px; height: 30px; display: inline-block; transform: rotate(30deg); }
.brand-mark i { position: absolute; width: 15px; height: 15px; border: 3px solid var(--brand); border-radius: 50%; }
.brand-mark i:nth-child(1) { left: 7px; top: 0; }
.brand-mark i:nth-child(2) { left: 0; top: 12px; }
.brand-mark i:nth-child(3) { right: 0; top: 12px; }
.environment-pill { padding: 8px 12px; color: #365073; background: #eff3f9; border: 1px solid #e1e7f0; border-radius: 999px; font-size: 12px; font-weight: 700; }

.auth-content { width: min(100%, 560px); align-self: center; justify-self: center; padding: 58px 0; }
.step-label { margin-bottom: 14px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; max-width: 520px; color: var(--ink); font-size: clamp(34px, 4vw, 50px); line-height: 1.06; letter-spacing: -.045em; }
.lead { margin: 20px 0 32px; max-width: 510px; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.notice { margin-bottom: 22px; padding: 13px 16px; color: var(--danger-ink); background: var(--danger-soft); border: 1px solid #f0db83; border-radius: 12px; font-size: 14px; }

.auth-form { display: grid; gap: 12px; }
.auth-form label { font-size: 14px; font-weight: 750; }
.auth-form input[type="email"], .auth-form input[type="text"] { width: 100%; height: 58px; padding: 0 17px; color: var(--ink); background: var(--surface); border: 1.5px solid #cbd4e1; border-radius: 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 32%, transparent); }
.auth-form input::placeholder { color: #8b97a9; }
.field-help { margin: -2px 0 8px; color: #6e7b8e; font-size: 13px; line-height: 1.45; }
.primary-button { min-height: 56px; margin-top: 8px; padding: 0 22px; color: white; background: linear-gradient(135deg, var(--brand), #233bc1); border: 0; border-radius: 13px; font-weight: 800; cursor: pointer; box-shadow: 0 12px 28px rgba(49,87,232,.20); }
.primary-button:hover { background: linear-gradient(135deg, #284bd3, var(--brand-dark)); }
.primary-button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.privacy-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); color: #65748a; font-size: 13px; line-height: 1.5; }
.privacy-note p { margin: 0; }
.shield { flex: 0 0 25px; display: grid; place-items: center; width: 25px; height: 25px; color: #0f7d69; background: #ddf8f1; border-radius: 8px; font-weight: 900; }
.back-link { display: inline-block; margin-bottom: 24px; color: #627188; font-size: 14px; text-decoration: none; }

.method-list { display: grid; gap: 13px; }
.method-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; min-height: 86px; padding: 16px 18px; color: var(--ink); background: white; border: 1.5px solid var(--line); border-radius: 15px; text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.method-card:hover { transform: translateY(-1px); border-color: #a7b8d4; box-shadow: 0 12px 26px rgba(25,42,74,.08); }
.method-card.preferred { border-color: #b8c7ff; background: linear-gradient(135deg, #fbfcff, #f2f5ff); }
.method-icon { display: grid; place-items: center; width: 46px; height: 46px; color: var(--brand); background: #eaf0ff; border-radius: 13px; font-weight: 900; }
.authenticator-icon { letter-spacing: 2px; }
.mail-icon { color: #087766; background: #ddf8f1; font-size: 20px; }
.method-copy { display: grid; gap: 5px; }
.method-copy strong { font-size: 15px; }
.method-copy small { color: #6d7a8d; font-size: 13px; }
.method-arrow { color: #78869a; font-size: 22px; }
.security-caption { margin: 21px 4px 0; color: #66758b; font-size: 13px; line-height: 1.55; }

.code-form { margin-top: 4px; }
.segmented-code { font-variant-numeric: tabular-nums; font-size: 28px !important; font-weight: 800; text-align: center; letter-spacing: .7em; padding-left: calc(17px + .7em) !important; }
.digits-8 { letter-spacing: .45em; padding-left: calc(17px + .45em) !important; }
.code-actions { display: flex; justify-content: space-between; gap: 18px; margin-top: 22px; font-size: 13px; }
.code-actions span { color: #7b8798; }

.enroll-layout { display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: center; margin: 4px 0 26px; }
.qr-placeholder { aspect-ratio: 1; display: grid; place-content: center; gap: 6px; padding: 18px; text-align: center; background: repeating-conic-gradient(#172947 0 3%, #fff 0 6%) 50% / 22px 22px; border: 10px solid white; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.qr-placeholder span, .qr-placeholder small { padding: 5px 7px; color: var(--ink); background: white; border-radius: 5px; }
.qr-placeholder span { font-weight: 900; }
.qr-placeholder small { font-size: 10px; }
.manual-setup p { color: #68768a; font-size: 13px; line-height: 1.5; }
.manual-setup code { display: block; padding: 12px; color: #34435b; background: #f0f3f8; border-radius: 9px; letter-spacing: .08em; }
.compact { margin-top: 8px; }

.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; padding: 18px; background: #f4f6fa; border: 1px solid var(--line); border-radius: 14px; }
.recovery-grid code { padding: 8px; color: #49576c; background: white; border-radius: 7px; text-align: center; }
.recovery-warning { margin-bottom: 20px; color: #6b5b12; font-size: 13px; }
.check-label { display: flex; gap: 10px; align-items: center; color: #4f5e72; font-weight: 600 !important; }
.check-label input { width: 18px; height: 18px; accent-color: var(--brand); }

.auth-footer { color: #7c899a; font-size: 12px; }
.auth-footer nav { display: flex; gap: 18px; }
.auth-footer a { color: #6f7d90; text-decoration: none; }

.story-panel { position: relative; min-height: 100vh; overflow: hidden; display: flex; align-items: flex-end; padding: clamp(48px, 7vw, 100px); color: white; background: radial-gradient(circle at 75% 25%, rgba(77,225,193,.22), transparent 24%), linear-gradient(145deg, #142650 0%, #263fd0 58%, #4124a8 100%); }
.story-grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom right, black, transparent 78%); }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.orbit::before, .orbit::after { content: ""; position: absolute; width: 14px; height: 14px; background: var(--accent); border: 5px solid rgba(77,225,193,.18); border-radius: 50%; background-clip: padding-box; }
.orbit-one { width: 520px; height: 520px; right: -170px; top: 90px; }
.orbit-one::before { left: 40px; top: 100px; }
.orbit-one::after { left: 180px; bottom: -7px; }
.orbit-two { width: 330px; height: 330px; right: 70px; top: 185px; }
.orbit-two::before { right: 35px; bottom: 55px; }
.orbit-two::after { left: -8px; top: 155px; }
.story-copy { position: relative; z-index: 2; max-width: 590px; }
.story-kicker { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.story-copy h2 { margin: 18px 0 20px; font-size: clamp(42px, 5vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.story-copy p { max-width: 500px; margin: 0; color: rgba(255,255,255,.76); font-size: 17px; line-height: 1.6; }
.signal { position: absolute; z-index: 1; right: 9%; bottom: 12%; display: flex; align-items: flex-end; gap: 7px; opacity: .32; }
.signal span { width: 6px; background: var(--accent); border-radius: 6px; }
.signal span:nth-child(1) { height: 20px; }.signal span:nth-child(2) { height: 42px; }.signal span:nth-child(3) { height: 28px; }.signal span:nth-child(4) { height: 58px; }.signal span:nth-child(5) { height: 35px; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .story-panel { display: none; }
  .auth-panel { min-height: 100vh; padding: 26px clamp(22px, 7vw, 64px); }
}

@media (max-width: 560px) {
  .environment-pill { display: none; }
  .auth-content { padding: 46px 0; }
  h1 { font-size: 36px; }
  .lead { font-size: 15px; }
  .enroll-layout { grid-template-columns: 1fr; }
  .qr-placeholder { width: 180px; justify-self: center; }
  .recovery-grid { grid-template-columns: 1fr; }
  .code-actions, .auth-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
