body.auth-page {
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 42%, #0c1813 100%);
}

.auth-page .lb-nav {
  background: transparent;
  border-bottom-color: rgba(232, 213, 163, 0.1);
}

.auth-wrap {
  display: grid;
  place-items: start center;
  padding: 2.4rem var(--space) 4rem;
}

.auth-card {
  width: min(26.5rem, 100%);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgba(232, 213, 163, 0.4);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  padding: 1.5rem 1.35rem 1.6rem;
}

.auth-card.is-prefs {
  width: min(36rem, 100%);
}

.auth-card h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.auth-lede {
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

.auth-forgot {
  margin: -0.35rem 0 0.85rem;
}

.auth-link {
  border: 0;
  background: transparent;
  color: var(--forest);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  padding: 0;
}

#auth-email.is-locked,
#auth-email[readonly] {
  background: color-mix(in srgb, var(--paper) 80%, var(--ink) 6%);
  color: var(--ink-soft);
  cursor: default;
  pointer-events: none;
}

.auth-field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.auth-field input {
  width: 100%;
  min-height: var(--tap);
  padding: 0.45rem 0.7rem;
  background: var(--cream);
  border: 1px solid var(--line);
}

.auth-field input:focus {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}

.auth-rules {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.auth-rules li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-rules input[type="checkbox"] {
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
  background: var(--cream);
  pointer-events: none;
}

.auth-rules li.is-met {
  color: var(--forest);
}

.auth-rules li.is-met input[type="checkbox"] {
  border-color: var(--forest);
  background: var(--forest);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23f7f1e6' stroke-width='2' d='M2 6.2l2.6 2.6L10 3.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.75rem;
}

.auth-card .btn-solid:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-error {
  color: var(--brick);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.auth-card .btn-solid {
  width: 100%;
  justify-content: center;
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
  min-height: var(--tap);
}

.auth-switch {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.auth-switch button {
  color: var(--brick);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.auth-legal {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.auth-legal a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.auth-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.7rem;
  margin: 1.15rem 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.auth-or::before,
.auth-or::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-card .btn-google {
  width: 100%;
  justify-content: center;
  min-height: var(--tap);
}

.auth-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: min(22rem, calc(100vw - 2rem));
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 1.3rem 1.2rem 1.2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.auth-modal::backdrop {
  background: rgba(19, 37, 30, 0.55);
}

.auth-modal h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0.2rem 0 0.45rem;
}

.auth-modal p {
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.auth-modal .btn-solid {
  width: 100%;
  background: var(--forest);
  color: var(--cream);
  border-color: var(--forest);
}

.auth-prefs {
  display: grid;
  gap: 1rem;
}

.auth-prefs-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: -0.25rem 0 0;
}

.auth-chip-set {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.auth-chip-set legend {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.15rem;
}

.auth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.auth-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.auth-chip.is-on {
  background: color-mix(in srgb, var(--forest) 14%, var(--cream));
  border-color: color-mix(in srgb, var(--forest) 40%, var(--line));
  color: var(--forest-deep);
  font-weight: 500;
}

.auth-prefs-actions {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.auth-prefs-actions .btn-quiet {
  width: 100%;
  justify-content: center;
  min-height: var(--tap);
}

/* mobile layout pass */
@media (max-width: 39.99rem) {
  .auth-wrap {
    padding: 1.25rem var(--space) 2.5rem;
    padding-top: max(1.25rem, env(safe-area-inset-top));
  }

  .auth-card {
    padding: 1.25rem 1.05rem 1.35rem;
  }

  .auth-card h1 {
    font-size: clamp(1.65rem, 8vw, 2rem);
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-actions .btn-solid,
  .auth-actions .btn-quiet {
    width: 100%;
    text-align: center;
  }
}
