:root {
  color-scheme: dark;
  --bg: #070b0f;
  --panel: #0d1824;
  --text: #f1f6fa;
  --secondary: #b3c0cc;
  --muted: #8496a8;
  --cyan: #00c8f8;
  --blue: #0877e8;
  --red: #ff4f72;
  --line: rgba(132,150,168,.14);
  --line-strong: rgba(132,150,168,.28);
  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;
  background:
    radial-gradient(ellipse at 50% 32%, rgba(0,200,248,.07), transparent 42%),
    linear-gradient(180deg, #05090d, var(--bg));
  color: var(--text);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .26;
  background-image:
    linear-gradient(rgba(132,150,168,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132,150,168,.045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}
.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 28px;
  width: min(100% - 32px, 470px);
  margin: 0 auto;
  padding: max(36px, env(safe-area-inset-top)) 0 max(36px, env(safe-area-inset-bottom));
}
.auth-brand { display: block; width: 238px; margin: 0 auto; }
.auth-brand img { display: block; width: 100%; height: auto; }
.auth-card {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(13,24,36,.97), rgba(7,11,15,.98));
  box-shadow: 0 28px 90px rgba(0,0,0,.42), 0 0 35px rgba(0,200,248,.025);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,200,248,.8), transparent);
}
.auth-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #90bff9;
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-kicker span { width: 6px; height: 6px; border-radius: 50%; background: #29e39a; box-shadow: 0 0 12px rgba(41,227,154,.55); }
h1 { margin: 17px 0 8px; font-size: clamp(32px, 8vw, 46px); line-height: 1; letter-spacing: -.045em; }
.auth-intro { margin: 0 0 27px; color: var(--secondary); font-size: 15px; line-height: 1.55; }
form { display: grid; gap: 9px; }
form[hidden] { display: none; }
label { margin-top: 8px; color: var(--muted); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  background: rgba(241,246,250,.035);
  color: var(--text);
  font: 500 16px/1 inherit;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:hover { background: rgba(241,246,250,.05); }
input:focus { border-color: rgba(0,200,248,.7); box-shadow: 0 0 0 3px rgba(0,200,248,.1); }
.password-input-wrap { position: relative; display: block; min-width: 0; }
.password-input-wrap input { padding-right: 50px; }
.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-visibility-toggle:hover { background: rgba(0,200,248,.055); color: var(--cyan); }
.password-visibility-toggle:focus-visible { outline: 1px solid rgba(0,200,248,.7); outline-offset: -2px; }
.password-visibility-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.password-visibility-toggle .password-eye-closed { display: none; }
.password-visibility-toggle[aria-pressed="true"] .password-eye-open { display: none; }
.password-visibility-toggle[aria-pressed="true"] .password-eye-closed { display: block; }
.auth-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  margin-top: 16px;
  padding: 0 17px;
  border: 1px solid rgba(0,200,248,.58);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(0,200,248,.16), rgba(8,119,232,.16));
  color: var(--text);
  cursor: pointer;
  font: 800 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-submit:hover { background: linear-gradient(135deg, rgba(0,200,248,.23), rgba(8,119,232,.21)); }
.auth-submit:disabled { cursor: wait; opacity: .62; }
.auth-text-button { justify-self: center; margin-top: 5px; padding: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 12px/1.2 inherit; text-decoration: underline; text-underline-offset: 3px; }
.auth-text-button:hover { color: var(--cyan); }
form small { margin: -2px 0 2px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.auth-status { margin: 0 0 18px; padding: 12px 13px; border-left: 2px solid var(--cyan); background: rgba(0,200,248,.07); color: var(--secondary); font-size: 13px; line-height: 1.45; }
.auth-status.error { border-color: var(--red); background: rgba(255,79,114,.07); color: #ffc1ce; }
.auth-status.success { border-color: #29e39a; background: rgba(41,227,154,.07); }
.auth-foot { margin: 25px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
a { color: var(--cyan); text-underline-offset: 3px; }
@media (max-width: 520px) {
  .auth-shell { gap: 22px; width: min(100% - 24px, 470px); }
  .auth-brand { width: 205px; }
  .auth-card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
