/* Estilos customizados para a tela de login */

/* Background da página */
.login-page {
  background: linear-gradient(135deg, #5673f1 0%, #204eb1 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.05"/><circle cx="10" cy="50" r="0.5" fill="white" opacity="0.05"/><circle cx="90" cy="30" r="0.5" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

/* Container principal */
.login-box {
  width: 400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Logo */
.login-logo {
  text-align: center;
  margin-bottom: 25px;
}

.login-logo a {
  color: white;
  font-size: 35px;
  font-weight: 300;
  text-decoration: none;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.login-logo a:hover {
  color: #f8f9fa;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

/* Card principal */
.card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.login-card-body {
  padding: 40px 35px;
  background: white;
}

/* Mensagem de boas-vindas */
.login-box-msg {
  color: #eee;
  font-size: 16px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 25px;
}

/* Grupos de input */
.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group .form-control {
  border: 2px solid #e9ecef;
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 12px 15px;
  font-size: 16px;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.input-group .form-control:focus {
  border-color: #667eea;
  background-color: white;
  box-shadow: 0 0 0 0.2rem rgba(66, 98, 240, 0.25);
}

.input-group-text {
  background: linear-gradient(135deg, #667eea, #1943b8);
  border: 2px solid transparent;
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: white;
  width: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.input-group .fas {
  font-size: 16px;
}

/* Estados de validação */
.form-control.is-valid {
  border-color: #28a745;
  background-color: #f8fff9;
}

.form-control.is-invalid {
  border-color: #dc3545;
  background-color: #fff8f8;
}

/* Checkbox personalizado */
.icheck-primary input[type="checkbox"] {
  display: none;
}

.icheck-primary label {
  position: relative;
  padding-left: 25px;
  cursor: pointer;
  color: #6c757d;
  font-size: 14px;
}

.icheck-primary label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-radius: 3px;
  background: white;
  transition: all 0.3s ease;
}

.icheck-primary input[type="checkbox"]:checked + label::before {
  background: linear-gradient(135deg, #667eea, #1d4aaa);
  border-color: #667eea;
}

.icheck-primary input[type="checkbox"]:checked + label::after {
  content: "✓";
  position: absolute;
  left: 3px;
  top: 0px;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Botão de login */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #1b3ca8 100%);
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3354f5 0%, #1c42c0 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Spinner no botão */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  margin-left: 5px;
}

/* Links */
a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #764ba2;
  text-decoration: none;
}

/* Alertas */
.alert {
  border: none;
  border-radius: 8px;
  margin-bottom: 20px;
  animation: slideDown 0.3s ease;
}

.alert-danger {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  border-left: 4px solid #dc3545;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 25px;
}

.login-footer p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Seção de autenticação social */
.social-auth-links {
  border-top: 1px solid #e9ecef;
  padding-top: 20px;
  margin-top: 20px;
}

.social-auth-links p {
  margin-bottom: 10px;
  color: #6c757d;
  font-size: 14px;
}

/* Responsividade */
@media (max-width: 576px) {
  .login-box {
    width: 90%;
    margin: 20px auto;
  }

  .login-card-body {
    padding: 30px 25px;
  }

  .login-logo a {
    font-size: 28px;
  }

  .form-control {
    font-size: 16px; /* Evita zoom no iOS */
  }
}

@media (max-width: 400px) {
  .login-box {
    width: 95%;
  }

  .login-card-body {
    padding: 25px 20px;
  }

  .input-group .form-control {
    padding: 10px 12px;
    color: white;
  }

  .btn-primary {
    padding: 10px 15px;
    font-size: 14px;
  }
}

/* Animações de entrada */
.login-box {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efeitos de foco aprimorados */
.form-control:focus {
  transform: translateY(-1px);
}

.input-group:focus-within .input-group-text {
  background: linear-gradient(135deg, #506bf3, #1c3fda);
  transform: scale(1.02);
  color: white;
}

/* Melhorias de acessibilidade */
.form-control:focus {
  outline: none;
}

.btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Preloader opcional */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3c5ae0 0%, #163bdf 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  pointer-events: none;
}
