/* ==========================================================================
   AUTH-GATE SUBSYSTEM (v5.5.1)
   Dither Pixel Canvas, Lockup, Ripple CTA, and Shroud Transition Loader.
   ========================================================================== */

#authGateOverlay.auth-gate-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  color: #ffffff;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

#px {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  z-index: 1;
}

#authGateOverlay .wrap {
  position: relative;
  z-index: 2;
  width: min(360px, calc(100vw - 48px));
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#authGateOverlay .wrap > * {
  animation: authFadeIn 0.9s cubic-bezier(0.2, 0, 0, 1) both;
}

#authGateOverlay .wrap > :nth-child(1) { animation-delay: 0.05s; }
#authGateOverlay .wrap > :nth-child(2) { animation-delay: 0.15s; }
#authGateOverlay .wrap > :nth-child(3) { animation-delay: 0.25s; }
#authGateOverlay .wrap > :nth-child(4) { animation-delay: 0.35s; }

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

#authGateOverlay .lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

#authGateOverlay .lockup img {
  width: 46px;
  height: 46px;
  display: block;
}

#authGateOverlay .lockup i {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.4);
}

#authGateOverlay .lockup span {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: #ffffff;
}

#authGateOverlay .lockup span em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.7);
}

#authGateOverlay h1 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #ffffff;
}

#authGateOverlay .sub {
  margin-top: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

#authGateOverlay .sub b {
  font-weight: 600;
  color: #ffffff;
}

#authGateOverlay .btns {
  margin-top: 30px;
  width: 100%;
  display: grid;
  gap: 10px;
}

#authGateOverlay .btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans, "Inter", sans-serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: #000000;
  color: #ffffff;
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), border-color 0.25s ease;
  outline: none;
  box-shadow: none !important;
}

#authGateOverlay .btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

#authGateOverlay .btn.solid {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

#authGateOverlay .btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

#authGateOverlay .btn:hover::after {
  opacity: 0.1;
}

#authGateOverlay .btn:hover {
  transform: translateY(-2px);
}

#authGateOverlay .btn:not(.solid):hover {
  border-color: #ffffff;
}

#authGateOverlay .btn:active {
  transform: scale(0.98);
}

#authGateOverlay .btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

#authGateOverlay .badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid currentColor !important;
  opacity: 0.6;
}

@media (max-width: 400px) {
  #authGateOverlay .badge { display: none; }
}

#authGateOverlay .ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.16;
  transform: scale(0);
  pointer-events: none;
  z-index: -1;
  animation: authRipple 0.6s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes authRipple {
  to { transform: scale(1); opacity: 0; }
}

#authGateOverlay .btn.loading {
  pointer-events: none;
}

#authGateOverlay .btn.loading svg,
#authGateOverlay .btn.loading .badge {
  display: none;
}

#authGateOverlay .btn.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}

#authGateOverlay .btns.busy .btn:not(.loading) {
  opacity: 0.3;
  pointer-events: none;
}

#authGateOverlay .legal {
  margin-top: 28px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

#authGateOverlay .legal a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
}

#authGateOverlay .legal a:hover {
  text-decoration-color: #ffffff;
}

/* SHROUD TRANSITION LOADER */
.auth-shroud-loader {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 32px;
}

.shroud-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  animation: authSpin 0.75s linear infinite;
}

.shroud-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.shroud-sub {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}