:root {
  --bg: #06101d;
  --panel: rgba(11, 26, 43, .92);
  --panel-2: rgba(17, 38, 59, .72);
  --line: rgba(132, 190, 212, .16);
  --text: #f1f8fb;
  --muted: #91a8b7;
  --cyan: #55dce7;
  --green: #5de0a1;
  --red: #ff6b7a;
  --shadow: 0 30px 90px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(31, 145, 165, .16), transparent 31%),
    radial-gradient(circle at 88% 88%, rgba(38, 111, 133, .13), transparent 35%),
    linear-gradient(145deg, #050d18, #071523 54%, #06101d);
  font-family: "Aptos", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.auth-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .23;
  background-image:
    linear-gradient(rgba(85, 220, 231, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 220, 231, .055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 76%);
}

.auth-glow { position: fixed; width: 340px; height: 340px; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.auth-glow--one { top: -170px; right: 12%; background: rgba(85, 220, 231, .13); }
.auth-glow--two { bottom: -220px; left: 23%; background: rgba(93, 224, 161, .09); }

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 475px);
  gap: clamp(48px, 9vw, 132px);
  align-items: center;
}

.auth-story { min-height: 650px; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 0; }
.brand { display: inline-flex; width: max-content; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand__mark { width: 45px; height: 45px; display: grid; place-items: center; color: var(--cyan); border: 1px solid rgba(223,110,75,.3); border-radius: 15px; background: rgba(244,240,231,.055) url("/static/brand/logo-icon-reversed.svg") center / 32px 32px no-repeat; box-shadow: inset 0 0 18px rgba(244,240,231,.04); }
.brand__mark svg { width: 29px; opacity: 0; }
.brand strong { display: block; font-size: 20px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: .23em; }

.story-copy { max-width: 660px; }
.eyebrow { margin: 0 0 18px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.story-copy h1 { margin: 0; font-size: clamp(43px, 5.5vw, 74px); line-height: .99; letter-spacing: -.055em; font-weight: 650; }
.story-copy h1 em { color: var(--cyan); font-style: normal; font-weight: 430; }
.story-copy > p:last-child { max-width: 570px; margin: 28px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }

.trust-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.trust-list > div { padding: 16px 14px; border-top: 1px solid var(--line); display: flex; gap: 11px; }
.trust-list > div > span { color: var(--cyan); font: 700 10px/1.6 monospace; }
.trust-list p { margin: 0; }
.trust-list strong, .trust-list small { display: block; }
.trust-list strong { font-size: 13px; }
.trust-list small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.auth-card {
  position: relative;
  overflow: hidden;
  padding: 38px;
  border: 1px solid rgba(131, 194, 215, .19);
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(17, 38, 59, .94), rgba(8, 22, 38, .95));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(22px);
}
.auth-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .45; }
.card-signal { position: absolute; top: 26px; right: 28px; height: 18px; display: flex; align-items: flex-end; gap: 3px; }
.card-signal i { display: block; width: 2px; height: 4px; border-radius: 2px; background: var(--cyan); opacity: .35; animation: signal 1.8s ease-in-out infinite; }
.card-signal i:nth-child(2) { height: 8px; animation-delay: .12s; }
.card-signal i:nth-child(3) { height: 14px; animation-delay: .24s; }
.card-signal i:nth-child(4) { height: 9px; animation-delay: .36s; }
.card-signal i:nth-child(5) { height: 5px; animation-delay: .48s; }

.auth-panel { min-height: 460px; display: flex; flex-direction: column; justify-content: center; }
.panel-head { margin-bottom: 27px; }
.panel-kicker { margin: 0 0 9px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.panel-head h2 { margin: 0; font-size: 31px; letter-spacing: -.035em; }
.panel-head p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; font-size: 14px; }

