:root {
  color-scheme: dark;
  --bg: #080b10;
  --surface: #0d121a;
  --surface-2: #131a25;
  --surface-3: #1a2330;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f6f7fb;
  --muted: #929db0;
  --subtle: #697589;
  --input-bg: #111822;
  --shadow: 0 22px 55px rgba(0, 0, 0, .26);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef1f6;
  --line: rgba(27, 35, 53, .09);
  --line-strong: rgba(27, 35, 53, .17);
  --text: #161b27;
  --muted: #667085;
  --subtle: #9299a8;
  --input-bg: #f7f8fb;
  --shadow: 0 18px 45px rgba(25, 35, 55, .10);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "DM Sans", system-ui, sans-serif; }
body.auth-check { visibility: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }

.login-screen { position: relative; min-height: 100vh; overflow: hidden; background: var(--surface); }
.login-screen::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 52px 52px; mask-image: radial-gradient(circle at center, black, transparent 70%); }
.login-ambient { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; filter: blur(70px); }
.login-ambient-one { width: min(38vw, 520px); aspect-ratio: 1; left: -15%; top: -24%; background: rgba(197, 23, 38, .12); }
.login-ambient-two { width: min(42vw, 580px); aspect-ratio: 1; right: -20%; bottom: -30%; background: rgba(41, 92, 220, .10); }

.login-panel { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 72px 32px 48px; background: transparent; }
.login-card { width: min(100%, 430px); }
.login-brand { width: 190px; height: 80px; display: grid; place-items: center; margin: 0 auto 42px; overflow: hidden; }
.login-brand img { width: 100%; height: 100%; display: block; object-fit: contain; filter: grayscale(1) contrast(100) invert(1); mix-blend-mode: screen; }
html[data-theme="light"] .login-brand img { filter: grayscale(1) contrast(100); mix-blend-mode: multiply; }
.login-heading { margin-bottom: 37px; text-align: center; }
.login-welcome { color: #e02b3a; font: 800 10px "Manrope", sans-serif; letter-spacing: .18em; }
.login-heading h2 { margin: 10px 0 8px; color: var(--text); font: 800 clamp(27px, 2.5vw, 36px)/1.2 "Manrope", sans-serif; letter-spacing: -.04em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.login-field { display: block; margin-bottom: 20px; }
.login-field > span { display: block; margin: 0 0 8px 2px; color: var(--text); font-size: 11px; font-weight: 700; }
.login-input-wrap { height: 52px; display: flex; align-items: center; gap: 11px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--input-bg); transition: border-color .16s, box-shadow .16s, transform .16s; }
.login-input-wrap:focus-within { border-color: rgba(216,42,56,.65); box-shadow: 0 0 0 4px rgba(216,42,56,.09); transform: translateY(-1px); }
.login-input-wrap > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.login-input-wrap input::placeholder { color: var(--subtle); }
.password-toggle { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--surface-3); color: var(--text); }
.password-toggle svg { grid-area: 1 / 1; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-closed { display: none; }
.password-toggle.visible .eye-open { display: none; }
.password-toggle.visible .eye-closed { display: block; }
.login-options { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 22px; }
.remember-option { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; cursor: pointer; user-select: none; }
.remember-option input { position: absolute; opacity: 0; pointer-events: none; }
.remember-option span { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--input-bg); }
.remember-option input:checked + span { border-color: #d82a38; background: #d82a38; }
.remember-option input:checked + span::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border: solid white; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.remember-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(216,42,56,.14); }
.login-error { display: flex; align-items: center; gap: 10px; margin: -7px 0 16px; padding: 10px 12px; border: 1px solid rgba(216,42,56,.22); border-radius: 10px; background: rgba(216,42,56,.075); color: #e33b49; font-size: 11px; }
.login-error[hidden] { display: none; }
.login-error span { width: 19px; height: 19px; display: grid; place-items: center; flex: none; border-radius: 50%; background: rgba(216,42,56,.13); font-weight: 800; }
.login-error p { margin: 0; }
.login-submit { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #e22b3b, #bd1023); box-shadow: 0 13px 30px rgba(190,15,34,.24); color: white; font-weight: 800; transition: transform .16s, box-shadow .16s, filter .16s; }
.login-submit:hover { transform: translateY(-2px); box-shadow: 0 17px 36px rgba(190,15,34,.3); filter: brightness(1.06); }
.login-submit:active { transform: translateY(0); }
.login-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s; }
.login-submit:hover svg { transform: translateX(3px); }
.login-submit.is-loading { pointer-events: none; opacity: .78; }
.login-submit.is-loading svg { animation: slide-pulse .7s ease-in-out infinite alternate; }
.login-support { margin: 29px 0 0; color: var(--subtle); text-align: center; font-size: 10.5px; }
.login-support a { color: var(--muted); font-weight: 700; text-decoration: none; }
.login-support a:hover { color: #d82a38; }

.theme-toggle { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); transition: .16s ease; }
.theme-toggle:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.theme-toggle svg { grid-area: 1 / 1; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.login-theme-toggle { position: absolute; right: 28px; top: 26px; }

@keyframes slide-pulse { to { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 480px) {
  .login-panel { align-items: start; padding: 72px 20px 32px; }
  .login-brand { width: 164px; height: 69px; margin-bottom: 34px; }
  .login-heading { margin-bottom: 29px; }
  .login-heading h2 { font-size: 28px; }
  .login-theme-toggle { right: 18px; top: 18px; }
  .login-field { margin-bottom: 17px; }
  .login-input-wrap, .login-submit { height: 50px; }
}
