/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Animation */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(40, 167, 69, 0.1) 0%,
    rgba(255, 152, 0, 0.1) 25%,
    rgba(102, 126, 234, 0.1) 50%,
    rgba(118, 75, 162, 0.1) 75%,
    rgba(40, 167, 69, 0.1) 100%
  );
  animation: gradientShift 20s ease-in-out infinite;
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float 20s infinite linear;
}

.shape-1 {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #28a745, #20c997);
  top: 10%;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 25s;
}

.shape-2 {
  width: 120px;
  height: 120px;
  background: linear-gradient(45deg, #ff9800, #ff6b35);
  top: 60%;
  left: 80%;
  animation-delay: -5s;
  animation-duration: 30s;
}

.shape-3 {
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #28a745, #ff9800);
  top: 80%;
  left: 20%;
  animation-delay: -10s;
  animation-duration: 35s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  background: linear-gradient(45deg, #20c997, #28a745);
  top: 20%;
  left: 70%;
  animation-delay: -15s;
  animation-duration: 28s;
}

.shape-5 {
  width: 140px;
  height: 140px;
  background: linear-gradient(45deg, #ff6b35, #ff9800);
  top: 50%;
  left: 5%;
  animation-delay: -20s;
  animation-duration: 32s;
}

.shape-6 {
  width: 90px;
  height: 90px;
  background: linear-gradient(45deg, #ff9800, #28a745);
  top: 30%;
  left: 50%;
  animation-delay: -12s;
  animation-duration: 26s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) translateX(10px) rotate(90deg);
  }
  50% {
    transform: translateY(-10px) translateX(-10px) rotate(180deg);
  }
  75% {
    transform: translateY(-30px) translateX(5px) rotate(270deg);
  }
}

@keyframes gradientShift {
  0%,
  100% {
    background: linear-gradient(
      135deg,
      rgba(40, 167, 69, 0.1) 0%,
      rgba(255, 152, 0, 0.1) 100%
    );
  }
  50% {
    background: linear-gradient(
      135deg,
      rgba(255, 152, 0, 0.1) 0%,
      rgba(40, 167, 69, 0.1) 100%
    );
  }
}

/* Main Login Wrapper */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

/* Decorative Elements */
.decoration {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  opacity: 0.05;
  pointer-events: none;
}

.decoration-left {
  top: 10%;
  left: -5%;
  background: linear-gradient(45deg, #28a745, #20c997);
  animation: pulse 4s ease-in-out infinite;
}

.decoration-right {
  bottom: 10%;
  right: -5%;
  background: linear-gradient(45deg, #ff9800, #ff6b35);
  animation: pulse 4s ease-in-out infinite reverse;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.05;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}

/* Login Container */
.login-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 8px 25px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  animation: containerEntry 0.8s ease-out;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(40, 167, 69, 0.1) 50%,
    transparent 100%
  );
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes containerEntry {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Header Section */
.login-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.logo {
  width: 100%;
  height: 100px;
  border-radius: 10%;
  box-shadow: 0 8px 30px rgba(40, 167, 69, 0.3);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.logo:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(40, 167, 69, 0.4);
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle,
    rgba(40, 167, 69, 0.3) 0%,
    transparent 70%
  );
  border-radius: 50%;
  animation: logoGlow 2s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes logoGlow {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

.title {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #28a745 0%, #ff9800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #6c757d;
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 20px;
}

.header-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #28a745, #ff9800);
  margin: 0 auto;
  border-radius: 2px;
  animation: lineGrow 1s ease-out 0.5s both;
}

@keyframes lineGrow {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 60px;
    opacity: 1;
  }
}

/* Alert Styles */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  animation: alertSlide 0.5s ease-out;
}

.alert-danger {
  background: linear-gradient(135deg, #ffe6e6, #fff5f5);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.alert-success {
  background: linear-gradient(135deg, #e6f7e6, #f0fdf0);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

@keyframes alertSlide {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Styles */
.login-form {
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 28px;
  position: relative;
}

.input-container {
  position: relative;
  background: rgba(248, 249, 250, 0.8);
  border-radius: 16px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  overflow: hidden;
}

.input-container:hover {
  background: rgba(248, 249, 250, 1);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.input-container.focused {
  background: rgba(255, 255, 255, 0.95);
  border-color: #28a745;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
}

.input-container.focused .input-label {
  transform: translateY(-30px) scale(0.85);
  color: #28a745;
}

.input-container.focused .input-icon i {
  color: #28a745;
}

.input-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.input-icon i {
  font-size: 1.1rem;
  color: #6c757d;
  transition: all 0.3s ease;
}

.input-field {
  width: 100%;
  padding: 30px 20px 20px 55px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  outline: none;
  position: relative;
  z-index: 1;
}

.input-field::placeholder {
  color: transparent;
}

.input-label {
  position: absolute;
  left: 55px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 1rem;
  font-weight: 500;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

.input-border {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #28a745, #ff9800);
  transform: translateX(-50%);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.input-container.focused .input-border {
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  z-index: 2;
  padding: 5px;
  border-radius: 50%;
}

.password-toggle:hover {
  color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 50%, #ff9800 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.login-btn:hover {
  background-position: 100% 0;
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(40, 167, 69, 0.4);
}

.login-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transition: left 0.5s ease;
}

.login-btn:hover::before {
  left: 100%;
}

.btn-text {
  transition: all 0.3s ease;
}

.btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.btn-icon {
  transition: all 0.3s ease;
}

.login-btn:hover .btn-icon {
  transform: translateX(5px);
}

.login-btn.loading .btn-text,
.login-btn.loading .btn-icon {
  opacity: 0;
}

.login-btn.loading .btn-loader {
  opacity: 1;
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 20px;
}

.footer-text {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-text i {
  color: #28a745;
}

/* Performance optimizations */
.login-container,
.input-container,
.login-btn {
  will-change: transform;
}

.floating-shapes .shape {
  will-change: transform;
}

/* Accessibility improvements */
.login-btn:focus {
  outline: 3px solid rgba(40, 167, 69, 0.3);
  outline-offset: 2px;
}

.input-field:focus {
  outline: none;
}

.password-toggle:focus {
  outline: 2px solid rgba(40, 167, 69, 0.3);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .floating-shapes .shape,
  .logo-glow,
  .decoration {
    animation: none;
  }

  .login-container::before {
    display: none;
  }

  .gradient-overlay {
    animation: none;
  }
}
