/* Auth-gate overlay — inherits the app's theme tokens (app.css loads first), so it follows the user's
   dark/light theme and looks on-brand instead of a bare dark spinner. */
#authGate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  /* Respect device safe areas so the centered content never sits under a notch/home indicator. */
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: var(--bg, #0a0e14);
  transition: opacity .32s ease;
  font: 14px/1.5 "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  color: var(--text2, #9aa7b5);
}

/* Hero (logo + wordmark) sits above a tight status row — a clear visual hierarchy, generous gap
   between the brand and the "working" affordance, following common splash/auth-loading patterns. */
#authGate .g {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: agFadeIn .4s ease both;
}

#authGate .brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

#authGate .brand .theme-logo {
  width: 36px;
  height: 36px;
  display: block;
}

#authGate .brand b {
  font: 700 23px/1 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--text, #e6edf3);
  letter-spacing: -.01em;
}

#authGate .beta-tag { height: 20px; padding-inline: 7px; font-size: 9px; }

/* Status row: the spinner icon and the message are aligned on one baseline-centered line — the icon
   reads as "in progress next to what it's doing", not a stray dot floating above the text. */
#authGate .status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#authGate .spin {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid color-mix(in srgb, var(--line, #242c3a) 90%, transparent);
  border-top-color: var(--accent, #2dd4bf);
  border-radius: 50%;
  animation: ags .75s linear infinite;
}

#authGate .msg {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3, #5b6675);
  letter-spacing: .1px;
}

@keyframes ags { to { transform: rotate(360deg); } }
@keyframes agFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#authGate.hide {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #authGate .g { animation: none; }
  #authGate .spin { animation-duration: 1.4s; }
}
