/* Account-first access: site stays hidden until Supabase session and history load. */
html:not(.endurance-authenticated) body > :not(#authGate):not(script) {
  display: none !important;
}
html.endurance-authenticated #authGate { display: none !important; }
.auth-gate {
  box-sizing: border-box;
  min-height: 100dvh;
  padding: 34px 18px;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 80% 0%, #23515b 0, transparent 48%),
    radial-gradient(ellipse at 15% 100%, #29413a 0, transparent 52%), #0b1220;
  color: #edf5fc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.auth-gate * { box-sizing: border-box; }
.auth-card {
  width: min(100%, 472px);
  border: 1px solid #355064;
  background: linear-gradient(150deg, #192b3d, #111c2a 75%);
  border-radius: 24px;
  padding: clamp(23px, 5vw, 39px);
  box-shadow: 0 30px 100px #010711ae;
}
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.auth-brand-mark {
  flex: none; width: 47px; height: 47px; border-radius: 14px;
  display: grid; place-items: center; border: 2px solid #cbee92;
  color: #cbee92; font-weight: 900; font-size: 18px;
}
.auth-brand strong { display:block; font-size: 20px; letter-spacing: -0.5px; }
.auth-brand small { color:#a3bdc9; text-transform: uppercase; font-size: 10px; letter-spacing: 2px; font-weight: 800; }
.auth-kicker { color: #cbee92; font-size: 11px; font-weight: 850; letter-spacing: 1.5px; text-transform: uppercase; }
.auth-gate h1 { color: #f2f9ff; font-size: clamp(27px,4vw,34px); letter-spacing: -1px; line-height: 1.18; margin: 8px 0 10px; }
.auth-copy { font-size: 14px; line-height: 1.6; color: #a9c0cf; margin: 0 0 22px; }
.auth-view[hidden] { display: none !important; }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 7px; color: #d3e3ee; font-size: 12px; font-weight: 740; }
.auth-form input {
  width: 100%; min-width: 0; padding: 13px 14px;
  color: #f5faff; background: #0c1a2b;
  border: 1px solid #476079; border-radius: 11px;
  font-size: 15px; outline-offset: 2px;
}
.auth-form input:focus { outline: 2px solid #bde8a0; }
.auth-button {
  border: 1px solid #435c6c; border-radius: 11px;
  background: #22384b; color: #f2faff;
  padding: 12px 14px; font: inherit; font-weight: 780; font-size: 13px;
  cursor: pointer; text-align: center;
}
.auth-button.primary { color: #15251c; background: #cbee92; border-color: #cbee92; margin-top: 7px; }
.auth-button:hover { filter: brightness(1.1); }
.auth-button:disabled { opacity: 0.5; cursor: wait; }
.auth-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 18px; }
.auth-link {
  appearance: none; color: #9edbd7; font: inherit; font-size: 12px; font-weight: 740;
  border: 0; background: transparent; padding: 5px 2px; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer;
}
.auth-status {
  color: #d3e9c2; font-size: 13px; line-height: 1.5; white-space: pre-line;
  margin-top: 17px;
}
.auth-status:empty { display: none; }
.auth-status.auth-error { background: #4b2631; border: 1px solid #a45d6e; color: #ffe7ed; border-radius: 10px; padding: 11px; }
.auth-foot { color: #819eaf; font-size: 11px; text-align: center; line-height: 1.6; margin: 23px 0 0; }
.auth-pulse { width: 32px; height: 32px; margin: 22px 0; border: 3px solid #40556c; border-top-color: #cbee92; border-radius: 50%; animation: auth-spin 0.8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-pulse { animation: none; } }
@media (max-width: 490px) {
  .auth-gate { align-items: center; padding: 14px; }
  .auth-card { padding: 25px 20px; border-radius: 18px; }
}
