/* ==========================================================================
   Anglo-Invest CRM — Login Page Styles
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Background gradient --- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #142952 0%, #264073 40%, #1a6e66 70%, #24A89C 100%);
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 168, 156, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 160, 50, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Card --- */
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
  animation: cardSlideIn 0.5s ease-out;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Logo --- */
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

.logo-img {
  max-width: 180px;
  max-height: 70px;
  object-fit: contain;
}

/* --- Titles --- */
.login-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #142952;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.login-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #6b7a90;
  margin-bottom: 32px;
}

/* --- Error --- */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
  margin-bottom: 20px;
  animation: errorShake 0.4s ease-out;
}

.login-error[hidden] {
  display: none;
}

.login-error svg {
  flex-shrink: 0;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* --- Form fields --- */
.login-field {
  margin-bottom: 20px;
}

.login-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #142952;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.login-field input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  color: #0F1B2D;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.login-field input[dir="ltr"] {
  text-align: left;
  direction: ltr;
}

.login-field input:focus {
  border-color: #24A89C;
  box-shadow: 0 0 0 3px rgba(36, 168, 156, 0.15);
  background: #fff;
}

.login-field input::placeholder {
  color: #9ca3af;
}

/* --- Submit button --- */
.login-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #24A89C, #33B3A6);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(36, 168, 156, 0.35);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-spinner[hidden] {
  display: none;
}

/* --- Spinner animation --- */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Footer --- */
.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.login-footer p {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px 28px;
    border-radius: 12px;
  }

  .login-title {
    font-size: 1.3rem;
  }

  .logo-img {
    max-width: 140px;
  }
}
