/* ============================================
   Overlay de Login - ContadJus
   ============================================ */

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f5f7fa;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Estado oculto (usuário autenticado) */
.auth-overlay.auth-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Estado visível (padrão) */
.auth-overlay.auth-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Container do formulário */
.auth-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  padding: 48px 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

/* Logo / Identidade */
.auth-logo {
  margin-bottom: 24px;
}
.auth-logo h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a2b4c;
  letter-spacing: -0.5px;
  margin: 0;
}
.auth-logo p {
  font-size: 0.95rem;
  color: #6b7a8f;
  margin-top: 4px;
}

/* Formulário */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.auth-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d3e5f;
  display: block;
  margin-bottom: 4px;
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s;
  background: #fafbfc;
  box-sizing: border-box;
}
.auth-form input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #ffffff;
}

.auth-btn {
  background: #1a2b4c;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 6px;
}
.auth-btn:hover {
  background: #2d3e5f;
}
.auth-btn:active {
  transform: scale(0.97);
}
.auth-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.auth-forgot {
  text-align: center;
  margin-top: 8px;
}
.auth-forgot a {
  color: #3b82f6;
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
}
.auth-forgot a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
  margin-bottom: 8px;
  text-align: center;
}
.auth-error.show {
  display: block;
}

.auth-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Botão de Logout (simples, sem flutuação complexa) */
.auth-logout-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: #1a2b4c;
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background 0.2s;
  display: none; /* só aparece quando logado */
}
.auth-logout-btn:hover {
  background: #2d3e5f;
}
.auth-logout-btn.visible {
  display: block;
}

/* Responsividade */
@media (max-width: 480px) {
  .auth-container {
    padding: 32px 24px;
  }
  .auth-logo h1 {
    font-size: 1.8rem;
  }
}