/* auth.css — Guardian Command login wall + loading state
 *
 * The login wall is the user's first impression of the platform —
 * the visual language here has to match the dashboard exactly so the
 * sign-in step feels like part of the product, not a hand-off to a
 * third-party form. Same Inter + Bebas Neue + JetBrains Mono trio,
 * same near-black surfaces, same electric blue accent.
 *
 * Tokens are scoped to this stylesheet — the dashboard's --gc-*
 * tokens haven't loaded yet at login time, so auth.css carries its
 * own --auth-accent + --auth-accent-hover that line up with the
 * canonical electric blue (#2F6BFF / #5B9BFF).
 */

:root {
  --auth-bg:         #0A0E16;
  --auth-card:       #121A2A;
  --auth-border:     rgba(91, 155, 255, 0.18);
  --auth-text:       #E8EEF8;
  --auth-text-dim:   #8A94A6;
  --auth-text-muted: #5B6573;
  --auth-accent:       #2F6BFF;
  --auth-accent-hover: #5B9BFF;
}

/* ── Loading spinner ────────────────────────────────────────── */
.auth-loading {
  position: fixed; inset: 0;
  background: var(--auth-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.auth-loading-inner {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.auth-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(47, 107, 255, 0.2);
  border-top-color: var(--auth-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.auth-loading-inner p {
  color: var(--auth-text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login wall ─────────────────────────────────────────────── */
/* Diamond hatch backdrop matches the dashboard topbar so the sign-in
   surface and the authenticated shell share visual continuity. */
#login-wall {
  position: fixed; inset: 0;
  background: var(--auth-bg);
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI3MCIgaGVpZ2h0PSI0MCI+PHBhdGggZD0iTTAgMjAgTDE3LjUgMCBMNTIuNSAwIEw3MCAyMCBMNTIuNSA0MCBMIDE3LjUgNDAgWiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDkxLDE1NSwyNTUsMC4xMCkiIHN0cm9rZS13aWR0aD0iMSIvPjwvc3ZnPg==");
  background-size: 70px 40px;
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
  font-family: 'Inter', sans-serif;
}

.login-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
  padding: 36px 40px 24px;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.4);
  max-width: 360px;
  width: 90%;
}

.login-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
  margin-bottom: 4px;
}

.login-logo {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1;
}
.login-brand-g {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: var(--auth-text);
  letter-spacing: 0.14em;
}
.login-brand-c {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: var(--auth-accent);
  letter-spacing: 0.14em;
  margin-top: -4px;
}

.login-sub {
  color: var(--auth-text-dim);
  font-size: 11px;
  margin: 0;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.login-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px;
  background: var(--auth-accent);
  /* Brief: primary buttons = electric blue, WHITE text. Replaces the
     dark text from the gold theme — electric blue has more saturated
     hue and the white contrast (~7.1:1 on #2F6BFF) reads cleaner. */
  color: #FFFFFF;
  border: 1px solid var(--auth-accent);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  margin-top: 4px;
  box-shadow: 0 6px 22px rgba(47, 107, 255, 0.32);
}
.login-btn svg { transition: transform 0.18s; }
.login-btn:hover { background: var(--auth-accent-hover); border-color: var(--auth-accent-hover); }
.login-btn:hover svg { transform: translateX(2px); }
.login-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.login-btn:active { background: var(--auth-accent); }

.login-divider {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  margin-top: 4px;
  color: var(--auth-text-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.login-divider::before,
.login-divider::after {
  content: ""; flex: 1;
  height: 1px;
  background: rgba(47, 107, 255,0.10);
}

.login-meta {
  display: flex; align-items: center; gap: 6px;
  color: var(--auth-text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0;
}
.login-meta-dot { opacity: 0.6; }

/* Older login footer kept for backward compat — same look as new
   .login-divider so any cached HTML still renders coherently. */
.login-footer {
  color: var(--auth-text-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
}

/* ── Alert badge ────────────────────────────────────────────── */
.alert-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: #DC2626;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ── Hide dashboard until authenticated ─────────────────────── */
body.unauthenticated .topbar,
body.unauthenticated .shell,
body.unauthenticated .modal-overlay,
body.unauthenticated .modal {
  display: none !important;
}
body.authenticated #auth-loading,
body.authenticated #login-wall,
body.unauthenticated #auth-loading {
  display: none !important;
}
