:root {
  color-scheme: dark;
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  background: #0e0f16;
}

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

.auth-page {
  --auth-panel: #141620;
  --auth-field: #10111a;
  --auth-border: #343040;
  --auth-text: #f9f4f7;
  --auth-muted: #b7afc2;
  --auth-accent: #f47794;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: clamp(16px, 5vw, 64px) clamp(12px, 4vw, 48px) 22px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 20px;
  background: radial-gradient(ellipse at 24% 5%, #251729 0, transparent 56%), #0e0f16;
  color: var(--auth-text);
  font-size: 14px;
  line-height: 1.5;
}

.auth-shell {
  width: min(100%, 1080px);
  min-width: 0;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 4.3fr) minmax(0, 5.7fr);
  border: 1px solid var(--auth-border);
  border-radius: 26px;
  background: var(--auth-panel);
  box-shadow: 0 36px 96px #0006;
}

.auth-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 38px;
  min-width: 0;
  overflow: hidden;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 25px 0 0 25px;
  border-right: 1px solid var(--auth-border);
  background: radial-gradient(ellipse at 96% 90%, #4d223b, transparent 66%), linear-gradient(150deg, #251a2e, #1b1726 55%);
}

.auth-orbit {
  position: absolute;
  z-index: -1;
  width: 390px;
  height: 390px;
  right: -180px;
  bottom: -180px;
  border: 1px solid #e46e9b50;
  border-radius: 42% 58% 66% 34%;
  transform: rotate(-26deg);
  box-shadow: 0 0 0 25px #e46e9b26, 0 0 0 52px #e46e9b1b, 0 0 0 83px #e46e9b12;
  pointer-events: none;
}

