/* Modern Login Page Styles */
/* Created for Amoloza Financial Institution Login */

/* Reset and base styles */
* {
  box-sizing: border-box;
}

/* Override any conflicting styles */
.modern-login-wrapper * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.modern-login-wrapper input,
.modern-login-wrapper button,
.modern-login-wrapper form {
  margin: 0 !important;
  font-family: inherit !important;
}

.modern-login-wrapper {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

.modern-login-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1;
}

/* Floating particles effect */
.modern-login-wrapper::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      2px 2px at 20px 30px,
      rgba(255, 255, 255, 0.3),
      transparent
    ),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.3), transparent);
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: particleFloat 20s linear infinite;
  z-index: 1;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
  }
}

/* Main login card */
.login-card {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(15px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
  padding: 40px;
  width: 100%;
  max-width: 450px;
  position: relative;
  z-index: 2;
  margin: 20px;
  transition: all 0.3s ease;
}

.login-card * {
  position: relative;
  z-index: 3;
}

.login-form {
  display: block !important;
  width: 100% !important;
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Header styles */
.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  color: #333;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.login-header p {
  color: #666;
  font-size: 16px;
  margin: 0;
  font-weight: 400;
}

/* Form elements */
.modern-form-group {
  position: relative;
  margin-bottom: 25px;
  z-index: 10;
}

.modern-form-control {
  width: 100% !important;
  padding: 15px 20px !important;
  border: 2px solid #e1e5e9 !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  background: #fff !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  font-family: inherit !important;
  display: block !important;
  box-sizing: border-box !important;
  color: #333 !important;
}

.modern-form-control:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
  transform: translateY(-1px) !important;
}

.modern-form-control.error {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1) !important;
  animation: shake 0.4s ease-in-out !important;
}

.modern-form-control.error:focus {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15) !important;
}

.modern-form-control::placeholder {
  color: #a0a5aa !important;
  transition: color 0.3s ease !important;
}

.modern-form-control:focus::placeholder {
  color: #c0c5ca !important;
}

.modern-form-control.error::placeholder {
  color: #e74c3c !important;
}

/* Input icons */
.input-icon {
  position: absolute !important;
  left: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #a0a5aa !important;
  font-size: 18px !important;
  transition: all 0.3s ease !important;
  z-index: 5 !important;
  pointer-events: none !important;
}

.modern-form-control:focus + .input-icon {
  color: #667eea !important;
  transform: translateY(-50%) scale(1.1) !important;
}

.modern-form-control.error + .input-icon {
  color: #e74c3c !important;
  transform: translateY(-50%) scale(1.1) !important;
}

.has-icon .modern-form-control {
  padding-left: 55px !important;
}

/* Button styles */
.modern-btn {
  width: 100% !important;
  padding: 16px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  color: white !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  margin-top: 10px !important;
  position: relative !important;
  overflow: hidden !important;
  font-family: inherit !important;
  display: block !important;
  text-transform: none !important;
  line-height: normal !important;
  box-shadow: none !important;
}

.modern-btn::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;
}

.modern-btn:hover::before {
  left: 100%;
}

.modern-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4) !important;
  color: white !important;
  text-decoration: none !important;
}

.modern-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3) !important;
}

.modern-btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2) !important;
}

/* Checkbox and links */
.checkbox-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 25px 0 !important;
  font-size: 14px !important;
  flex-wrap: wrap !important;
  gap: 15px !important;
}

.remember-me {
  display: flex !important;
  align-items: center !important;
  color: #666 !important;
  cursor: pointer !important;
  transition: color 0.3s ease !important;
}

.remember-me:hover {
  color: #333 !important;
}

.remember-me input[type="checkbox"] {
  margin-right: 10px !important;
  transform: scale(1.2) !important;
  accent-color: #667eea !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
}

.forgot-link {
  color: #667eea !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  position: relative !important;
}

.forgot-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: #764ba2;
  transition: width 0.3s ease;
}

.forgot-link:hover::after {
  width: 100%;
}

.forgot-link:hover {
  color: #764ba2 !important;
  text-decoration: none !important;
}

/* Footer */
.footer-info {
  text-align: center;
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px solid #e1e5e9;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: #f8f9fa;
  border-radius: 50%;
  color: #666;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.social-link:hover::before {
  opacity: 1;
}

.social-link:hover {
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.social-link i {
  position: relative;
  z-index: 2;
  font-size: 18px;
}

.copyright {
  color: #999;
  font-size: 14px;
  margin: 0;
  font-weight: 400;
}

/* Alert styles */
.alert-modern {
  background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
  border: 1px solid #f5c6cb;
  border-radius: 10px;
  color: #721c24;
  padding: 15px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
  position: relative;
  overflow: hidden;
}

.alert-modern::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: #dc3545;
}

.alert-modern.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c8e6c9 100%);
  border-color: #c3e6cb;
  color: #155724;
}

.alert-modern.alert-success::before {
  background: #28a745;
}

.alert-modern.alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-modern.alert-danger::before {
  background: #dc3545;
}

.alert-modern.show {
  display: block;
  animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-modern i {
  margin-right: 8px;
}

/* Error display */
.error {
  margin-top: 15px;
  padding: 15px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8d7da 0%, #f1c2c7 100%);
  border: 1px solid #f5c6cb;
  color: #721c24;
  display: none;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.error::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: #dc3545;
}

.error.show {
  display: block;
  animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form transitions */
.forget-form {
  display: none;
}

.forget-form.show {
  display: block;
  animation: fadeInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* Loading animation */
.loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 3px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .login-card {
    margin: 15px;
    padding: 30px 25px;
    border-radius: 15px;
  }

  .login-header h1 {
    font-size: 24px;
  }

  .login-header p {
    font-size: 14px;
  }

  .checkbox-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .modern-form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .social-links {
    gap: 12px;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .modern-login-wrapper {
    padding: 20px 10px;
  }

  .login-card {
    margin: 10px;
    padding: 25px 20px;
  }

  .login-header h1 {
    font-size: 22px;
  }

  .modern-form-control {
    padding: 14px 18px;
  }

  .has-icon .modern-form-control {
    padding-left: 50px;
  }

  .input-icon {
    left: 18px;
    font-size: 16px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .login-card {
    border: 2px solid #000;
    background: #fff;
  }

  .modern-form-control {
    border: 2px solid #000;
  }

  .modern-btn {
    background: #000;
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .modern-login-wrapper::after {
    animation: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .login-card {
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
  }

  .login-header h1 {
    color: #fff;
  }

  .login-header p {
    color: #ccc;
  }

  .modern-form-control {
    background: rgba(50, 50, 50, 0.8);
    border-color: #555;
    color: #fff;
  }

  .modern-form-control::placeholder {
    color: #aaa;
  }

  .input-icon {
    color: #aaa;
  }

  .remember-me {
    color: #ccc;
  }

  .footer-info {
    border-top-color: #555;
  }

  .copyright {
    color: #aaa;
  }
}

/* Animation classes */
.animated {
  animation-duration: 0.6s;
  animation-fill-mode: both;
}

.fadeInUp {
  animation-name: fadeInUp;
}
