:root {
  color-scheme: dark;
  --bg: #090d18;
  --panel: rgba(19, 25, 42, 0.94);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #f4f7ff;
  --muted: #9da8bd;
  --accent: #7c8cff;
  --accent-hover: #91a0ff;
  --danger: #ff8d91;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 15%, rgba(91, 74, 196, 0.27), transparent 33rem),
    radial-gradient(circle at 82% 78%, rgba(30, 119, 164, 0.18), transparent 30rem),
    var(--bg);
}

.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%);
  padding: 34px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; }
.brand-logo { width: 36px; height: 36px; border-radius: 11px; }
.login-heading { margin: 28px 0 24px; }
.login-heading h1 { margin: 0 0 8px; font-size: 27px; letter-spacing: -0.035em; }
.login-heading p, .return-label { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #cbd3e4; font-size: 13px; font-weight: 650; }
input {
  width: 100%; padding: 12px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px;
  outline: none; background: rgba(5, 9, 18, .64); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 140, 255, .17); }
button {
  margin-top: 2px; padding: 12px 15px; border: 0; border-radius: 11px;
  background: var(--accent); color: #090d18; font: inherit; font-weight: 800; cursor: pointer;
  transition: background .15s, transform .15s;
}
button:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
button:disabled { opacity: .58; cursor: wait; }
.login-error { min-height: 20px; color: var(--danger); font-size: 13px; text-align: center; }
.return-label { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--panel-border); text-align: center; }
.session-check { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.spinner {
  width: 24px; height: 24px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Account picker */
.account-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--panel-border); border-radius: 14px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.account-card:hover { background: rgba(255,255,255,.06); border-color: var(--accent); }
.account-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #6f83ff, #b9c2ff);
  color: #090d18; font-size: 20px; font-weight: 800;
}
.account-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-hint { font-size: 12px; color: var(--muted); }
.default-check {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 500;
}
.default-check input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer;
}
.link-btn {
  margin-top: 12px; padding: 0; border: 0; background: none;
  color: var(--accent); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center; width: 100%;
}
.link-btn:hover { color: var(--accent-hover); text-decoration: underline; background: none; transform: none; }

@media (max-width: 480px) {
  .login-shell { padding: 14px; }
  .login-card { padding: 27px 22px; border-radius: 19px; }
}
