/* Access gateway + protected-page render guard */

/* Protected pages stay invisible until js/auth.js confirms the session. */
html[data-protected="true"]:not(.kw-auth-ok) body { visibility: hidden; }
html[data-protected="true"]:not(.kw-auth-ok) .kw-noscript { visibility: visible; }
.kw-noscript {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: #121314; color: #e7e9eb; font: 500 1rem/1.5 system-ui, sans-serif; text-align: center; padding: 24px;
}

/* Gateway */
.gate {
  box-sizing: border-box; margin: 0; min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 420px); justify-content: center; align-content: center; padding: 24px;
  background-color: #121314;
  background-image:
    linear-gradient(rgba(180,185,190,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180,185,190,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  color: #e7e9eb;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.gate *, .gate *::before, .gate *::after { box-sizing: border-box; }
.gate__panel {
  width: 100%; max-width: 420px; padding: 32px 28px;
  background: #1a1b1d; border: 1px solid #2f3236; border-top: 2px solid #3fd0ea;
}
.gate__form { margin: 0; }
.gate__label {
  display: block; margin-bottom: 14px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #b4b9be;
}
.gate__row { display: flex; gap: 8px; }
.gate__input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  background: #121314; color: #f3f4f5; border: 1px solid #464a50; border-radius: 0;
  font: inherit; font-size: 1rem; letter-spacing: .08em;
}
.gate__input:focus { outline: 2px solid #3fd0ea; outline-offset: 2px; border-color: #3fd0ea; }
.gate__input[aria-invalid="true"] { border-color: #ff8f7a; }
.gate__btn {
  height: 48px; padding: 0 20px; border: 0; border-radius: 0; cursor: pointer;
  background: #c6f432; color: #121314; font: 600 .95rem/1 inherit; font-family: inherit;
}
.gate__btn:hover { background: #d7fa6a; }
.gate__btn:focus-visible { outline: 2px solid #f3f4f5; outline-offset: 3px; }
.gate__error { min-height: 1.5em; margin: 12px 0 0; color: #ffb3a5; font-size: .92rem; }
@media (max-width: 380px) {
  .gate__row { flex-direction: column; }
  .gate__btn { width: 100%; }
  .gate__input { flex: none; width: 100%; }
}
