/* Login Page Animations */

/* Fade in background */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Main container fade and slide up */
#page_login {
  animation: fadeIn 0.8s ease-out 0.2s both;
  min-height: 100vh;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Login form zoom in with bounce */
form[name="login"] {
  animation: zoomInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.4s both;
  max-width: 400px;
  width: 100%;
}

@keyframes zoomInBounce {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Form elements slide in from left */
.form-group {
  animation: slideInLeft 0.5s ease-out both;
}

.form-group:nth-child(1) {
  animation-delay: 0.6s;
}

.form-group:nth-child(2) {
  animation-delay: 0.7s;
}

.form-group:nth-child(3) {
  animation-delay: 0.8s;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Button fade in and pulse */
button[type="submit"] {
  animation: fadeInPulse 0.6s ease-out 0.9s both;
  transition: all 0.3s ease;
}

@keyframes fadeInPulse {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Button hover effect */
button[type="submit"]:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

button[type="submit"]:active {
  transform: translateY(0) scale(0.98);
}

/* Alert messages slide down */
.alert {
  animation: slideDown 0.5s ease-out 0.5s both;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Input focus animation */
input.form-control {
  transition: all 0.3s ease;
}

input.form-control:focus {
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

/* Form shadow pulse on hover */
form[name="login"]:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
  transition: box-shadow 0.3s ease;
}

/* Floating animation for form */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Optional: Add subtle floating effect after initial load */
form[name="login"] {
  animation: zoomInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.4s both,
             float 3s ease-in-out 2s infinite;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  form[name="login"] {
    animation: fadeIn 0.01ms !important;
  }
}
