:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1b1d22;
  --muted: #5c6270;
  --border: #d9dce3;
  --accent: #4b5fd6;
  --accent-text: #ffffff;
  --danger-bg: #fdecec;
  --danger-text: #8a1c1c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --surface: #1c1e24;
    --text: #e8e9ed;
    --muted: #9ba1ae;
    --border: #2e313a;
    --accent: #7586f0;
    --accent-text: #0d0f14;
    --danger-bg: #3a1a1c;
    --danger-text: #f3b4b4;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2 { margin: 0 0 .25rem; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); margin: 0 0 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.auth .card { width: 100%; max-width: 380px; display: flex; flex-direction: column; }

label { font-size: .9rem; font-weight: 600; margin: .75rem 0 .25rem; }

input[type="text"], input[type="password"] {
  font: inherit;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button {
  font: inherit;
  font-weight: 600;
  margin-top: 1.25rem;
  padding: .65rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button.secondary {
  margin: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.alert {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 8px;
  padding: .6rem .75rem;
  margin: 0 0 .5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.panel {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

a { color: var(--accent); }
