/* Reset e estrutura base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #2a5298, #1e3c72);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Container principal */
.login-container {
  background-color: #fff;
  padding: 2.5rem 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 450px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Efeito de brilho sutil no container */
.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.login-container:hover::before {
  left: 100%;
}

/* Título */
h2 {
  margin: 0 0 2rem 0;
  color: #1e3c72;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

/* Formulário */
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Grupos de campos para melhor organização */
.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #1e3c72;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.form-group label.required::after {
  content: " *";
  color: #e74c3c;
  font-weight: bold;
}

/* Inputs */
form input {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  border: 2px solid #e1e8ed;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  background-color: #fff;
}

form input:focus {
  outline: none;
  border-color: #1e3c72;
  box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
  transform: translateY(-1px);
}

form input:hover {
  border-color: #1e3c72;
}

/* Estados de validação */
form input.valid {
  border-color: #27ae60;
}

form input.invalid {
  border-color: #e74c3c;
}

/* Botão */
form button {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

form button:hover {
  background: linear-gradient(135deg, #16335e, #1e3c72);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 60, 114, 0.3);
}

form button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(30, 60, 114, 0.2);
}

form button:disabled {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Container para checkbox "Lembrar-me" */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  text-align: left;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  transform: scale(1.2);
  accent-color: #1e3c72;
}

.checkbox-group label {
  margin: 0;
  color: #555;
  font-weight: 500;
  cursor: pointer;
}

/* Mensagens de erro e sucesso */
.error-message {
  color: #e74c3c;
  background-color: #ffeaea;
  border: 1px solid #f5c6cb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  animation: shake 0.5s ease-in-out;
  display: none; /* Oculto por padrão */
}

.error-message.show {
  display: block;
}

.success-message {
  color: #27ae60;
  background-color: #eafaf1;
  border: 1px solid #c3e6cb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  display: none; /* Oculto por padrão */
}

.success-message.show {
  display: block;
}

/* Links auxiliares */
.form-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-links a {
  color: #1e3c72;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.form-links a:hover {
  color: #2a5298;
  text-decoration: underline;
}

/* Divider */
.divider {
  margin: 1.5rem 0;
  text-align: center;
  position: relative;
  color: #7f8c8d;
  font-size: 0.9rem;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #e1e8ed;
}

.divider span {
  background-color: white;
  padding: 0 1rem;
}

/* Animações */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Loading state para o botão */
.loading {
  position: relative;
  color: transparent;
}

.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .login-container {
    padding: 2rem 1.5rem;
    max-width: 400px;
  }

  h2 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  form button {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 1.5rem 1rem;
    margin: 0 0.5rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  form input {
    padding: 0.75rem;
  }

  .form-links {
    margin-top: 1rem;
  }
}