/* ---- Tokens ---------------------------------------------------------- */
:root {
  --paper:   #f8fafc;   /* cool off-white, not warm cream */
  --surface: #ffffff;
  --ink:     #0f172a;   /* slate-900 */
  --muted:   #64748b;   /* slate-500 */
  --line:    #e2e8f0;   /* slate-200 */
  --accent:  #2563eb;   /* blue-600 */
  --accent-ink: #1d4ed8;/* blue-700 */

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 12px;
  --maxw: 720px;
}

/* ---- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.centered {
  justify-content: center;
  align-items: center;
  padding: 24px;
}

a { color: inherit; }

/* ---- Header / footer ------------------------------------------------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}

.nav-login {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
}
.nav-login:hover { color: var(--ink); }

.site-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-status { display: inline-flex; align-items: center; gap: 8px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

/* ---- Hero (landing) -------------------------------------------------- */
.hero {
  flex: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: lowercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: 14ch;
}

.hero-sub {
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 48ch;
}

.hero-actions { margin-top: 8px; }

.hero-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:active { transform: translateY(1px); }

.btn-block { width: 100%; }

/* ---- Login card ------------------------------------------------------ */
.card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.05);
}

.card .wordmark { margin-bottom: 12px; }
.card-title {
  margin: 0 0 18px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.field input {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: #94a3b8; }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  background: var(--surface);
}

.form-status {
  margin: 4px 0 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--muted);
}
.form-status.error { color: #dc2626; }
.form-status.ok    { color: #16a34a; }

.back-link {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  align-self: center;
}
.back-link:hover { color: var(--ink); }

/* ---- Accessibility --------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
