:root {
  --bg: #0f1720;
  --card: #16212e;
  --fg: #e6edf3;
  --muted: #8b98a5;
  --accent: #2f81f7;
  --error: #f85149;
  --border: #2a3744;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  width: 100%;
  max-width: 520px;
  margin: 3rem 1rem;
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

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

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

a { color: var(--accent); }
a:hover { text-decoration: underline; }

form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }

label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.95rem; }

label.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }

input[type="text"],
input[type="password"],
input[type="file"] {
  padding: 0.6rem 0.7rem;
  background: #0d1520;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 0.95rem;
}

input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

button {
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

button:hover { filter: brightness(1.1); }

button.link {
  background: none;
  color: var(--muted);
  padding: 0;
  font-size: 0.95rem;
}

button.link:hover { color: var(--fg); filter: none; }

.error {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid var(--error);
  border-radius: 8px;
  color: var(--error);
}

code {
  background: #0d1520;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1.5rem;
  background: rgba(15, 23, 32, 0.88);
  backdrop-filter: blur(2px);
}

.overlay[hidden] { display: none; }

.overlay p { max-width: 340px; text-align: center; color: var(--fg); }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