.auth-brand, .auth-eyebrow, .auth-security {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand {
  width: fit-content;
  color: #eadfeb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.auth-brand img {
  width: 84px;
  height: 30px;
  object-fit: contain;
}

.auth-brand span { border-left: 1px solid #6b465c; padding-left: 12px; }
.auth-story-content { max-width: 350px; }
.auth-story-title { margin: 12px 0; font-size: clamp(32px, 4vw, 54px); font-weight: 750; line-height: 1.06; letter-spacing: -.065em; }
.auth-story-description { margin: 0; max-width: 29ch; color: #d4c6d7; font-size: 14px; }

.auth-kicker, .auth-eyebrow {
  color: var(--auth-accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-security {
  width: fit-content;
  border: 1px solid #a779a045;
  border-radius: 999px;
  background: #1d152690;
  padding: 7px 12px;
  color: #ecdbe6;
  font-size: 11px;
  font-weight: 600;
}

.auth-security svg, .auth-field-icon, .auth-icon-button svg, .auth-submit svg, .auth-back svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.auth-security svg { color: var(--auth-accent); }
.auth-workspace { display: grid; place-items: center; min-width: 0; padding: clamp(25px, 5vw, 68px); }
.auth-form { width: min(100%, 390px); min-width: 0; }
.auth-form--enroll { width: min(100%, 480px); }
.auth-heading { margin-bottom: 30px; }
.auth-heading h1 { margin: 11px 0 7px; font-size: clamp(27px, 4vw, 42px); line-height: 1.12; letter-spacing: -.05em; font-weight: 750; }
.auth-heading p { margin: 0; color: var(--auth-muted); }

.auth-step {
  display: grid;
  width: 31px;
  height: 26px;
  place-items: center;
  border: 1px solid #673748;
  border-radius: 7px;
  background: #f4779413;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

.auth-error {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid #89445b;
  border-radius: 9px;
  background: #5c25344d;
  color: #ffbecd;
  font-size: 13px;
}

.auth-group { margin-bottom: 16px; }
.auth-label { display: block; margin: 0 0 7px; color: #e8e1eb; font-size: 12px; font-weight: 650; }
.auth-field { position: relative; }
.auth-field-icon { position: absolute; top: 17px; left: 14px; color: #b2a7bd; pointer-events: none; }

.auth-field input, .auth-otp {
  width: 100%;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: var(--auth-field);
  color: var(--auth-text);
  caret-color: var(--auth-accent);
  font: inherit;
  transition: border-color .16s ease, background-color .16s ease;
}

.auth-field input { height: 50px; padding: 0 14px 0 43px; font-size: 16px; }
.auth-field--password input { padding-right: 50px; }
.auth-field input::placeholder { color: #8f879e; opacity: 1; }

.auth-icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.auth-icon-button:hover { background: #282334; color: var(--auth-text); }
.auth-password-toggle { position: absolute; top: 4px; right: 4px; }
.auth-password-toggle .auth-eye-off, .auth-password-toggle[aria-pressed='true'] .auth-eye { display: none; }
.auth-password-toggle[aria-pressed='true'] .auth-eye-off { display: block; }

.auth-field input:focus, .auth-otp:focus, .auth-icon-button:focus-visible, .auth-submit:focus-visible, .auth-back:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
}

.auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin-top: 23px;
  padding: 12px 40px;
  border: 1px solid #ff9bb0;
  border-radius: 10px;
  background: var(--auth-accent);
  color: #22101a;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.auth-submit:hover { background: #ff8da7; }
.auth-submit:disabled { cursor: wait; }
.auth-submit svg { position: absolute; right: 16px; }
.auth-submit.loading > * { opacity: 0; }
.auth-submit.loading::after {
  position: absolute;
  width: 19px;
  height: 19px;
  border: 2px solid #22101a4d;
  border-top-color: #22101a;
  border-radius: 50%;
  content: '';
  animation: auth-spin .65s linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-footer { margin: 0 auto; color: var(--auth-muted); font-size: 11px; letter-spacing: .025em; text-align: center; }

.auth-setup {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 13px;
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  background: #1b1926;
}

.auth-qr {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  color: #2a2230;
  line-height: 1.3;
  text-align: center;
}

.auth-qr canvas, .auth-qr img { grid-area: 1 / 1; max-width: 100%; }
.auth-steps { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.auth-steps li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px; color: var(--auth-muted); font-size: 12px; }
.auth-steps strong { color: var(--auth-text); font-weight: 650; }
.auth-step-index { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 6px; background: #3a2438; color: #ffb2c6; font-size: 10px; font-weight: 750; }

.auth-key { margin: 14px 0 21px; }
.auth-key-row { display: flex; gap: 6px; align-items: center; padding: 2px 4px 2px 11px; border: 1px solid var(--auth-border); border-radius: 9px; background: var(--auth-field); }
.auth-key code { flex: 1; min-width: 0; padding-block: 4px; overflow-wrap: anywhere; color: #e8e0ec; font-size: 12px; letter-spacing: .07em; user-select: all; }
.auth-key .auth-icon-button { flex: 0 0 42px; border-color: transparent; }
.auth-key .auth-icon-button.ok { color: #95dfbc; }
.auth-otp-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-otp-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(5px, 1.2vw, 10px); }
.auth-otp { min-width: 0; height: clamp(42px, 6vw, 55px); padding: 0; text-align: center; font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }
.auth-otp.filled { border-color: #995770; background: #251d2a; }
.auth-back { display: flex; width: fit-content; align-items: center; gap: 7px; margin: 15px auto 0; padding: 4px 6px; border-radius: 6px; color: var(--auth-muted); font-size: 12px; text-decoration: none; }
.auth-back:hover { color: var(--auth-accent); }

@media (max-width: 820px) {
  .auth-shell { max-width: 560px; grid-template-columns: 1fr; }
  .auth-story { gap: 18px; padding: 24px 28px; border-right: 0; border-bottom: 1px solid var(--auth-border); border-radius: 25px 25px 0 0; }
  .auth-story-content, .auth-security { display: none; }
  .auth-workspace { padding: 30px clamp(19px, 6vw, 42px); }
  .auth-orbit { right: -240px; bottom: -315px; }
}

@media (max-width: 480px) {
  .auth-shell { border-radius: 18px; }
  .auth-story { padding: 17px 19px; border-radius: 17px 17px 0 0; }
  .auth-heading { margin-bottom: 23px; }
  .auth-setup { grid-template-columns: 1fr; }
  .auth-qr { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { transition: none; }
  .auth-submit.loading::after { animation: none; }
}
