.auth-shell {
  min-height: 100vh;
}

.auth-header,
.auth-main {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--page-padding));
  margin-inline: auto;
  padding-inline: var(--page-padding);
}

.auth-header {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
}

.auth-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-7) var(--grid-gap);
  padding-block: var(--space-8);
}

.auth-main > .page-title,
.auth-note {
  grid-column: 1 / -1;
}

.auth-panel {
  grid-column: 1;
}

.auth-form {
  display: grid;
  gap: var(--space-4);
}

.auth-status {
  min-height: var(--space-5);
  margin: 0;
}

.auth-status[data-state="error"] {
  color: var(--danger);
}

.auth-note {
  margin: 0;
  font-size: var(--text-small);
}

@media (max-width: 40rem) {
  .auth-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-panel {
    grid-column: 1;
  }
}

/* -- public signup ---------------------------------------------------------
 *
 * The panel now holds four flows. Only one is ever visible, and the two that
 * swap live (sign in / create an account) share a box sized to the taller of
 * them, so choosing a mode never moves the button the rider is reaching for. */

.auth-swap {
  display: grid;
}

.auth-swap-pane {
  grid-area: 1 / 1;
  /* visibility, not display: the container keeps the taller pane's height,
   * and a hidden pane still leaves the tab order and the a11y tree. */
  visibility: hidden;
}

.auth-swap-pane.is-active {
  visibility: visible;
}

.auth-consent {
  display: grid;
  gap: var(--space-3);
}

.auth-consent .checkbox {
  align-items: start;
}

.auth-consent .checkbox span {
  font-size: var(--text-small);
  color: var(--text-secondary);
}

.auth-consent a {
  color: var(--text-secondary);
  text-underline-offset: 0.2em;
}

.auth-consent a:hover,
.auth-consent a:focus-visible {
  color: var(--accent);
}

.auth-consent-version {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-meta);
}

/* Cloudflare renders the widget in an iframe at its own size. Reserving the
 * height keeps the submit button still while it loads. */
.auth-turnstile {
  min-height: 4.15rem;
}

.auth-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-small);
}

.auth-legal a {
  color: var(--muted);
}

.auth-legal a:hover,
.auth-legal a:focus-visible {
  color: var(--accent);
}
