/* Account entry and renewal. */
#authGate {
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 85% 18%, #2d1117, transparent 60%), var(--fs-canvas);
}

.auth-frame {
  display: grid;
  grid-template-columns: minmax(420px, .9fr) minmax(0, 1.12fr);
  width: min(100%, 1040px);
  border: 1px solid var(--fs-stroke);
  border-radius: 24px;
  background: var(--fs-paper);
  box-shadow: 0 20px 64px #0009, 0 15px 70px -48px #db232c;
}

#authGate .auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 4vw, 52px);
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: clamp(32px, 5vw, 68px);
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

#authGate .auth-card::before { content: none; }

#authGate .auth-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
}

#authGate .auth-brand img { width: 52px; height: 52px; border: 1px solid #8a373f; box-shadow: 0 6px 17px -8px #db232c; border-radius: 11px; }
#authGate .auth-brand h1 { margin: 0; font: 900 clamp(20px, 3.4vw, 30px)/1.16 var(--fs-display); color: var(--fs-ink); }

#authGate .auth-panel {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
}

#authGate .auth-panel h2 {
  margin: 0 0 8px;
  font: 820 clamp(34px, 4vw, 52px)/1.04 var(--fs-display);
  letter-spacing: -.055em;
  color: var(--fs-ink);
}

#authGate .auth-panel > p { color: var(--fs-secondary); }
#authGate .auth-panel .auth-error { color: var(--fs-accent); margin-bottom: 0; }
#authGate .auth-panel .auth-error:empty { display: none; }
#authGate .auth-tabs { margin-block: 20px; }
#authGate .auth-tabs button { padding-inline: 8px; }
#authGate .auth-form { gap: 14px; }
#authGate .auth-form [type="password"] { font-size: 16px; }
#authGate #openPasswordReset { min-height: 44px; border-color: transparent; background: transparent; color: var(--fs-accent); }
#authGate #openPasswordReset:hover { background: var(--fs-accent-surface); }

.auth-art {
  min-height: 560px;
  border-radius: 0 23px 23px 0;
  background:
    linear-gradient(0deg, #1004075c, transparent 65%),
    url("/assets/fs-gorilla-hero.webp") center 42% / cover no-repeat,
    var(--fs-rail);
}

.billing-screen { background: var(--fs-canvas); }
.billing-heading h1 { font: 820 clamp(36px, 5vw, 62px)/1.01 var(--fs-display); letter-spacing: -.05em; }
.billing-header .billing-brand img { border-radius: 8px; }
.billing-screen .billing-status { background: var(--fs-success-surface); border-color: var(--fs-success-line); color: var(--fs-success-text); }
.billing-error { background: var(--fs-accent-surface); border-color: var(--fs-accent-line); }
.billing-offer { background: var(--fs-paper); border-color: var(--fs-stroke); }
.billing-offer:hover { background: var(--fs-wash); }
.billing-offer:has(input:checked) { background: var(--fs-accent-surface); color: var(--fs-accent); }
.billing-offer:focus-within { outline: 2px solid var(--fs-focus); outline-offset: 2px; }

#billingScreen .billing-form:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 24vw, 268px);
  align-items: start;
  gap: 16px;
}

.billing-plan { align-content: start; }
.billing-plan h2, .billing-pending h2 { letter-spacing: -.035em; }
.billing-plan > div:first-child { min-block-size: 108px; }
.billing-pending { background: var(--fs-paper); }

.billing-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin: 2px 0 0;
  padding: 18px;
  background: var(--fs-paper);
  border: 1px solid var(--fs-stroke);
  border-radius: var(--fs-radius);
}

.billing-summary h2 { margin: 0; font-size: 18px; }
.billing-selection { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding-block: 12px; border-block: 1px solid var(--fs-stroke); }
.billing-selection span { display: block; color: var(--fs-secondary); font-size: 13px; }
.billing-selection > strong { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--fs-accent); }
.billing-summary p { font-size: 13px; }
.billing-summary .primary-button { width: 100%; }
.billing-summary .primary-button[hidden] { display: none; }

@media (max-width: 1000px) {
  #billingScreen .billing-form:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
  .billing-summary { width: min(100%, 440px); }
}

@media (max-width: 730px) {
  #authGate { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .auth-frame { width: min(100%, 440px); grid-template-columns: minmax(0, 1fr); border-radius: 18px; }
  #authGate .auth-card { padding: clamp(22px, 6vw, 36px); gap: 24px; }
  .auth-art { min-height: clamp(100px, 28vw, 180px); border-radius: 0 17px 17px 0; background-position: center, 52% 66%; }
  .billing-plan > div:first-child { min-block-size: 0; }
}

@media (max-height: 650px) and (max-width: 730px) {
  #authGate { align-items: start; }
  .auth-art { display: none; }
}
