/* ==========================================================================
   SPAR.DEV — Porteiro de Senha (Gatekeeper Overlay)
   Tela de bloqueio discreta no tema (#07070a + W98/Terminal)
   ========================================================================== */

.gatekeeper {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 35%, rgba(47, 243, 255, 0.05), transparent 60%),
    rgba(7, 7, 10, 0.92);
  backdrop-filter: blur(10px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.gatekeeper.is-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-window {
  --borda: var(--line-bright);
  width: 100%;
  max-width: 450px;
  background: var(--panel);
  border: 2px solid var(--borda);
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 4px var(--line),
    0 24px 60px rgba(0, 0, 0, 0.85);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.gate-window.is-error {
  --borda: var(--danger);
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 4px var(--danger),
    0 24px 60px rgba(0, 0, 0, 0.85);
  animation: gate-shake 0.32s ease;
}

.gate-window.is-ok {
  --borda: var(--cyan);
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 4px var(--cyan),
    0 24px 60px rgba(0, 0, 0, 0.85);
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
  85% { transform: translateX(3px); }
}

/* Barra superior estilo W98 do SparDEV */
.gate-bar {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border-bottom: 2px solid var(--borda);
  background: var(--panel);
}

.gate-bar::before {
  content: "";
  position: absolute;
  inset: 4px 72px 4px 42%;
  z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23cfcfdc'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23cfcfdc'/%3E%3C/svg%3E") 0 0 / 2px 2px;
  image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 85%);
  mask-image: linear-gradient(to right, transparent, #000 85%);
}

.gate-bar::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 62px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='62' height='18' fill='none' stroke='%23e9e9f0' stroke-width='1.5'%3E%3Crect x='.75' y='.75' width='18.5' height='16.5'/%3E%3Cpath d='M5 13h10'/%3E%3Crect x='21.75' y='.75' width='18.5' height='16.5'/%3E%3Crect x='26' y='4.5' width='10' height='9'/%3E%3Cpath d='M26 6h10' stroke-width='2.5'/%3E%3Crect x='42.75' y='.75' width='18.5' height='16.5'/%3E%3Cpath d='M47 4.5l10 9M57 4.5l-10 9' stroke-width='2'/%3E%3C/svg%3E") no-repeat;
}

.gate-id {
  font: 11px/1 var(--f-pixel);
  letter-spacing: 0.1em;
  color: var(--dim);
  background: var(--panel);
  padding-right: 6px;
}

.gate-badge {
  font: 10px/1 var(--f-pixel);
  letter-spacing: 0.08em;
  padding: 4px 6px;
  border: 1px solid var(--pink);
  color: var(--pink);
  background: var(--panel);
}

.gate-body {
  padding: 22px 24px 20px;
}

.gate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.gate-title {
  margin: 0;
  font: 900 38px/0.92 var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.gate-title span {
  color: var(--pink);
}

.gate-proto {
  font: 11px/1 var(--f-pixel);
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.gate-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--dim);
}

.gate-form {
  display: grid;
  gap: 12px;
}

.gate-field {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2px 12px;
  transition: border-color 0.15s;
}

.gate-field:focus-within {
  border-color: var(--cyan);
}

.gate-prompt {
  font: 700 13px/1 var(--f-body);
  color: var(--pink);
  margin-right: 10px;
  user-select: none;
}

.gate-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: 14px/1.4 var(--f-body);
  padding: 10px 0;
  letter-spacing: 0.06em;
}

.gate-input:focus {
  outline: none;
}

.gate-input::placeholder {
  color: var(--muted);
  letter-spacing: 0.02em;
}

.gate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.gate-status {
  font: 11px/1.3 var(--f-pixel);
  letter-spacing: 0.06em;
  color: var(--dim);
  min-height: 1.3em;
}

.gate-status.err {
  color: var(--danger);
}

.gate-status.ok {
  color: var(--cyan);
}

.gate-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: 11px/1 var(--f-body);
  color: var(--muted);
}
