.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container::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 1000 1000\"><polygon fill=\"%23ffffff10\" points=\"0,1000 1000,0 1000,1000\"/></svg>') no-repeat;
  background-size: cover;
}

/* Login Wrapper */
.login-wrapper {
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 0.6s ease-out;
}

/* Login Card */
.login-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  padding: 40px 35px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo-container {
  margin-bottom: 20px;
}

.logo {
  /* max-width: 80px; */
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 8px;
}

.login-subtitle {
  color: #718096;
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

/* Form Styles */
.login-form {
  margin-top: 10px;
}

.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
  text-align: right;
}

.input-field {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f8fafc;
  text-align: right;
  direction: rtl;
  box-sizing: border-box;
}

.input-field:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Password Field Container */
.password-field-container {
  position: relative;
  width: 100%;
}

.password-input {
  padding-right: 110px; /* Space for toggle button inside the field */
  width: 100%;
}

/* Password Toggle Button - Inside the input field */
.password-toggle-btn {
  position: absolute;
  left: 8px; /* Position inside the input field on left side */
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #718096;
  cursor: pointer;
  padding: 6px 8px;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 70px;
  justify-content: center;
  direction: rtl;
  border-radius: 6px;
  height: 32px;
}

.password-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #4a5568;
}

.password-toggle-btn:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.08);
}

.password-toggle-btn.active {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

.password-toggle-btn.active:hover {
  background: rgba(102, 126, 234, 0.15);
}

.password-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.password-toggle-btn:hover .password-icon {
  transform: scale(1.1);
}

.password-toggle-text {
  font-size: 12px;
  font-weight: 600;
}

/* Pulse animation for toggle */
.password-toggle-btn.pulse {
  animation: pulse 0.3s ease;
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Button Loader */
.btn-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.footer-text {
  color: #718096;
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
  text-align: center;
}

/* Form Error */
.form-error {
  color: #e53e3e;
  font-size: 14px;
  margin-top: 5px;
  display: block;
  text-align: right;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.05); }
  100% { transform: translateY(-50%) scale(1); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 480px) {
  .login-card {
    padding: 30px 25px;
    margin: 10px;
  }
  
  .login-title {
    font-size: 24px;
  }
  
  .input-field {
    padding: 12px 16px;
  }
  
  .password-toggle-btn {
    min-width: 65px;
    padding: 5px 6px;
    font-size: 11px;
    height: 28px;
  }
  
  .password-input {
    padding-right: 95px;
  }
  
  .password-toggle-text {
    font-size: 11px;
  }
  
  .password-icon {
    font-size: 14px;
  }
}

/* RTL Specific Adjustments */
html[dir="rtl"] .password-input {
  padding-right: 110px;
  padding-left: 20px;
}

html[dir="rtl"] .password-toggle-btn {
  left: 8px;
  right: auto;
}

html[dir="rtl"] .btn-loader {
  margin-right: 8px;
  margin-left: 0;
}

/* Ensure all text is properly aligned for RTL */
.login-title,
.login-subtitle,
.form-label,
.footer-text,
.password-toggle-text {
  text-align: right;
  direction: rtl;
}

/* Fix for form fields in RTL */
.form-control {
  text-align: right;
  direction: rtl;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .password-toggle-btn {
    border: 1px solid #718096;
  }
  
  .input-field {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .password-toggle-btn,
  .input-field,
  .login-btn {
    transition: none;
  }
  
  .pulse {
    animation: none;
  }
}

/* SweetAlert Customization */
.swal-title-ar {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
  text-align: right;
  direction: rtl;
}

.swal-text-ar {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-align: right;
  direction: rtl;
}