/* Password gate overlay - shown before site content until authenticated */

/* Hide every direct child of body EXCEPT the gate overlay and scripts.
   The gate overlay is a body child appended by gate.js, so it must stay
   visible while the rest of the page content is hidden. */
html.gate-locked body > *:not(.gate-overlay):not(script) {
  display: none !important;
}
/* If the overlay has not yet been injected (gate.js still loading),
   hide everything below the body fold via a fallback. */
html.gate-locked body {
  background: #0E1A40;
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #08102A 0%, #0E1A40 55%, #1a2456 100%);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif);
}

.gate-overlay::before,
.gate-overlay::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}
.gate-overlay::before {
  width: 480px; height: 480px;
  background: #6F5BEF;
  top: -120px; right: -80px;
}
.gate-overlay::after {
  width: 360px; height: 360px;
  background: #FF694A;
  bottom: -120px; left: -60px;
}

.gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 16px;
  padding: 2.25rem 2rem 1.75rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  text-align: center;
}

.gate-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #6F5BEF 0%, #29B5E8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: -0.03em;
}

.gate-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0E1A40;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.gate-sub {
  font-size: 0.95rem;
  color: #6B7280;
  margin: 0 0 1.5rem;
  line-height: 1.45;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.gate-input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-family: inherit;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #FAFAF7;
  color: #1F2A44;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  outline: none;
  text-align: center;
  letter-spacing: 0.04em;
}
.gate-input:focus {
  border-color: #6F5BEF;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(111,91,239,0.15);
}
.gate-input::placeholder { color: #9CA3AF; letter-spacing: 0; }

.gate-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  background: #6F5BEF;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
.gate-btn:hover { background: #5946d8; }
.gate-btn:active { transform: translateY(1px); }

.gate-error {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: #B23814;
  min-height: 1.2rem;
  transition: opacity 0.15s ease;
  opacity: 0;
}
.gate-error.is-visible { opacity: 1; }

.gate-footer {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid #ECEEF2;
  font-size: 0.78rem;
  color: #9CA3AF;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 460px) {
  .gate-card { padding: 1.75rem 1.4rem 1.4rem; }
  .gate-title { font-size: 1.2rem; }
}

@media print {
  .gate-overlay { display: none !important; }
  html.gate-locked body > *:not(.gate-overlay):not(script) { display: revert !important; }
}
