/* auth.css — login / auth page styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── Page centring ────────────────────────────────────────────────────────── */
.auth-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
}

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}
.auth-logo-name {
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.07em;
  color: var(--primary);
}

/* ── Heading ──────────────────────────────────────────────────────────────── */
.auth-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.auth-heading:has(+ .auth-subheading) { margin-bottom: 0.5rem; }
.auth-subheading {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}
.auth-required-mark {
  color: var(--loss);
  font-weight: 400;
}
.auth-footnote {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  text-align: center;
}
.auth-footnote-link {
  color: var(--primary);
  font-weight: 500;
}

/* ── Error banner ─────────────────────────────────────────────────────────── */
.auth-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.auth-error p {
  font-size: 0.875rem;
  color: #dc2626;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.auth-field { display: flex; flex-direction: column; gap: 0.375rem; }

.auth-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
}

.auth-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--canvas);
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: var(--ink-muted); opacity: 0.6; }
.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12,110,132,0.12);
}
.auth-input.error { border-color: #dc2626; }

.auth-field-error {
  font-size: 0.75rem;
  color: #dc2626;
}

/* ── Submit ───────────────────────────────────────────────────────────────── */
.auth-submit {
  margin-top: 0.25rem;
  width: 100%;
  height: 42px;
  background: var(--primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-submit:hover:not(:disabled) { background: var(--primary-dark); }
/* The same button as a link (Log in again on the signed-out page): the
   label centred both ways within the 42px (set with the user on 2026-10-29). */
a.auth-submit { display: flex; align-items: center; justify-content: center; box-sizing: border-box; text-decoration: none; line-height: 1; }
.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Signup / password-reset additions ─────────────────────────────────── */
.auth-banner {
  margin-bottom: 1rem;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
  border: 1px solid;
}
.auth-banner[hidden] { display: none; }
/* The hidden attribute must beat .auth-form's own display rule — without
   this, form.hidden = true after signup does nothing and the disabled
   "Creating account…" button stays on screen. */
.auth-form[hidden] { display: none; }
.auth-banner.error {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.30);
  color: #dc2626;
}
.auth-banner.success {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.30);
  color: #15803d;
}
.auth-footer {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}
.auth-footer a {
  color: var(--ink);
  font-weight: 500;
}

.auth-banner .auth-banner-action,
.auth-error .auth-banner-action {
  display: block;
  margin-top: 0.375rem;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.auth-banner .auth-banner-action:disabled,
.auth-error .auth-banner-action:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── Signup streams: account-type chooser, notices, declarations ─────────── */
.auth-choice {
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.auth-choice[hidden] { display: none; }
.auth-choice legend { margin-bottom: 0.5rem; }
.auth-choice-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--canvas);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-choice-option:hover { border-color: var(--primary); }
.auth-choice-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12,110,132,0.12);
}
.auth-choice-option input {
  margin-top: 0.2rem;
  accent-color: var(--primary);
  flex: none;
}
.auth-choice-body { display: flex; flex-direction: column; gap: 0.125rem; }
.auth-choice-title { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.auth-choice-desc  { font-size: 0.75rem; color: var(--ink-muted); line-height: 1.4; }

.auth-notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--primary-light);
  font-size: 0.8125rem;
  color: var(--ink);
  line-height: 1.5;
}
.auth-notice[hidden] { display: none; }
.auth-notice p + p, .auth-notice ol + p { margin-top: 0.625rem; }
.auth-notice ol {
  margin: 0.5rem 0 0 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.auth-notice .auth-banner-action { color: var(--primary); font-weight: 500; }

.auth-check {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  color: var(--ink);
  line-height: 1.4;
  cursor: pointer;
}
.auth-check input { margin-top: 0.15rem; accent-color: var(--primary); flex: none; }
.auth-check.error { color: #dc2626; }
.auth-field[hidden] { display: none; }
.auth-footnote .auth-banner-action {
  display: inline;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
