@font-face {
  font-family: "DM Sans";
  font-style: normal; font-weight: 400;
  src: url("/fonts/dm-sans-400.ttf") format("truetype");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal; font-weight: 600;
  src: url("/fonts/dm-sans-600.ttf") format("truetype");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal; font-weight: 700;
  src: url("/fonts/dm-sans-700.ttf") format("truetype");
}

/* ── Light theme (default) ── */
:root {
  --bg: #faf9f5;
  --surface: #f0eee6;
  --surface-hover: #e8e6dc;
  --text: #141413;
  --text-secondary: #3d3d3a;
  --text-muted: #5e5d59;
  --accent: #d97757;
  --accent-hover: #c6613f;
  --accent-soft: rgba(217, 119, 87, 0.15);
  --danger: #c24a4a;
  --danger-soft: rgba(194, 74, 74, 0.12);
  --border: rgba(20, 20, 19, 0.10);
  --border-light: rgba(20, 20, 19, 0.06);
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 20, 19, 0.08);
  --pre-bg: #141413;
  --pre-text: #faf9f5;
  color-scheme: light;
}

/* ── Dark theme ── */
[data-theme="dark"] {
  --bg: #13131a;
  --surface: #1a1a24;
  --surface-hover: #28283a;
  --text: #ede8de;
  --text-secondary: #a09b90;
  --text-muted: #6b6660;
  --accent: #d97757;
  --accent-hover: #c6613f;
  --accent-soft: rgba(217, 119, 87, 0.18);
  --danger: #c24a4a;
  --danger-soft: rgba(194, 74, 74, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --pre-bg: #0a0a10;
  --pre-text: #c8c0b8;
  color-scheme: dark;
}

/* ── Auth pages ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; font-size: inherit; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-family: "DM Sans", -apple-system, "Segoe UI", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.auth-card .subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-card form {
  display: grid;
  gap: 1rem;
}

.auth-card label {
  display: grid;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 0.5rem 0.6rem;
  transition: border-color 0.18s ease;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--border);
}

.auth-card input::placeholder { color: var(--text-muted); }

.auth-card button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.18s ease;
  margin-top: 0.25rem;
}

.auth-card button:hover {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
}

.auth-card .error {
  color: var(--danger);
  font-size: 12px;
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: var(--danger-soft);
  border-radius: 6px;
  display: none;
}

.auth-card .error.visible {
  display: block;
}

.auth-card .footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-card .footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-card .footer a:hover {
  color: var(--accent-hover);
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: "DM Sans", -apple-system, "Segoe UI", sans-serif;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}
