:root {
  color-scheme: light;
  --bg: #fcfcfa;
  --panel: #fff;
  --text: #242622;
  --muted: #65695f;
  --faint: #85897e;
  --line: #e2e4dd;
  --strong: #cdd1c6;
  --accent: #262b23;
  --accent-text: #fff;
  --error: #b42318;
  --shadow: 0 20px 70px rgb(27 34 20 / 9%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Noto Sans CJK SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #191b18;
    --panel: #252823;
    --text: #eeefe9;
    --muted: #b2b7aa;
    --faint: #8c9382;
    --line: #393d34;
    --strong: #4e5547;
    --accent: #edf0e6;
    --accent-text: #20241c;
    --error: #ff8e84;
    --shadow: 0 20px 70px rgb(0 0 0 / 24%);
  }
}
* { box-sizing: border-box; }
html, body { min-width: 280px; min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-screen { min-height: 100svh; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 32px 20px; }
.login-card { width: min(390px, 100%); border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 30px 28px 28px; box-shadow: var(--shadow); text-align: center; }
.login-logo { display: block; margin: 0 auto 15px; object-fit: contain; }
h1 { font-size: 21px; letter-spacing: -.035em; font-weight: 650; line-height: 1.3; margin: 0; }
.login-subtitle { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 8px 0 25px; }
form > label { display: block; font-size: 13px; font-weight: 550; line-height: 1.5; margin-bottom: 7px; text-align: left; }
.token-field { display: flex; position: relative; align-items: center; }
input { width: 100%; height: 46px; padding: 11px 43px 11px 13px; border: 1px solid var(--strong); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; outline: 0; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:focus { border-color: var(--muted); box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 12%, transparent); }
.visibility-button { position: absolute; right: 7px; width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.visibility-button:hover { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.visibility-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.login-error { min-height: 20px; margin: 7px 0 9px; color: var(--error); font-size: 12px; line-height: 1.6; text-align: left; overflow-wrap: anywhere; }
.login-button { min-height: 43px; width: 100%; padding: 0 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 550; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s, filter .15s; }
.login-button:hover:not(:disabled) { filter: brightness(1.12); }
.login-button:disabled { cursor: wait; opacity: .75; }
.spinner { display: none; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.login-button.loading .spinner { display: inline-block; }
.environment-label { margin: 20px 0 0; color: var(--faint); font-size: 11px; letter-spacing: .03em; }
.existing-session > p { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.logout-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; margin-top: 16px; padding: 5px 12px; border-radius: 6px; }
.logout-button:hover { color: var(--text); }
:is(button, a):focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .login-card { padding: 28px 23px 24px; border-radius: 18px; } input { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
