.auth-page {
  /* svh is Safari 15.4+; below that the declaration is dropped entirely and
     the page would lose its min-height, collapsing the flex column that
     .auth-layout stretches inside. Plain vh first as the fallback. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 9% 10%, rgba(71, 84, 101, .48), transparent 31rem),
    radial-gradient(circle at 85% 28%, rgba(216, 170, 93, .12), transparent 30rem),
    linear-gradient(142deg, #15191e 0%, #1b1e23 46%, #2a241d 100%);
}

.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 48%, rgba(255, 255, 255, .018) 48% 48.12%, transparent 48.12% 100%),
    radial-gradient(circle at 50% 115%, rgba(0, 0, 0, .54), transparent 48%);
}

.auth-header {
  width: min(1380px, calc(100% - 64px));
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-inline: auto;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.auth-header-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.auth-header-links a {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 650;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.auth-home-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
}

.auth-layout {
  width: min(1380px, calc(100% - 64px));
  flex: 1;
  display: grid;
  justify-items: center;
  align-items: center;
  margin-inline: auto;
  padding: clamp(58px, 7vw, 106px) 0 clamp(58px, 7vw, 88px);
}

.auth-panel-wrap {
  position: relative;
  width: min(100%, 530px);
}

.auth-card {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 4.8vw, 54px);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .055), transparent 38%),
    rgba(16, 19, 24, .86);
  box-shadow: 0 38px 100px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .045);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.auth-card::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -130px;
  top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 170, 93, .13), transparent 68%);
  pointer-events: none;
}

.auth-card-topline {
  position: absolute;
  top: 0;
  left: 54px;
  right: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 18px rgba(216, 170, 93, .42);
}

.auth-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--gold-bright);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-card-heading h1 {
  margin: 0;
  font: 500 clamp(2.25rem, 4vw, 3.25rem)/1 var(--serif);
  letter-spacing: -.04em;
}

.auth-card-heading p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.65;
}

.capacity-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin: 28px 0;
  padding: 17px;
  border: 1px solid rgba(216, 170, 93, .25);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(216, 170, 93, .095), rgba(216, 170, 93, .035));
}

.capacity-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 170, 93, .3);
  border-radius: 50%;
  background: rgba(216, 170, 93, .08);
}
.capacity-icon svg { width: 19px; height: 19px; fill: none; stroke: var(--gold-bright); stroke-width: 1.6; stroke-linecap: round; }
.capacity-notice h2 { margin: 1px 0 7px; font: 500 1.03rem/1.2 var(--serif); }
.capacity-notice p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.65; }

/* Matches .auth-trust-row's 20px below the button, so the control is evenly
   spaced when .capacity-notice is hidden — which is the normal case, since
   that notice only appears once the free-user cap is actually reached. When it
   IS shown, this collapses against its 28px bottom margin (both are siblings
   in the block-level .auth-card) rather than adding to it, so the spacing
   there is unchanged. */
.auth-action-slot { margin-top: 20px; }

.google-auth-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 15px;
  color: #202124;
  background: #f7f5ef;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .23);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 750;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.google-auth-button:active { transform: translateY(0); }
.google-mark { width: 22px; height: 22px; }
.button-arrow { color: #6d655a; font-size: 1.15rem; }

/* ── Sign-in states, wired by index.html's module script ─────────────────
   The button is a 3-column grid (icon | label | arrow), so the spinner shares
   the ICON cell rather than being added as a fourth child, which would wrap
   the row. Every child is placed explicitly so source order cannot drift. */
.google-mark  { grid-area: 1 / 1; }
.auth-spinner { grid-area: 1 / 1; }
.btn-label    { grid-area: 1 / 2; }
.button-arrow { grid-area: 1 / 3; }

.auth-spinner {
  display: none;
  justify-self: center;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(32, 33, 36, .22);
  border-top-color: #202124;
  border-radius: 50%;
  animation: authSpin .7s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* visibility, not display: the icon and arrow must keep their grid cells so
   the label does not shift sideways when the spinner appears. */
.google-auth-button.loading .google-mark,
.google-auth-button.loading .button-arrow { visibility: hidden; }
.google-auth-button.loading .auth-spinner { display: block; }
.google-auth-button[disabled] { cursor: default; opacity: .82; }

/* ── Every :hover rule on this page lives here ───────────────────────────
   Gated behind a real pointer: on iOS, hover styling can make the engine
   treat the first tap as a hover and swallow the click, which on this page
   would mean the sign-in button needing two taps. :active is deliberately
   left ungated -- it works on touch and gives the tap its press feedback. */
@media (hover: hover) {
  .auth-header-links a:hover { color: var(--text); }

  .auth-home-link:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, .05);
  }

  .google-auth-button:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .3), 0 0 0 4px rgba(216, 170, 93, .065);
  }

  /* must stay after the rule above so it can neutralise it */
  .google-auth-button[disabled]:hover {
    transform: none;
    background: #f7f5ef;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .23);
  }
}

.auth-error {
  margin: 13px 0 0;
  color: #f0a9a0;
  font-size: .8rem;
  line-height: 1.55;
  text-align: center;
}
.auth-error:empty { display: none; }

/* Waiting-list position, filled in by showWaitlistPanel() when the signup
   gate returns one (it stays hidden on the generic ?waitlist=1 bounce). */
.capacity-pos {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(216, 170, 93, .1);
  font-size: .74rem;
  font-weight: 700;
}

.auth-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 20px;
  color: var(--muted-soft);
  font-size: .68rem;
}
.auth-trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.auth-trust-row i { color: var(--gold); font-style: normal; }

.auth-legal {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted-soft);
  font-size: .69rem;
  line-height: 1.6;
  text-align: center;
}
.auth-legal a, .auth-support a { color: var(--gold-bright); text-underline-offset: 3px; }
.auth-support { margin: 17px 0 0; color: var(--muted-soft); font-size: .72rem; text-align: center; }

@media (max-width: 900px) {
  .auth-header, .auth-layout { width: min(100% - 36px, 680px); }
  .auth-header { min-height: 78px; }
  .auth-layout { padding-top: 46px; }
  .auth-panel-wrap { width: min(100%, 540px); }
}

@media (max-width: 600px) {
  .auth-header { width: calc(100% - 28px); }
  .auth-header .brand small, .auth-header-links > a:first-child { display: none; }
  .auth-header-links { gap: 10px; }
  .auth-home-link { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; }
  .auth-home-link span { font-size: 1.1rem; }
  .auth-home-link { font-size: 0 !important; }
  .auth-layout { width: calc(100% - 28px); padding: 38px 0 50px; }
  .auth-card { padding: 30px 21px 24px; border-radius: 22px; }
  .capacity-notice { grid-template-columns: 1fr; }
  .capacity-icon { width: 31px; height: 31px; }
  .auth-trust-row { display: grid; }
}

@media (max-height: 780px) and (min-width: 901px) {
  .auth-header { min-height: 74px; }
  .auth-layout { padding: 38px 0 48px; }
  .auth-card { padding-top: 38px; padding-bottom: 38px; }
}
