/* ── Reset & base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ── Page shell ─────────────────────────────────── */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    var(--auth-radial),
    var(--bg-primary);
}

/* ── Nav ────────────────────────────────────────── */
.auth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  border-bottom: 1px solid var(--border);
}
.auth-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.auth-nav__logo { width: 26px; height: 26px; }
.auth-nav__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.auth-nav__hint {
  font-size: 0.875rem;
  color: var(--text-dim);
}
.auth-nav__link {
  color: var(--accent-light);
  font-weight: 600;
  margin-left: 0.3rem;
  transition: color 120ms;
}
.auth-nav__link:hover { color: var(--accent-lighter); }

/* ── Main area ──────────────────────────────────── */
.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
}

/* ── Auth card ──────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.auth-card__sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-dim);
}

/* ── Error alert ────────────────────────────────── */
.auth-alert {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--error-text);
}
.auth-alert p { margin: 0; }
.auth-alert p + p { margin-top: 0.25rem; }

/* ── Form ───────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 9px;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--text-ghost); }
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.form-input--error {
  border-color: var(--error-border);
}
.form-input--error:focus {
  border-color: var(--error-text);
  box-shadow: 0 0 0 3px var(--error-bg);
}

.btn-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: background 140ms, transform 120ms, box-shadow 140ms;
}
.btn-submit:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-submit:active {
  transform: translateY(0);
}

/* ── Legal note ─────────────────────────────────── */
.auth-card__legal {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-ghost);
  line-height: 1.6;
}
.auth-card__legal a {
  color: var(--text-faint);
  text-decoration: underline;
  text-decoration-color: var(--text-ghost);
  transition: color 120ms;
}
.auth-card__legal a:hover { color: var(--text-dim); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 480px) {
  .auth-form { padding: 1.5rem; }
  .auth-card__title { font-size: 1.5rem; }
}
