:root {
  --bg:      #0f0f0f;
  --bg1:     #141414;
  --bg2:     #1a1a1a;
  --bg3:     #202020;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --t1:      #e8e8e8;
  --t2:      #8b8b8b;
  --t3:      #525252;
  --accent:  #8b5cf6;
  --ok:      #22c55e;
  --warn:    #f59e0b;
  --err:     #ef4444;
  --r:       6px;
}

html.light-theme {
  --bg:      #f8fafc;
  --bg1:     #ffffff;
  --bg2:     #f1f5f9;
  --bg3:     #e2e8f0;
  --border:  rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.14);
  --t1:      #0f172a;
  --t2:      #475569;
  --t3:      #94a3b8;
  --accent:  #7c3aed;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg); color: var(--t1);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}

#login-screen {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
}
.login-card {
  width: 340px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.login-mark {
  width: 28px; height: 28px;
  background: var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: white; font-weight: 600;
}
.login-title { font-weight: 600; font-size: 14px; }
.login-sub   { font-size: 11px; color: var(--t3); margin-top: 2px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; color: var(--t3); margin-bottom: 5px; }
.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 11px;
  color: var(--t1); font-size: 13px;
  font-family: inherit; outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }
.login-btn {
  width: 100%; padding: 9px;
  background: var(--accent); color: white;
  border: none; border-radius: var(--r);
  font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: opacity .15s;
  margin-top: 4px;
}
.login-btn:hover { opacity: .85; }
.login-err { font-size: 11px; color: var(--err); margin-top: 10px; text-align: center; min-height: 16px; }

.spinner {
  width: 14px; height: 14px;
  border: 1.5px solid var(--bg3); border-top-color: white;
  border-radius: 50%; animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
