/* =============================================================================
   auth.css — one auth surface for /login, /signup, and password reset
   Linked on every auth page. Depends on: tokens.css, base.css,
   components.css, public.css.
   ============================================================================= */

.auth {
  padding: 2.25rem 0 4rem;
  min-height: 70vh;
}

@media (min-width: 768px) {
  .auth { padding: 4.5rem 0 7rem; }
}

.auth__inner {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* The auth surface owns the account switch, so the nav's duplicate
   login/CTA pair would only repeat it. Keep the header quiet. */
.page-login .nav__actions .nav__login,
.page-login .nav__actions .nav__cta,
.page-signup .nav__actions .nav__login,
.page-signup .nav__actions .nav__cta,
.page-forgot .nav__actions .nav__login,
.page-forgot .nav__actions .nav__cta,
.page-reset .nav__actions .nav__login,
.page-reset .nav__actions .nav__cta {
  display: none;
}

/* --- Mode switch -------------------------------------------------------- */
.auth__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  margin-bottom: 2rem;
}

.auth__switch-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.auth__switch-link:hover {
  color: var(--ink);
  background: rgba(var(--ink-rgb), 0.05);
}

.auth__switch-link.is-active {
  background: var(--ink);
  color: var(--paper);
}

.auth__switch-link.is-active:hover {
  background: var(--ink);
  color: var(--paper);
}

.auth__switch-link:focus-visible {
  outline: 2px solid var(--oxblood-text);
  outline-offset: 2px;
}

/* --- Header ------------------------------------------------------------- */
.auth__header { margin-bottom: 1.75rem; }

.auth__headline {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'WONK' 1;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.auth__sub {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 38ch;
}

/* --- Alerts and notices ------------------------------------------------- */
.auth__alert {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--ink);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.auth__alert--error {
  border-left-color: var(--oxblood-text);
  background: rgba(var(--oxblood-text-rgb), 0.06);
  color: var(--oxblood-text);
}

.auth__alert--notice {
  border-left-color: var(--success);
  background: rgba(var(--success-rgb), 0.07);
  color: var(--ink-soft);
}

/* --- Google ------------------------------------------------------------- */
.btn--social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1.25rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.btn--social:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--social:focus-visible {
  outline: 2px solid var(--oxblood-text);
  outline-offset: 2px;
}

.btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- Divider ------------------------------------------------------------ */
.auth__divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.4rem 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.auth__divider::before,
.auth__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* --- Form --------------------------------------------------------------- */
.auth__form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.auth__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.auth__label-row .field__label { margin-bottom: 0; }

.auth__label-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--oxblood-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}

.auth__label-link:hover { border-bottom-color: var(--oxblood-text); }

.auth__label-link:focus-visible {
  outline: 2px solid var(--oxblood-text);
  outline-offset: 2px;
}

.auth__submit {
  width: 100%;
  min-height: 52px;
  justify-content: center;
  margin-top: 0.4rem;
}

.auth__submit:focus-visible,
.auth__alt .link-underline:focus-visible,
.auth__consent .link-underline:focus-visible {
  outline: 2px solid var(--oxblood-text);
  outline-offset: 2px;
}

.auth .field__action:focus-visible {
  outline: 2px solid var(--oxblood-text);
  outline-offset: 2px;
}

.auth__actions { margin-top: 1.25rem; }

.auth__actions .auth__submit { margin-top: 0; }

.auth__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
  cursor: pointer;
  padding-top: 0.25rem;
}

.auth__consent input[type=checkbox] {
  margin-top: 0.2rem;
  accent-color: var(--oxblood-text);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth__consent .link-underline { color: var(--oxblood-text); }

/* --- Footer links and reset states -------------------------------------- */
.auth__alt {
  margin-top: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

.auth__alt .link-underline {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--oxblood-text);
}

.auth__hint {
  margin-top: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .auth__switch-link,
  .auth__label-link,
  .btn--social {
    transition: none;
  }
}
