/* ══════════════ LLAVE DE ACCESO — pantalla de bloqueo ══════════════
   Compartido por todas las páginas del sitio (portal principal y
   diagnóstico). Usa var(--x, fallback) en todos lados para funcionar
   sin depender de las variables de marca propias de cada página. */

body.gate-locked {
  overflow: hidden;
  height: 100vh;
}

/* Oculta todo el contenido de la página excepto la pantalla de acceso,
   sin importar qué elementos tenga cada página (portal / diagnóstico). */
body.gate-locked > *:not(#gateScreen) {
  visibility: hidden;
}

.gate-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

body:not(.gate-locked) .gate-screen {
  display: none;
}

.gate-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #2e3a2b 0%, #1A1916 70%);
}

.gate-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(173, 128, 32, 0.14), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(112, 33, 80, 0.14), transparent 55%);
}

.gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(26, 25, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg, 7px);
  padding: 2.6rem 2.2rem;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.gate-logo {
  height: 120px;
  width: auto;
  margin: 0 auto 1.6rem;
  display: block;
}

.gate-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs, 0.7rem);
  letter-spacing: var(--tracking-widest, 0.18em);
  text-transform: uppercase;
  color: var(--color-gold, var(--gold, #AD8020));
  margin-bottom: 1rem;
}

.gate-card h1 {
  color: #fff;
  font-size: var(--text-h3, 1.5rem);
  font-weight: var(--weight-black, 900);
  line-height: 1.2;
  margin-bottom: 0.9rem;
}

.gate-card h1 em {
  display: block;
  font-style: normal;
  font-weight: var(--weight-normal, 400);
  font-size: 0.62em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.3rem;
}

.gate-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--text-sm, 0.85rem);
  line-height: 1.5;
  margin-bottom: 1.8rem;
}

.gate-field {
  display: flex;
  gap: 0.5rem;
}

.gate-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm, 4px);
  padding: 0.85rem 1rem;
  color: #fff;
  font-family: var(--font-sans, 'Lato', sans-serif);
  font-size: var(--text-base, 1rem);
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.gate-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.gate-input:focus {
  border-color: var(--color-gold, var(--gold, #AD8020));
  background: rgba(255, 255, 255, 0.09);
}

.gate-submit {
  flex-shrink: 0;
  width: 3rem;
  border: none;
  border-radius: var(--radius-sm, 4px);
  background: var(--color-gold, var(--gold, #AD8020));
  color: #1A1916;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.gate-submit:hover {
  background: #c79632;
}

.gate-submit:active {
  transform: scale(0.96);
}

.gate-error {
  margin-top: 1rem;
  color: #e08a8a;
  font-size: var(--text-sm, 0.85rem);
}

.gate-input.gate-input--shake {
  animation: gate-shake 0.4s ease;
  border-color: #e08a8a;
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 480px) {
  .gate-card {
    padding: 2.2rem 1.5rem;
  }
}
