/* ==========================================================================
   Abertura (splash) + tela de login — réplica da tela original do portal
   ========================================================================== */

/* ---------- splash ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--azul-topo) 0%, var(--azul-meio) 40%, var(--azul-base) 100%);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash.oculta {
  opacity: 0;
  visibility: hidden;
}

.splash img {
  width: min(58vw, 280px);
  filter: drop-shadow(0 0 24px rgba(255, 255, 255, 0.42)) drop-shadow(0 0 68px rgba(255, 255, 255, 0.22));
  animation: surgirMarca 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  will-change: transform, opacity;
}

@keyframes surgirMarca {
  from {
    opacity: 0;
    transform: scale(0.965);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* O cartão de login entra logo atrás da abertura, sem corte brusco. */
.cartao-login,
.versao {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.65s ease 0.12s, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1) 0.12s;
}

body.aberto .cartao-login,
body.aberto .versao {
  opacity: 1;
  transform: none;
}

/* ---------- estrutura da tela de login ---------- */

.tela-login {
  position: relative;
  z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 30px calc(52px + env(safe-area-inset-bottom, 0px));
}

.cartao-login {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--raio-card);
  padding: 25px 20px 23px;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 18px 44px rgba(0, 8, 40, 0.28);
}

.marca-login {
  display: block;
  width: 73%;
  max-width: 236px;
  margin: 6px auto 28px;
}

/* ---------- campos ---------- */

.campo {
  margin-bottom: 22px;
}

.campo label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.caixa-campo {
  position: relative;
}

.campo input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--raio);
  background: rgba(255, 255, 255, 0.1);
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.campo input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
}

.campo input::placeholder {
  color: var(--placeholder);
  font-family: var(--fonte);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  opacity: 1;
}

#ra {
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.campo input[type="password"],
.campo input#senha {
  padding-right: 48px;
}

.olho {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
}

.olho svg {
  width: 22px;
  height: 22px;
}

/* ---------- botão entrar ---------- */

.botao-entrar {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--raio);
  background: linear-gradient(100deg, var(--verde-claro) 0%, #0C7B2F 58%, var(--verde-escuro) 100%);
  box-shadow: 0 8px 20px rgba(4, 70, 24, 0.36);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.12s ease, filter 0.18s ease;
}

.botao-entrar:active {
  transform: scale(0.985);
  filter: brightness(0.94);
}

.botao-entrar[disabled] {
  opacity: 0.72;
  pointer-events: none;
}

.botao-entrar svg {
  width: 22px;
  height: 22px;
}

/* ---------- biometria ---------- */

.bloco-biometria {
  margin-top: 17px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--raio);
  background: rgba(255, 255, 255, 0.07);
}

.bloco-biometria .rotulo {
  flex: 1;
  font-size: 15px;
  line-height: 1.3;
}

.bloco-biometria .digital {
  width: 22px;
  height: 22px;
  flex: none;
  opacity: 0.95;
}

.interruptor {
  position: relative;
  width: 47px;
  height: 27px;
  flex: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: background 0.2s ease;
}

.interruptor::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}

.interruptor[aria-checked="true"] {
  background: var(--verde-claro);
}

.interruptor[aria-checked="true"]::after {
  transform: translateX(20px);
}

/* ---------- atalho de acesso por biometria ---------- */

.botao-biometria {
  width: 100%;
  height: 50px;
  margin-top: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--raio);
  background: rgba(255, 255, 255, 0.1);
  font-size: 16px;
  font-weight: 600;
}

.botao-biometria.visivel {
  display: flex;
}

.botao-biometria svg {
  width: 22px;
  height: 22px;
}

/* ---------- mensagens e rodapé ---------- */

.aviso-erro {
  display: none;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 120, 120, 0.4);
  border-radius: 10px;
  background: rgba(190, 25, 35, 0.28);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

.aviso-erro.visivel {
  display: block;
}

.versao {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  user-select: none; /* três toques aqui abrem o painel administrativo */
}

@media (min-width: 560px) {
  .cartao-login {
    max-width: 400px;
  }
}
