:root {
  --bg: #e9edf2;
  --card: #ffffff;
  --text: #1d2430;
  --muted: #5b6576;
  --border: #ccd3dd;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --ok-bg: #e3f4e8;
  --ok-text: #1b5e33;
  --err-bg: #fbe7e7;
  --err-text: #8a1c1c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --card: #1c222b;
    --text: #e6eaf0;
    --muted: #9aa4b2;
    --border: #353e4b;
    --accent: #5b93e8;
    --accent-text: #0b1220;
    --ok-bg: #173323;
    --ok-text: #a6e3ba;
    --err-bg: #3a1c1c;
    --err-text: #f3b4b4;
  }
  /* The logo is dark artwork on transparent background. */
  .logo { background: #fff; padding: 8px 14px; border-radius: 8px; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg) url(/images/background.jpg) center / cover no-repeat fixed;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.25);
}

header { text-align: center; }
.logo { max-width: 220px; max-height: 70px; }

nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 16px 0 8px;
}
nav a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
nav a.active, nav a:hover { color: var(--text); background: var(--bg); }

h1 { font-size: 1.3rem; margin: 12px 0 16px; text-align: center; }

.alert { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); }
.alert.error { background: var(--err-bg); color: var(--err-text); }

.hint, .rules { color: var(--muted); font-size: 0.9rem; }
.rules { margin: 0 0 16px; padding-left: 20px; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: 0.92rem; font-weight: 500; }

input {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[readonly] { color: var(--muted); }

.captcha { border-radius: 6px; background: #fff; max-width: 100%; height: auto; }

button {
  margin-top: 6px;
  padding: 10px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
