/* ==========================================================================
   LPE.OS — Portão de acesso (login)
   --------------------------------------------------------------------------
   Usa os mesmos tokens de assets/css/style.css, então carregue este arquivo
   DEPOIS do style.css. O painel só aparece quando o body recebe .auth-ready
   (feito por assets/js/auth-gate.js após a sessão do Supabase ser confirmada).
   ========================================================================== */

/* Conteúdo do painel escondido enquanto não há sessão.
   visibility (e não display) preserva o layout e evita salto na tela. */
body.requer-login:not(.auth-ready) .shell {
  visibility: hidden;
}

/* ------------------------------------------------------------- Overlay ---- */

#lpeGate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(4, 41, 94, .82) 0%, rgba(2, 27, 66, .94) 60%, rgba(2, 20, 50, .97) 100%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

#lpeGate.is-hidden { display: none; }

/* --------------------------------------------------------------- Card ---- */

.gate-card {
  width: min(400px, 100%);
  padding: 34px 30px 28px;
  border: 1px solid rgba(200, 153, 59, .42);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(2, 20, 50, .42);
  color: var(--text);
  text-align: left;
}

.gate-card__logo {
  display: block;
  width: auto;
  max-width: 190px;
  max-height: 62px;
  margin: 0 auto 22px;
  object-fit: contain;
}

.gate-card__kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.gate-card h1 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--accent);
}

.gate-card__copy {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

/* -------------------------------------------------------------- Campos ---- */

.gate-card label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.gate-card input {
  width: 100%;
  margin: 0 0 16px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.gate-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* -------------------------------------------------------------- Botões ---- */

.gate-submit {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.gate-submit:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.gate-submit:disabled { opacity: .6; cursor: default; }

.gate-link {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.gate-link:hover { color: var(--accent); }

/* -------------------------------------------------------------- Status ---- */

.gate-status {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  color: var(--text-soft);
}

.gate-status.is-error { color: #b3261e; }
.gate-status.is-ok    { color: var(--ok); }

/* ------------------------------------------------- Sessão dentro do painel */

.lpe-session {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.lpe-session__mail {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

.lpe-session__out {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.lpe-session__out:hover { border-color: var(--accent); color: var(--accent); }

/* Etiqueta discreta quando o painel roda local (file:// ou localhost),
   onde o login é dispensado para facilitar o desenvolvimento. */
.lpe-devbadge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 900;
  padding: 5px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
}

@media (max-width: 480px) {
  .gate-card { padding: 28px 22px 24px; }
}
