:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #5b6475;
  --border: #c9ced8;
  --accent: #2456d6;
  --error-bg: #fdecec;
  --error-text: #9b1c1c;
  --ok-bg: #e7f6ec;
  --ok-text: #17603a;
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d;
    --card: #1e232c;
    --text: #e7eaf0;
    --muted: #a2aaba;
    --border: #3a4250;
    --accent: #6f95ff;
    --error-bg: #3a1d1f;
    --error-text: #ffb4b4;
    --ok-bg: #173323;
    --ok-text: #a6e9bf;
  }
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
}

.auth-card {
  width: min(100% - 2rem, 24rem);
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
}

.auth-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 0.4rem;
}

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

input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

button {
  margin-top: 1rem;
  padding: 0.7rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled,
input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-message {
  margin: 0.8rem 0 0;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 0.9rem;
  line-height: 1.4;
}

.auth-message[data-kind="success"] {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.auth-link,
.auth-nav {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}

.auth-nav {
  margin-top: 1.2rem;
  text-align: center;
}

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