/**
 * أنماط صفحات تسجيل الدخول المحسنة
 * تصميم حديث مع تأثيرات متقدمة
 */

/* إعادة تعيين عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

/* متغيرات CSS */
:root {
  --primary-color: #4776E6;
  --secondary-color: #8E54E9;
  --accent-color: #FF9966;
  --text-color: #ffffff;
  --error-color: #ff4757;
  --success-color: #2ed573;
  --bg-opacity: 0.7;
  --card-bg: rgba(15, 14, 71, var(--bg-opacity));
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --input-focus-bg: rgba(255, 255, 255, 0.15);
  --button-gradient: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  --hover-gradient: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
  --transition-speed: 0.3s;
}

/* تنسيق الجسم */
body.modern-auth {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(-45deg, #0f0e47, #1a237e, #283593, #1565c0);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  direction: rtl;
  overflow: hidden;
  position: relative;
}

/* تحريك الخلفية */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* طبقة الجزيئات */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.2);
  animation: float 8s infinite ease-in-out;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-20px) translateX(10px);
  }
  50% {
    transform: translateY(0) translateX(20px);
  }
  75% {
    transform: translateY(20px) translateX(10px);
  }
}

/* حاوية النموذج */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 550px; /* تم زيادة العرض من 480px إلى 550px */
  padding: 40px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
  overflow: hidden;
  transition: all 0.5s ease;
}

/* تأثير الإضاءة على الحاوية */
.auth-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  transform: rotate(30deg);
  z-index: -1;
}

/* زر الإغلاق */
.close-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  z-index: 2;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* شعار الشركة */
.company-logo {
  margin-bottom: 35px; /* تم زيادة المسافة من 25px إلى 35px */
  text-align: center;
}

.logo-image {
  max-width: 350px; /* تم زيادة الحجم من 280px إلى 350px */
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transition: all 0.5s ease;
  border-radius: 10px;
}

.logo-image:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.5));
}

/* عنوان النموذج */
.auth-title {
  font-size: 28px;
  color: var(--text-color);
  margin-bottom: 30px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  display: inline-block;
}

.auth-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 3px;
}

/* مجموعة الحقول */
.input-group {
  position: relative;
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

/* حقول الإدخال */
.auth-input {
  width: 100%;
  padding: 15px 15px 15px 45px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-color);
  font-size: 16px;
  transition: all 0.3s ease;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.auth-input:focus {
  outline: none;
  background: var(--input-focus-bg);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 15px rgba(71, 118, 230, 0.3);
}

/* أيقونات الحقول */
.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  transition: all 0.3s ease;
}

.auth-input:focus + .input-icon {
  color: var(--primary-color);
}

/* مجموعة التذكر ونسيان كلمة المرور */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  color: var(--text-color);
  font-size: 14px;
}

/* تنسيق خانة الاختيار */
.checkbox-container {
  display: flex;
  align-items: center;
}

.auth-checkbox {
  margin-left: 8px;
  appearance: none;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.auth-checkbox:checked::before {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
}

/* رابط نسيان كلمة المرور */
.forgot-password {
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.forgot-password::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-color);
  transition: width 0.3s ease;
}

.forgot-password:hover::after {
  width: 100%;
}

/* رسائل الخطأ والنجاح */
.message {
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.error-message {
  background: rgba(255, 71, 87, 0.2);
  color: var(--error-color);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.success-message {
  background: rgba(46, 213, 115, 0.2);
  color: var(--success-color);
  border: 1px solid rgba(46, 213, 115, 0.3);
}

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

/* زر تسجيل الدخول */
.auth-button {
  width: 100%;
  padding: 15px;
  background: var(--button-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 25px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.auth-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--hover-gradient);
  z-index: -1;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.auth-button:hover::before {
  opacity: 1;
}

.auth-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.auth-button:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* رابط التبديل بين تسجيل الدخول وإنشاء حساب */
.auth-switch {
  color: var(--text-color);
  font-size: 14px;
  margin-top: 10px;
}

.auth-switch a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  margin-right: 5px;
  transition: all 0.3s ease;
  position: relative;
}

.auth-switch a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.auth-switch a:hover::after {
  width: 100%;
}

/* مؤشر الإصدار */
.version-indicator {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

/* أيقونة إظهار/إخفاء كلمة المرور */
.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

/* أيقونة الزر */
.button-icon {
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.auth-button:hover .button-icon {
  transform: translateX(-3px);
}

/* تأثير التموج للزر */
.ripple {
  position: absolute;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* نافذة نسيت كلمة المرور */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: var(--error-color);
  transform: rotate(90deg);
}

.modal-content h3 {
  color: var(--text-color);
  margin-bottom: 15px;
  font-size: 22px;
  text-align: center;
}

.modal-content p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}

/* تصميم متجاوب */
@media (max-width: 480px) {
  .auth-container {
    max-width: 90%;
    padding: 30px 20px;
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-input {
    padding: 12px 12px 12px 40px;
    font-size: 14px;
  }

  .input-icon {
    font-size: 16px;
  }

  .modal-content {
    padding: 20px;
  }
}
