/**
 * Auth gate — fullscreen wall shown to anonymous visitors.
 *
 * Covers the entire viewport. The app shell (sidebar, nav, content) is
 * kept hidden via the [hidden] attribute on #app-shell while the gate
 * is visible. When Firebase auth fires with a valid @gmail.com user,
 * app.js swaps the states: #auth-gate goes hidden, #app-shell renders.
 *
 * Visual language matches the rest of the platform (paper palette,
 * General Sans display, claret accent) so the gate feels like part of
 * the product, not a stock Firebase login modal.
 */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6, 32px);
  background: var(--bg-canvas, #FAF6EC);
  color: var(--text-primary, #1A1612);
  font-family: var(--font-body, 'Inter', sans-serif);
  overflow-y: auto;
}

.auth-gate[hidden] { display: none; }

.auth-gate__card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-7, 44px) var(--space-6, 32px);
  background: var(--bg-surface, #F5EFE0);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 18px);
}

/* Brand block */
.auth-gate__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-3, 14px);
}
.auth-gate__dot {
  width: 10px;
  height: 10px;
  background: var(--accent-red, #B5321A);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent-red, #B5321A) 15%, transparent);
}
.auth-gate__name {
  font-family: var(--font-display, 'General Sans', sans-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text-primary);
}
.auth-gate__tag {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary, #6b5d4c);
  margin: 0;
  font-weight: 500;
}

/* Copy */
.auth-gate__title {
  font-family: var(--font-display, 'General Sans', sans-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
}
.auth-gate__sub {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary, #3a322a);
  margin: 0;
}

/* Error message (hidden by default, shown when sign-in rejected) */
.auth-gate__error {
  padding: 10px 14px;
  background: color-mix(in oklab, var(--accent-red, #B5321A) 8%, transparent);
  border-left: 3px solid var(--accent-red, #B5321A);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--accent-red, #B5321A);
  line-height: 1.4;
}
.auth-gate__error[hidden] { display: none; }

/* Sign-in button */
.auth-gate__signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
  margin-top: var(--space-2, 10px);
}
.auth-gate__signin:hover {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.25);
}
.auth-gate__signin:active { transform: translateY(1px); }
.auth-gate__signin:disabled {
  opacity: 0.6;
  cursor: wait;
}
.auth-gate__signin svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Legal / contact footer */
.auth-gate__legal {
  font-size: 0.78rem;
  color: var(--text-tertiary, #6b5d4c);
  margin: var(--space-3, 14px) 0 0;
  line-height: 1.45;
}
.auth-gate__legal a {
  color: var(--accent-red, #B5321A);
  text-decoration: none;
}
.auth-gate__legal a:hover { text-decoration: underline; }

/* Loading state — shown briefly while Firebase auth state resolves on page load */
.auth-gate--resolving .auth-gate__card {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 520px) {
  .auth-gate__card { padding: var(--space-6, 28px) var(--space-5, 22px); }
  .auth-gate__title { font-size: 1.3rem; }
}
