/* =========================================================
   KitTheme: sign-in, sign-up, reset password and account pages
   ---------------------------------------------------------
   kittheme/DESIGN.md: one centered card on the canvas, Inter, flat
   buttons, the logo's violet only on the primary button, links and
   focus. profile.css and profile-edit.css build on these tokens.
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface-1: #111113;
  --surface-2: #17171a;
  --surface-3: #1d1d21;
  --surface-4: #242428;
  --hairline: #232327;
  --hairline-strong: #313136;
  --hairline-hover: #43434a;
  --ink: #f7f8f8;
  --ink-muted: #c8cad0;
  --muted: #8b8e96;
  --primary: #6a52d9;
  --primary-hover: #755fe3;
  --primary-pressed: #5f48c9;
  --accent: #9d8bf7;
  --danger-text: #f0a0a0;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header and footer ---------- */
.auth-header, .auth-footer { max-width: 1200px; margin: auto; padding: 22px clamp(20px, 4vw, 40px); display: flex; justify-content: space-between; align-items: center; }
.auth-header img { display: block; width: 116px; height: auto; }
.back-link { font-size: 14px; color: var(--muted); text-decoration: none; transition: color .14s ease; }
.back-link:hover { color: var(--ink); }
.back-link span { margin-left: 6px; }
.auth-footer { padding-top: 8px; padding-bottom: 28px; font-size: 13px; color: var(--muted); }
.auth-footer nav { display: flex; gap: 20px; }
.auth-footer a { text-decoration: none; transition: color .14s ease; }
.auth-footer a:hover { color: var(--ink); }

/* ---------- the card ---------- */
.auth-layout { width: calc(100% - 40px); max-width: 420px; margin: clamp(24px, 8vh, 88px) auto 48px; }
.auth-panel { padding: 32px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--surface-1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.auth-card { width: 100%; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
h1 { margin: 0; font-size: clamp(30px, 3vw, 40px); line-height: 1.1; letter-spacing: -.03em; font-weight: 600; }
h2 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; letter-spacing: -.022em; font-weight: 600; }
.auth-card > .eyebrow { margin-bottom: 8px; }
.muted { margin: 0 0 24px; font-size: 14px; color: var(--muted); }

/* ---------- form ---------- */
form { display: grid; gap: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.field input {
  width: 100%; min-height: 40px; padding: 9px 12px;
  border: 1px solid var(--hairline-strong); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: 14px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.field input:hover { border-color: var(--hairline-hover); }
.field input::placeholder { color: #6f727a; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(157, 139, 247, .18); }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.reveal { position: absolute; right: 4px; top: 4px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.reveal:hover { color: var(--ink); background: var(--surface-2); }
.hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* buttons: .submit is the primary action, .secondary the neutral one */
.submit {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--primary); border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease;
}
.submit:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.submit:active { background: var(--primary-pressed); border-color: var(--primary-pressed); transform: translateY(1px); }
.secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--hairline-strong); border-radius: 8px;
  background: var(--surface-1); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease;
}
.secondary:hover { background: var(--surface-2); border-color: var(--hairline-hover); }
.secondary:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: wait; }
.switch { margin: 20px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.switch a, .forgot { color: var(--accent); }
.forgot { justify-self: end; font-size: 13px; }
.terms { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.terms a { color: var(--ink-muted); }
#authStatus { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--danger-text); overflow-wrap: anywhere; }
#authStatus:empty { display: none; }
#authStatus.above { margin: 0 0 18px; }
.local-note { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: 12px; color: var(--muted); }
.account-email { overflow-wrap: anywhere; }
.account-actions { display: grid; gap: 10px; }
.account-actions a { text-align: center; text-decoration: none; }

/* Continue with Google */
.google-choice { margin-bottom: 4px; }
.google-button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--hairline-strong); border-radius: 8px;
  background: var(--surface-1); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: border-color .14s ease, background-color .14s ease;
}
.google-button:hover { border-color: var(--hairline-hover); background: var(--surface-2); }
.google-button svg { flex: none; }
.google-button[aria-disabled="true"] { opacity: .7; pointer-events: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 12px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

@media (max-width: 520px) {
  .auth-layout { width: calc(100% - 32px); margin-top: 16px; }
  .auth-panel { padding: 24px 20px; }
  .auth-header { padding: 18px 20px; }
  .auth-footer { padding: 0 20px 24px; flex-wrap: wrap; gap: 10px; }
  h2 { font-size: 24px; }
  .back-link { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .submit, .secondary, .google-button, .field input { transition: none; }
  .submit:active, .secondary:active { transform: none; }
}
