/* ── FONTS — General Sans self-hosted from ../fonts/general-sans/.
   Same reasoning as css/profile.css: the Fontshare CDN API has been
   unreliable, so self-hosting removes that single point of failure. ── */
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans/GeneralSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans/GeneralSans-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: oklch(52% 0.15 158);
  --green-hover: oklch(46% 0.15 158);
  --green-pale: oklch(94% 0.03 158);
  --bg: oklch(0.989 0 0);
  --surface: oklch(100% 0 0);
  --ink: oklch(21% 0.02 158);
  --ink-muted: oklch(42% 0.02 158);
  --border: oklch(90% 0.01 158);
  --danger: oklch(55% 0.19 25);
  --danger-pale: oklch(96% 0.03 25);
  --danger-text: oklch(42% 0.17 25);
  --success: oklch(54% 0.14 152);
  /* 56% L (not the original 62%) is the darkest step at this hue/chroma that
     still reads as a warm amber rather than brown - needed to clear 4.5:1
     against white for the "Fair" strength-meter label (signup.js and
     reset-password.js both read this token live). */
  --warn: oklch(56% 0.15 70);
  --radius-btn: 10px;
  --radius-card: 18px;
  --font-display: 'MuseoModerno', sans-serif;   /* wordmark only */
  --font-heading: 'General Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow-card: 0 16px 40px oklch(52% 0.15 158 / 0.08);
}

/* Light-mode only, deliberately - see mockups/auth-showcase.html. This is a
   fast, transactional, get-in-get-out flow for business owners, not a
   browsing surface; a theme toggle would be one more decision competing
   with the form for attention. Do not add one without revisiting that
   reasoning. */

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

/* Visually hidden but still announced by screen readers - used for the
   loading-state live region next to each submit button, since sighted
   users get the spinner but that state was previously silent for AT. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  /* A whisper of depth instead of a flat fill - true neutral (chroma 0),
     never brand-green, per the No-Cream/No-green-background rules already
     locked in for section backgrounds elsewhere in this project. */
  background-image: radial-gradient(ellipse 900px 600px at 50% 0%, oklch(100% 0 0), var(--bg));
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; }

/* ---------- page shell ---------- */
.auth-page {
  /* Lives inside the body's own flex column (min-height: 100dvh) instead of
     forcing its own full-viewport height - that used to push .legal-footer,
     a plain sibling after </main>, a full extra viewport-height down below
     any normal-length card. flex: 1 lets it fill the remaining space and
     center the card within it, with the footer sitting directly after. */
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 32px;
  gap: 32px;
}

.auth-brand { text-align: center; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--green);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 40px;
}
@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; border-radius: 16px; }
}

.auth-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.auth-sub {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin-top: 6px;
}

.auth-form { display: flex; flex-direction: column; gap: 18px; margin-top: 26px; }

.form-field { display: flex; flex-direction: column; }
.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-input-wrap { position: relative; }
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 46px;
  -webkit-appearance: none;
}
/* oklch(56% 0.02 158) measures 4.6:1 against the card background, just
   over the 4.5:1 WCAG AA floor for body text - placeholders are real,
   load-bearing copy on this page, not decoration. */
.form-input::placeholder { color: oklch(56% 0.02 158); }
.form-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-pale); }
.form-input[type="password"] { padding-right: 48px; }
.form-field.has-error .form-input { border-color: var(--danger); }
.form-field.has-error .form-input:focus { box-shadow: 0 0 0 3px var(--danger-pale); }

.pw-toggle {
  /* 44x44 touch target (top/bottom insets of 1px against the 46px-tall
     input) - was 38x38, under this project's own stated minimum. */
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pw-toggle:hover { background: oklch(96% 0.012 158); color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.pw-toggle svg { width: 19px; height: 19px; }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle.is-visible .icon-eye { display: none; }
.pw-toggle.is-visible .icon-eye-off { display: block; }

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--danger-text);
  margin-top: 6px;
  line-height: 1.4;
}
.field-error svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.field-error[hidden] { display: none; }

.form-hint { font-size: 0.8125rem; color: var(--ink-muted); margin-top: 6px; }

.field-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.auth-link { font-size: 0.8125rem; color: var(--green); text-decoration: none; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

/* Resets a <button> to look and behave like .auth-link, for actions that
   aren't real navigation (e.g. resend) and so shouldn't be an <a>. */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { cursor: default; opacity: 0.7; text-decoration: none; }
.link-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px; }

/* ---------- password strength meter ---------- */
.strength-wrap { margin-top: 9px; }
.strength-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.strength-bar { height: 100%; border-radius: 2px; width: 100%; transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease, background-color 0.2s ease; }
.strength-label { font-size: 0.75rem; color: var(--ink-muted); margin-top: 5px; min-height: 1em; transition: color 0.2s ease; }

/* ---------- checkbox ---------- */
/* padding + matching negative margin grows the real clickable label (the
   whole row toggles the checkbox) to a 44px-tall tap target without
   shifting the visible layout - was ~20px, a discrete control rather than
   the inline text links elsewhere, so it doesn't get their WCAG exception. */
.agree-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 13px 0; margin: -13px 0; }
.agree-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--green);
  cursor: pointer;
}
.agree-row span { font-size: 0.8125rem; color: var(--ink-muted); line-height: 1.5; }
.agree-row .auth-link { text-decoration: underline; }

/* ---------- form-level alert banner ---------- */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--danger-pale);
  border: 1px solid oklch(85% 0.06 25);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.8438rem;
  color: var(--danger-text);
  line-height: 1.45;
}
.form-alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.form-alert[hidden] { display: none; }
/* Both are programmatically focused on failure/success (tabindex="-1" in
   the markup) so screen readers land on them - needs a real focus ring,
   not the default browser outline. */
.form-alert:focus,
#success-heading:focus { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* ---------- submit button ---------- */
.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  background: var(--green);
  color: var(--surface);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0 20px;
  min-height: 46px;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.auth-submit:hover { background: var(--green-hover); }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.auth-submit:disabled { cursor: default; opacity: 0.85; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid oklch(100% 0 0 / 0.35);
  border-top-color: oklch(100% 0 0);
  animation: spin 0.7s linear infinite;
  display: none;
}
.auth-submit.is-loading .btn-spinner { display: inline-block; }
.auth-submit.is-loading .btn-label { opacity: 0.92; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-footer { font-size: 0.875rem; color: var(--ink-muted); text-align: center; margin-top: 22px; }
.auth-footer .auth-link { font-size: inherit; }

/* ---------- divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  color: var(--ink-muted);
  font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Google button ---------- */
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0 20px;
  min-height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  cursor: pointer;
  margin-top: 18px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.google-btn:hover { background: oklch(97% 0.008 158); border-color: oklch(80% 0.01 158); }
.google-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.google-btn:disabled { cursor: default; opacity: 0.7; }
.google-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- success state (signup) ---------- */
.success-panel { text-align: center; }
.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.success-icon svg { width: 26px; height: 26px; }

/* ---------- legal footer ---------- */
.legal-footer {
  padding: 20px 16px;
  text-align: center;
}
.legal-footer nav { display: inline-flex; gap: 24px; }
.legal-footer a { font-size: 0.8125rem; color: var(--ink-muted); text-decoration: none; }
.legal-footer a:hover { color: var(--green); }
