* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto;
}

/* BODY E HTML AJUSTADOS */
html,
body {
  width: 100%;
  min-height: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  overflow-x: hidden;
  overflow-y: auto;
}

/* LOGIN CONTAINER */
.login-container {
  width: 100%;
  max-width: 400px; /* mantém card centralizado e responsivo */
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-direction: column; /* mantém alinhamento correto em mobile */
}

/* LOGIN CARD */
.login-card {
  width: 100%;
  max-width: 360px;
  padding: 40px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  background: #fff;
  animation: fadeIn 0.6s ease;
  box-sizing: border-box; /* garante padding dentro do card */
}
/* LOGO */
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo img {
  width: 120px;
  height: 120px;
  border-radius: 10%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  font-weight: 600;
  color: #333;
}

/* FORM */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  position: relative;
}

input,
select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  transition: 0.2s;
}

input:focus,
select:focus {
  border-color: #4f46e5;
  outline: none;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

/* PASSWORD */
.password-group input {
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
}

/* BUTTON */
.login-btn {
  position: relative;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #4f46e5;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-btn:hover {
  background: #4338ca;
}

/* LOADER */
.loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.login-btn.loading .loader {
  display: block;
}

.login-btn.loading .btn-text {
  opacity: 0.6;
}

/* ERROR */
.login-error {
  color: #dc2626;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

/* FOOTER */
.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #888;
}

/* REGISTER LINK */
.register-link {
  margin-top: 15px;
  text-align: center;
  font-size: 13px;
}

.register-link button {
  background: none;
  border: none;
  color: #4f46e5;
  font-weight: 600;
  cursor: pointer;
}

.register-link button:hover {
  text-decoration: underline;
}

/* ============================= */
/* 🔥 MODAL REGISTRO CORRIGIDO */
/* ============================= */
/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  box-sizing: border-box;
}

.modal.hidden {
  display: none; /* mantém escondido quando fechado */
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 420px;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: fadeIn 0.3s ease;
  margin: 16px auto;
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
  color: #333;
}

/* CLOSE BUTTON */
/* fechar com X */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  background: none;
  border: none;
}
/* animação de scale */
.modal:not(.hidden) .modal-content {
  transform: scale(1);
}

/* FORM LIST */
.data-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* DNI ROW */
.dni-row {
  display: flex;
  gap: 10px;
}

.dni-row select {
  width: 30%;
}

.dni-row input {
  width: 70%;
}

/* BUTTON MODAL */
.modal-content .login-btn {
  margin-top: 15px;
  width: 100%;
}

/* ANIMATIONS */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* animação de fade */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .login-card {
    width: 100%;
    padding: 30px;
  }

  .modal-content {
    padding: 20px;
  }
}
.password-group {
  position: relative;
}

.password-group .toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

/* Fondo de partículas */
.particles {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  top: 0;
  left: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  animation: float linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0);
  }
  50% {
    transform: translateY(50vh) scale(1);
  }
  100% {
    transform: translateY(-10vh) scale(0);
  }
}

/* Corrige o tamanho do campo de data (iOS ignora o CSS normal de input) */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 16px;
  background: #fff;
  color: #333;
}
