:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #6b7280;
  --border: #d8dce1;
  --accent: #2563eb;
  --danger: #b42318;
  --ok: #12734a;
  --notice-bg: #fff8e6;
  --notice-border: #e6c869;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --surface: #1f2229;
    --text: #e8eaed;
    --muted: #9aa1ab;
    --border: #333842;
    --accent: #6b9bff;
    --danger: #ff8a80;
    --ok: #6ee7a8;
    --notice-bg: #33290f;
    --notice-border: #6b5720;
  }
}

* {
  box-sizing: border-box;
}

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

/* --- login ------------------------------------------------------------- */

.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.card {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.card h1 {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  text-align: center;
}

.card label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.card input {
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
}

.card input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.card button {
  margin-top: 1.25rem;
  padding: 0.65rem;
  font-size: 0.95rem;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
}

.card button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.notice {
  max-width: 26rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 0.5rem;
}

/* Standalone page form (not vertically centred like the login card). */
.card--flush {
  margin: 0;
  max-width: 26rem;
}

.hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.error,
.success {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.error {
  color: var(--danger);
}

.success {
  color: var(--ok);
}

/* --- app shell --------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* .brand and .link-button are used on both <a> and <button>, so both need
   the anchor defaults neutralised. */
.brand {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.spacer {
  flex: 1;
}

.whoami {
  font-size: 0.9rem;
  color: var(--muted);
}

.link-button {
  font-size: 0.9rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

main {
  padding: 1.5rem;
}
