:root {
  --color-primary: #3d99f5;
  --color-primary-dark: #2a7bc8;
  --color-error: #ff4757;
  --color-success: #4BB543;
  --color-warning: #FFA502;
  --color-text-dark: #0d121c;
  --color-text-medium: #121417;
  --color-text-light: #61758a;
  --color-text-white: #ffffff;
  --color-background-body: #f7fafc;
  --color-background-input: #f0f2f5;
  --color-border: #e5e8eb;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* ================== الهيكل العام ================== */
.login-main {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  background-color: var(--color-background-body);
  overflow-x: hidden;
  flex:1;
}

.login-flex-container {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 30px;
  max-width: 880px;
  width: 100%;
}

/* ================== العمود النصي ================== */
.login-text-side {
  max-width: 420px;
  width: 100%;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 20px;
  animation: fadeIn 0.5s ease;
  align-self: stretch;
}

.login-seo-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 10px;
  line-height: 1.3;
}

.login-seo-paragraph {
  font-size: 16px;
  color: var(--color-text-light);
  line-height: 1.8;
}

/* ================== فورم الدخول ================== */
.login-container {
  align-self: stretch;
  width: 100%;
  max-width: 360px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 18px;
  animation: fadeIn 0.5s ease;
  overflow-y: auto;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 10px;
}

.login-subtitle {
  font-size: 16px;
  color: var(--color-text-light);
  margin: 0;
}

/* ================== التنبيهات ================== */
.alert {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  animation: slideIn 0.3s ease;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.alert-error {
  background-color: rgba(255, 71, 87, 0.1);
  border-left: 4px solid var(--color-error);
}

.alert-success {
  background-color: rgba(75, 181, 67, 0.1);
  border-left: 4px solid var(--color-success);
}

.alert-icon {
  margin-left: 10px;
  display: flex;
}

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

.alert-error .alert-icon svg {
  fill: var(--color-error);
}

.alert-success .alert-icon svg {
  fill: var(--color-success);
}

.alert-content {
  flex: 1;
}

.alert-content p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-dark);
  line-height: 1.5;
}

/* ================== الحقول ================== */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-input {
  width: 100%;
  padding: 11px 20px 6px 40px;
  background: var(--color-background-input);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 14px;  
  color: var(--color-text-dark);
  direction: rtl;
  text-align: right;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(61, 153, 245, 0.2);
}

/* ================== كلمة المرور ================== */
.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  left: 15px;
  top: 60%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  fill: var(--color-text-light);
}

/* ================== الخيارات ================== */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}

.remember-me {
  display: flex;
  align-items: center;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  appearance: none;
  margin-left: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.checkbox-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.checkbox-input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 14px;
  color: var(--color-text-medium);
  cursor: pointer;
}

.forgot-password {
  font-size: 14px;
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}

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

/* ================== زر الدخول ================== */
.btn-submit {
  width: 100%;
  padding: 12px;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  background: var(--color-primary-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.btn-submit span{
  font-weight: 600;
}

.btn-text {
  position: relative;
  z-index: 1;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================== التذييل ================== */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-text-light);
}

.register-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

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

/* ================== تقسيم ================== */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 1.5rem 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider::before {
  content: 'أو';
  position: absolute;
  background: white;
  padding: 0 1rem;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* ================== تسجيل الدخول الاجتماعي ================== */
.login-social-items {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.login-social-items a {
  flex: 1 1 100%;
  max-width: 50%;
}

@media (min-width: 768px) {
  .login-social-items a {
    flex: 1 1 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
  }
}

.google-btn,
.facebook-btn,
.twitter-btn {
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.5;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1rem;
  width: 100%;
}

.google-btn:hover,
.facebook-btn:hover,
.twitter-btn:hover {
  background: var(--color-background-input);
  border-color: var(--color-border);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.google-btn svg,
.facebook-btn svg,
.twitter-btn svg {
  width: 30px;
  height: 30px;
}

/* ================== استجابة ================== */
@media (max-width: 992px) {
  .login-flex-container {
    text-align: center;
    gap: 20px;
  }

  .login-text-side {
    max-width: 100%;
    margin-bottom: 20px;
  }
}

@media (max-width: 600px) {
  .login-container {
    padding: 16px 12px;
    max-width: 100%;
  }

  .login-title {
    font-size: 20px;
  }

  .login-subtitle {
    font-size: 13px;
  }

  .login-text-side {
    padding: 16px;
  }

  .login-flex-container {
    text-align: center;
          flex-direction: column;

    gap: 20px;
  

}
}
@media (max-width: 400px) {
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .toggle-password {
    left: 8px;
  }
}
