/* Admin Login Page - Modern Clean Design */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8edf2 100%);
  padding: 1rem;
  font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

/* Logo and Header Section */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.login-logo {
  width: 200px;
  height: auto;
  max-width: 100%;
  margin-bottom: 1.5rem;
  object-fit: contain;
}

.login-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.login-subtitle {
  font-size: clamp(0.875rem, 3vw, 1rem);
  color: #64748b;
  margin: 0;
  text-align: center;
}

/* Login Card */
.login-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: clamp(1.5rem, 5vw, 2rem);
}

.card-title {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.card-description {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 1.5rem 0;
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.forgot-link {
  font-size: 0.75rem;
  color: #101010;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* Input Field with Icon */
.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.75rem;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition: all 0.15s ease;
  background-color: #ffffff;
  font-family: inherit;
}

.form-input:focus {
  border-color: #101010;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:disabled {
  background-color: #f8fafc;
  cursor: not-allowed;
}

.form-input.with-toggle {
  padding-right: 2.75rem;
}

/* Password Toggle Button */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.password-toggle:hover {
  color: #64748b;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

/* Remember Me Checkbox */
.remember-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.remember-checkbox {
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: #101010;
}

.remember-label {
  font-size: 0.875rem;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
}

/* Submit Button */
.submit-button {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #101010;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  margin-bottom: 1.5rem;
  font-family: inherit;
}

.submit-button:hover:not(:disabled) {
  background-color: #303030;
}

.submit-button:disabled {
  background-color: #606060;
  cursor: not-allowed;
}

/* Divider */
.divider {
  position: relative;
  margin-bottom: 1.5rem;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #e2e8f0;
}

.divider-text {
  position: relative;
  text-align: center;
  background-color: #ffffff;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

/* Ensure divider text centers visually in RTL layouts */
[dir="rtl"] .divider-text {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

/* Social Login Buttons */
.social-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.social-button:hover:not(:disabled) {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.social-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.social-button svg {
  margin-right: 0.5rem;
}

/* Footer */
.login-footer {
  text-align: center;
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 1.5rem;
}

.signup-link {
  color: #101010;
  font-weight: 500;
  text-decoration: none;
}

.signup-link:hover {
  text-decoration: underline;
}

/* Alert Messages */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

/* RTL Support */
[dir="rtl"] .input-icon {
  left: auto;
  right: 12px;
}

[dir="rtl"] .form-input {
  padding: 0.625rem 2.75rem 0.625rem 0.75rem;
}

[dir="rtl"] .password-toggle {
  right: auto;
  left: 12px;
}

[dir="rtl"] .remember-checkbox {
  margin-right: 0;
  margin-left: 0.5rem;
}

[dir="rtl"] .social-button svg {
  margin-right: 0;
  margin-left: 0.5rem;
}

/* Arabic Language Specifics */
html[lang="ar"] .login-title,
html[lang="ar"] .card-title,
html[lang="ar"] .form-label,
html[lang="ar"] .submit-button,
html[lang="ar"] .social-button {
  font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Responsive Design */
@media (max-width: 480px) {
  body.login-page {
    padding: 0.5rem;
  }

  .login-card {
    padding: 1.25rem;
  }

  .login-header {
    margin-bottom: 1.5rem;
  }

  .login-logo {
    width: 150px;
    margin-bottom: 1rem;
  }
}

/* Loading State */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

[dir="rtl"] .loading-spinner {
  margin-right: 0;
  margin-left: 0.5rem;
}
