/* Sign-in gate. Self-contained — must not depend on any page's stylesheet,
   since each project under public/ styles itself independently.

   NOTE: this hides content, it does not protect it. Every file under public/ is
   still fetchable by direct URL. See README. */

/* Hide page content until the gate resolves. The class is set in the HTML so
   nothing flashes before JS runs; auth-gate.js removes it once authorized. */
html.auth-pending body > *:not(#auth-gate) {
  display: none !important;
}

#auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #ffffff;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  #auth-gate {
    background: #121212;
    color: #f0efec;
  }
}

#auth-gate h1 {
  margin: 0;
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

#auth-gate p {
  margin: 0;
  max-width: 26rem;
  color: #6b6b6b;
  font-size: 0.9375rem;
}

@media (prefers-color-scheme: dark) {
  #auth-gate p { color: #8f8d88; }
}

#auth-gate p.error {
  color: #b3261e;
}

@media (prefers-color-scheme: dark) {
  #auth-gate p.error { color: #f2b8b5; }
}

#auth-gate button {
  appearance: none;
  border: 1px solid #C8A55C;
  border-radius: 6px;
  background: #C8A55C;
  color: #1a1a1a;
  font: inherit;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
}

#auth-gate button:hover:not(:disabled) {
  filter: brightness(1.07);
}

#auth-gate button:disabled {
  opacity: 0.55;
  cursor: default;
}

#auth-gate button.secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
  font-weight: 400;
}

/* Signed-in indicator, shown once content is visible. */
#auth-status {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  background: rgba(127, 127, 127, 0.14);
  color: #6b6b6b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  backdrop-filter: blur(6px);
}

@media (prefers-color-scheme: dark) {
  #auth-status { color: #8f8d88; }
}

#auth-status button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
