/* Tela de acesso (antes do site). Tudo aqui é restrito a #acesso e à classe html.bloqueado,
   então nada deste arquivo muda o visual do site em si. */

html.bloqueado,
html.bloqueado body {
  overflow: hidden;
}

#acesso {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px max(20px, env(safe-area-inset-left)) 24px max(20px, env(safe-area-inset-right));
  background: #111827;
  color: #f1f5f9;
  font: 400 16px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: opacity 0.9s ease, transform 0.9s ease, visibility 0s linear 0.9s;
}

#acesso.saindo {
  opacity: 0;
  transform: scale(1.015);
  visibility: hidden;
  pointer-events: none;
}

#acesso .acesso__form {
  width: min(100%, 22rem);
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

#acesso .acesso__cadeado {
  justify-self: center;
  width: 26px;
  height: 26px;
  color: #94a3b8;
}

#acesso .acesso__titulo {
  margin: 14px 0 0;
  text-align: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.2;
  color: #fff;
}

#acesso .acesso__sub {
  margin: 8px 0 22px;
  text-align: center;
  color: #94a3b8;
}

#acesso label {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #cbd5e1;
}

#acesso input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #475569;
  border-radius: 12px;
  background: transparent;
  color: #f1f5f9;
  font: inherit;
  font-size: 16px; /* 16px evita o zoom automático do iPhone */
  transition: border-color 0.2s;
}

#acesso input::placeholder {
  color: #64748b;
}

#acesso input:hover {
  border-color: #64748b;
}

#acesso input:focus-visible,
#acesso button:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

#acesso input[aria-invalid="true"] {
  border-color: #f87171;
}

#acesso .acesso__erro {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: #fca5a5;
}

#acesso button {
  margin-top: 16px;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: #334155;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

#acesso button:hover:not(:disabled) {
  background: #3f4f66;
}

#acesso button:active:not(:disabled) {
  transform: scale(0.99);
}

#acesso button:disabled {
  cursor: default;
  opacity: 0.7;
}

#acesso .acesso__form.tremer {
  animation: acesso-tremer 0.4s ease;
}

@keyframes acesso-tremer {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  #acesso {
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }
  #acesso.saindo {
    transform: none;
  }
  #acesso .acesso__form.tremer {
    animation: none;
  }
}