.field { display: block; margin-top: 17px; }
.field > span { display: block; margin: 0 0 8px 2px; color: #b8cad4; font-size: 12px; font-weight: 650; }
.field input {
  width: 100%; height: 54px; padding: 0 16px; color: var(--text);
  border: 1px solid rgba(146, 192, 207, .18); border-radius: 14px;
  outline: none; background: rgba(2, 12, 22, .45); transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus { border-color: rgba(85,220,231,.7); box-shadow: 0 0 0 4px rgba(85,220,231,.09); background: rgba(5,17,28,.72); }
.field input::placeholder { color: #5f7888; }
.field--code input { height: 62px; text-align: center; font: 700 25px/1 monospace; letter-spacing: .26em; }

.button { width: 100%; min-height: 54px; margin-top: 23px; border: 0; border-radius: 15px; cursor: pointer; font-weight: 750; transition: transform .18s, filter .18s, opacity .18s; }
.button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button--primary { color: #031319; background: linear-gradient(120deg, var(--cyan), #7ce8d0); box-shadow: 0 12px 30px rgba(85,220,231,.16); }
.button--quiet { color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.text-button { display: inline-block; margin-top: 17px; border: 0; color: var(--cyan); background: none; cursor: pointer; padding: 0; }

.form-error { min-height: 20px; margin: 14px 0 -4px; color: #ff9ba6; font-size: 12px; line-height: 1.45; }
.bootstrap-note, .info-box { margin: 0 0 18px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: rgba(85,220,231,.045); font-size: 12px; line-height: 1.5; }
.bootstrap-note code { color: var(--cyan); }

.enroll-layout { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; }
.qr-wrap { padding: 8px; border-radius: 18px; background: #eefcff; }
.qr-wrap img { display: block; width: 100%; aspect-ratio: 1; }
.enroll-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.enroll-steps li + li { margin-top: 8px; }

.recovery-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.recovery-list code { padding: 10px 8px; text-align: center; color: #d8fbff; border: 1px solid var(--line); border-radius: 10px; background: rgba(2,12,22,.55); font-size: 11px; }
.warning { color: #ffd495; border-color: rgba(255,191,91,.22); background: rgba(255,191,91,.06); }

.secure-foot { margin: 25px 0 0; text-align: center; color: #6f8998; font-size: 10px; letter-spacing: .08em; }
.secure-foot span { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(93,224,161,.7); }
.loading { display: grid; place-items: center; gap: 16px; color: var(--muted); }
.loading__ring { width: 43px; height: 43px; border: 2px solid rgba(85,220,231,.13); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }

.toast { position: fixed; z-index: 10; top: max(20px, env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -15px); padding: 12px 17px; color: var(--text); border: 1px solid var(--line); border-radius: 12px; background: #10283a; opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.toast.error { border-color: rgba(255,107,122,.35); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes signal { 0%,100% { opacity:.25; transform:scaleY(.6); } 50% { opacity:.9; transform:scaleY(1); } }

@media (max-width: 900px) {
  .auth-shell { width: min(560px, calc(100% - 30px)); grid-template-columns: 1fr; gap: 28px; padding: max(22px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom)); }
  .auth-story { min-height: auto; padding: 0; }
  .story-copy { margin-top: 58px; }
  .story-copy h1 { font-size: clamp(38px, 10vw, 58px); }
  .story-copy > p:last-child { margin-top: 19px; font-size: 15px; }
  .trust-list { display: none; }
}

@media (max-width: 520px) {
  .auth-shell { width: calc(100% - 20px); }
  .brand__mark { width: 40px; height: 40px; border-radius: 13px; }
  .story-copy { margin-top: 42px; }
  .story-copy h1 { font-size: 37px; }
  .auth-card { padding: 28px 20px 23px; border-radius: 23px; }
  .auth-panel { min-height: 420px; }
  .panel-head h2 { font-size: 27px; }
  .field input { font-size: 16px; }
  .enroll-layout { grid-template-columns: 1fr; }
  .qr-wrap { width: 160px; margin: 0 auto; }
  .recovery-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
