.alpha-shell.app-locked {
  visibility: hidden;
  pointer-events: none;
}

/* Auth state invariant: fields/buttons marked hidden must never be painted. */
.auth-gate [hidden] {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(86, 130, 190, .12), transparent 36%),
    radial-gradient(circle at 85% 78%, rgba(174, 113, 72, .10), transparent 34%),
    #081426;
  color: #f8fafc;
}

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

.auth-panel {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background: rgba(12, 28, 50, .76);
  box-shadow: 0 28px 90px rgba(0,0,0,.28);
  backdrop-filter: blur(20px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.auth-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  background: rgba(255,255,255,.04);
}

.auth-brand strong { display: block; letter-spacing: .12em; font-size: .94rem; }
.auth-brand span { display: block; margin-top: 3px; color: rgba(248,250,252,.56); font-size: .78rem; }

.auth-kicker {
  margin: 0 0 8px;
  color: rgba(214, 170, 135, .88);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .68rem;
  font-weight: 700;
}

.auth-panel h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.35rem); line-height: 1.08; font-weight: 620; }
.auth-description { margin: 12px 0 28px; color: rgba(248,250,252,.62); line-height: 1.6; font-size: .92rem; }

.auth-form { display: grid; gap: 16px; }
.auth-field { display: grid; gap: 8px; }
.auth-field label { color: rgba(248,250,252,.68); font-size: .76rem; font-weight: 650; letter-spacing: .03em; }
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
  color: #f8fafc;
  outline: none;
  font: inherit;
}
.auth-field input:focus { border-color: rgba(121,165,222,.58); box-shadow: 0 0 0 3px rgba(121,165,222,.08); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(248,250,252,.66);
  cursor: pointer;
}

.auth-submit {
  margin-top: 2px;
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  background: #f8fafc;
  color: #0b1930;
  font-weight: 700;
  cursor: pointer;
}
.auth-submit:disabled { opacity: .55; cursor: wait; }

.auth-secondary {
  border: 0;
  background: transparent;
  color: rgba(248,250,252,.70);
  cursor: pointer;
  font: inherit;
  font-size: .84rem;
  text-decoration: underline;
  text-decoration-color: rgba(248,250,252,.20);
  text-underline-offset: 4px;
}

.auth-message {
  min-height: 22px;
  margin: 4px 0 0;
  color: rgba(248,250,252,.68);
  font-size: .82rem;
  line-height: 1.45;
}
.auth-message.error { color: #f6b2ae; }
.auth-message.success { color: #a9dfc2; }

.auth-footnote {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(248,250,252,.42);
  font-size: .72rem;
  line-height: 1.55;
}

.pending-box {
  display: none;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(214,170,135,.22);
  border-radius: 14px;
  background: rgba(214,170,135,.05);
}
.pending-box.active { display: block; }
.pending-box strong { display: block; margin-bottom: 6px; }
.pending-box p { margin: 0; color: rgba(248,250,252,.62); font-size: .82rem; line-height: 1.5; }

.session-signout {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: rgba(248,250,252,.72);
  text-decoration: underline;
  cursor: pointer;
}

.topbar-session-button {
  border: 1px solid rgba(11,25,48,.10);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 8px 10px;
  font-size: .76rem;
  cursor: pointer;
}

.data-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 6px 9px;
  border: 1px solid rgba(41, 116, 86, .15);
  border-radius: 999px;
  color: #2f765d;
  background: rgba(47,118,93,.05);
  font-size: .72rem;
  font-weight: 650;
}
.data-source-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(47,118,93,.08);
}

@media (max-width: 640px) {
  .auth-gate { padding: 12px; }
  .auth-panel { padding: 26px 22px; border-radius: 20px; }
}
