/* Auth pages: one measured, centered family ------------------------------- */

.auth-page {
  --nav-height: 0px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
}

.auth-page .app-header {
  flex: 0 0 auto;
  background: var(--brand-bar);
  border-bottom-color: var(--accent);
}

.auth-page .app-main {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - var(--nav-height, 0px));
  height: calc(100dvh - var(--nav-height, 0px));
  padding: 0;
}

.auth-page .btn--nav {
  border-radius: 999px;
}

.auth-page .btn--nav:hover {
  background: var(--accent-strong);
}

.auth-shell {
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.4vh, 24px) clamp(16px, 4vw, 32px);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0;
  padding: 2rem;
  overflow: visible;
  background: var(--surface-raised);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  box-shadow: 0 10px 30px var(--shadow);
}

/* The old shared-card flourish is replaced by the explicit strip element. */
.auth-page .auth-card::before {
  content: none;
}

.auth-card__accent {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
}

.auth-card__head {
  min-width: 0;
}

.auth-card__eyebrow {
  margin: 2px 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card__title {
  margin: 0;
  color: var(--brand);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.auth-card__sub {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.45;
}

.auth-card__messages {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

/* The reset-link confirmation is page text, not a notification, so it stays
   in the card rather than floating in a toast. */
.auth-card__notice {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--brand-border);
  background: var(--brand-tint);
  color: var(--brand);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.auth-card .form-error {
  margin: 14px 0 0;
  padding: 9px 12px;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.auth-card .auth-form {
  margin: 18px 0 0;
  display: grid;
  gap: 14px;
}

.auth-card .field {
  gap: 4px;
}

.auth-card .field__label {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--text);
}

.auth-card .field__input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background: var(--page);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.auth-card .field__input:hover {
  border-color: var(--brand-border-hover);
}

.auth-card .field__input:focus {
  border-color: var(--brand);
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow: none;
}

.auth-card .field__hint,
.auth-card .field__error {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.auth-card .checkbox-row {
  gap: 8px;
}

.auth-card .checkbox-row__input {
  width: 17px;
  height: 17px;
}

.auth-card .checkbox-row__label {
  font-size: 0.9375rem;
  line-height: 1.35;
}

.auth-card .btn--primary {
  width: 100%;
  margin-top: 2px;
  padding: 11px 18px;
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 999px;
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: none;
}

.auth-card .btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-text);
}

.auth-card .btn--primary:focus-visible {
  outline-color: var(--brand);
}

.auth-switch {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: center;
}

.auth-switch + .auth-switch {
  margin-top: 6px;
}

.auth-switch a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Phone nav: keep the public three-part header on one line. */
@media (max-width: 560px) {
  .auth-page .app-header__inner {
    gap: 8px;
    padding: 10px 14px;
  }

  .auth-page .wordmark {
    gap: 7px;
    font-size: 1.05rem;
  }

  .auth-page .app-header__actions {
    gap: 8px;
  }

  .auth-page .topnav__link {
    padding: 4px 0;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .auth-page .btn--nav {
    flex-shrink: 0;
    padding: 7px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
}

/* Short landscape: the same compact treatment as the landing page. */
@media (max-height: 500px) and (min-width: 600px) {
  .auth-page .app-header__inner {
    padding: 8px 18px;
  }

  .auth-page .wordmark {
    font-size: 1.05rem;
  }

  .auth-page .topnav__link {
    font-size: 0.82rem;
  }

  .auth-page .btn--nav {
    padding: 6px 12px;
    font-size: 0.76rem;
  }

  .auth-shell {
    padding: 2px 24px;
  }

  .auth-card {
    padding: 4px 16px;
  }

  .auth-card__eyebrow {
    margin: 0 0 2px;
    font-size: 0.62rem;
    line-height: 1.2;
    letter-spacing: 0.12em;
  }

  .auth-card__title {
    font-size: 1.05rem;
    line-height: 1.05;
  }

  .auth-card__sub {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 1.15;
  }

  .auth-card__messages {
    gap: 3px;
    margin-top: 4px;
  }

  .auth-card__notice,
  .auth-card .form-error {
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 15px;
    line-height: 1.15;
  }

  .auth-card .auth-form {
    margin-top: 6px;
    gap: 4px;
  }

  .auth-card .field {
    gap: 1px;
  }

  .auth-card .field__label {
    font-size: 15px;
    line-height: 1.15;
  }

  .auth-card .field__input {
    min-height: 30px;
    padding: 3px 8px;
    font-size: 15px;
    line-height: 1.2;
  }

  .auth-card .field__hint,
  .auth-card .field__error {
    font-size: 15px;
    line-height: 1.15;
  }

  .auth-card .checkbox-row {
    gap: 6px;
  }

  .auth-card .checkbox-row__input {
    width: 15px;
    height: 15px;
  }

  .auth-card .checkbox-row__label {
    font-size: 15px;
    line-height: 1.15;
  }

  .auth-card .btn--primary {
    margin-top: 0;
    padding: 6px 12px;
    font-size: 15px;
    line-height: 1.2;
  }

  .auth-switch {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.15;
  }

  .auth-switch + .auth-switch {
    margin-top: 2px;
  }
}

/* Register carries one more field than its siblings.  It keeps the same
   rhythm in a slightly tighter measure so the card still fits every locked
   viewport, including the short landscape one with a flash above it. */
.auth-card .auth-form--register {
  gap: 8px;
}

@media (max-height: 500px) and (min-width: 600px) {
  .auth-card:has(.auth-form--register) {
    padding: 2px 16px;
  }

  .auth-card:has(.auth-form--register) .auth-card__title {
    font-size: 1rem;
  }

  .auth-card:has(.auth-form--register) .auth-card__sub {
    margin: 0;
  }

  .auth-card .auth-form--register {
    margin-top: 4px;
    gap: 0;
  }

  .auth-card .auth-form--register .field {
    gap: 0;
  }

  .auth-card .auth-form--register .field__input {
    min-height: 24px;
    padding: 2px 8px;
  }

  .auth-card .auth-form--register .btn--primary {
    padding: 4px 12px;
  }

  /* This profile closes every gap in the form, and the mismatch line is the
     one hint that can appear under Confirm: without air of its own it sits
     flush against the button. */
  .auth-card .auth-form--register .field__hint--error {
    margin: 4px 0;
  }
}
