/* Login page — minimal page-specific styling on top of tokens.css + components.css.
 *
 * Everything here references design tokens and reuses the .card / .input / .btn
 * / .field primitives from components.css. Brand spec: brand.md section 6.1.
 *
 * Rules:
 *   - No hard-coded colors / spacing — use tokens (the gradient start color
 *     is the one allowed literal per brand.md section 6.1).
 *   - One coherent dark theme.
 */

/* Prevent background flash: gradient on html element too. */
html.auth-page {
  background: radial-gradient(at top, var(--login-gradient-start) 0%, var(--surface-0) 60%);
  min-height: 100vh;
}

/* Page shell — centering grid + gradient backdrop. */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: radial-gradient(at top, var(--login-gradient-start) 0%, var(--surface-0) 60%);
}

/* Semantic <main> wrapper — size-constrained so the card stays at 420px. */
.login-shell {
  width: 100%;
  max-width: var(--card-max-auth);
}

/* Centered card — brand.md section 6.1. Border / radius / shadow / padding
 * also come from .card in components.css; restated here with tokens so the
 * card is self-describing and survives a missing components.css. */
.login-card {
  width: 100%;
  max-width: var(--card-max-auth);  /* = 420px */
  padding: var(--space-8);
  background: var(--surface-1);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Field-level error text — brand.md section 5.4. */
.field-error {
  color: var(--error);
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: var(--space-8);
  gap: var(--space-2);
}

/* Wordmark — single brand mark at the top of the card. */
.login-header .wordmark {
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin: 0;
}

/* Tagline — one-line product description beneath the wordmark. */
.login-header .tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}

.login-form .field:first-of-type {
  margin-top: 0;
}

/* Full-width submit row. */
.field-actions {
  margin-top: var(--space-6);
}

/* Small viewport tightening — brand.md section 6.1 mobile padding. */
@media (max-width: 640px) {
  .login-card { padding: var(--space-6); }
  .login-page { padding: var(--space-4); }
  .login-header { margin-bottom: var(--space-6); }
}

/* Honor prefers-reduced-motion for the spinner. (.spinner core in components.css.) */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
