/* ============================================
   Nexa Warehouse ERP - Login Page Styles
   RTL + Persian + Responsive
   ============================================ */

/* Login Page Container */
.login-page {
  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;
}

/* Animated Background Shapes */
.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  background: white;
  animation: float 6s ease-in-out infinite;
}

.login-page::before {
  width: 300px;
  height: 300px;
  top: -50px;
  right: -50px;
  animation-delay: 0s;
}

.login-page::after {
  width: 200px;
  height: 200px;
  bottom: -30px;
  left: -30px;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* Login Container */
.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  animation: slideUp 0.6s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Login Card */
.login-card {
  background: var(--bg-secondary);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Login Header
   A saturated indigo→violet, deeper than the page behind it, so the card reads as the
   solid thing on the screen.

   It used to be lighter than the page (#8b9df8 → #b39dfa). That was a reaction to the
   original colour fighting the text, but it overshot: white on #b39dfa lands at about
   2.3:1, well under the 4.5:1 needed to read comfortably. The stops below sit at
   6.3:1 and 5.4:1 — vivid and legible at the same time, which the pale version could
   not be. */
.login-header {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  padding: 40px 32px 32px;
  text-align: center;
  color: var(--text-white);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

/* The viewBox is now cropped to the artwork, so this width is the logo's real width —
   240px would render it nearly twice its former size. Shadow kept soft: on a deep
   background it is there for a little lift, not for legibility. */
.login-logo svg {
  width: 172px;
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 2px 8px rgba(23, 12, 61, 0.28));
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* Login Body */
.login-body {
  padding: 40px 32px;
}

/* Form Styles */
.login-form .form-group {
  margin-bottom: 24px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 18px;
  pointer-events: none;
  transition: var(--transition);
}

.form-input.with-icon {
  padding-right: 48px;
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
  color: var(--primary-color);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--primary-color);
}

/* Remember Me & Forgot Password */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.checkbox-wrapper label {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.forgot-password {
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 500;
}

.forgot-password:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-white);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-btn .btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.login-btn.loading .btn-spinner {
  display: block;
}

.login-btn.loading .btn-text {
  margin-right: 8px;
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-light);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.login-divider span {
  padding: 0 16px;
}

/* Footer */
.login-footer {
  text-align: center;
  padding: 20px 32px 32px;
  color: var(--text-secondary);
  font-size: 13px;
}

.login-footer a {
  color: var(--primary-color);
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Error Message */
.login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  gap: 10px;
  border-right: 4px solid var(--danger-color);
  animation: shake 0.4s ease;
}

.login-error.show {
  display: flex;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Success Message */
.login-success {
  background: #d1fae5;
  color: #065f46;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  gap: 10px;
  border-right: 4px solid var(--success-color);
  animation: slideUp 0.4s ease;
}

.login-success.show {
  display: flex;
}

/* Login Link */
.login-link {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 480px) {
  .login-header {
    padding: 32px 24px 24px;
  }
  
  .login-logo svg {
    width: 200px;
  }
  
  .login-title {
    font-size: 20px;
  }
  
  .login-body {
    padding: 32px 24px;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  .login-container {
    margin: 10px;
  }
  
  .login-header {
    padding: 24px 20px 20px;
  }
  
  .login-body {
    padding: 24px 20px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Can be extended if needed */
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}