/**
 * تصميم مميز لصفحة تسجيل الدخول
 * تصميم احترافي بأسلوب فريد مع تأثيرات متقدمة
 *
 * @version 1.0
 * @author System Developer
 */

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

/* متغيرات CSS */
:root {
  --primary-color: #4c0c70;
  --primary-dark: #3a0956;
  --primary-light: #6d28d9;
  --secondary-color: #0a2744;
  --accent-color: #f8b500;
  --text-color: #ffffff;
  --error-color: #ff5252;
  --success-color: #4caf50;
  --card-bg: rgba(76, 12, 112, 0.85);
  --input-bg: rgba(255, 255, 255, 0.12);
  --input-border: rgba(255, 255, 255, 0.2);
  --button-gradient: linear-gradient(135deg, #4c0c70, #6d28d9);
  --transition-speed: 0.3s;
}

/* تنسيق الجسم */
body.distinctive-login {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  direction: rtl;
  overflow: hidden;
  position: relative;
  font-family: 'Tajawal', sans-serif;
  background-color: var(--primary-dark);
}

/* خلفية متحركة */
.animated-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  z-index: -2;
  overflow: hidden;
}

/* تأثير الدوائر المتحركة */
.circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  z-index: -1;
  animation: float 20s infinite ease-in-out;
}

.circle-1 {
  width: 300px;
  height: 300px;
  top: -150px;
  left: -150px;
  animation-delay: 0s;
}

.circle-2 {
  width: 500px;
  height: 500px;
  bottom: -250px;
  right: -250px;
  animation-delay: 5s;
}

.circle-3 {
  width: 200px;
  height: 200px;
  top: 20%;
  right: 10%;
  animation-delay: 2s;
}

.circle-4 {
  width: 400px;
  height: 400px;
  bottom: 10%;
  left: 5%;
  animation-delay: 7s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
  25% {
    transform: translate(5%, 5%) scale(1.1);
    opacity: 0.6;
  }
  50% {
    transform: translate(0, 10%) scale(1);
    opacity: 0.5;
  }
  75% {
    transform: translate(-5%, 5%) scale(0.9);
    opacity: 0.4;
  }
}

/* تأثير الخطوط المتحركة */
.lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3;
  overflow: hidden;
}

.line {
  position: absolute;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: line-move 15s infinite linear;
}

.line:nth-child(1) {
  top: 20%;
  animation-duration: 15s;
}

.line:nth-child(2) {
  top: 40%;
  animation-duration: 20s;
  animation-delay: 2s;
}

.line:nth-child(3) {
  top: 60%;
  animation-duration: 25s;
  animation-delay: 4s;
}

.line:nth-child(4) {
  top: 80%;
  animation-duration: 30s;
  animation-delay: 6s;
}

@keyframes line-move {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* حاوية النموذج */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 450px;
  padding: 40px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(109, 40, 217, 0.4),
              inset 0 0 15px rgba(255, 255, 255, 0.05);
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: card-appear 1s forwards ease-out;
}

/* العلامة المائية */
.login-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background-image: url('../images/backgrounds/background.png');
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.05;
  transform: translate(-50%, -50%);
  z-index: -1;
  filter: grayscale(100%) contrast(200%);
}

@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(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: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  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: 30px;
  text-align: center;
  animation: logo-appear 1.2s forwards ease-out;
}

.logo-image {
  max-width: 350px;
  height: auto;
  filter: drop-shadow(0 10px 25px rgba(255, 255, 255, 0.3));
  transition: all 0.5s ease;
  transform-origin: center center;
  animation: logo-glow 3s infinite alternate ease-in-out;
}

@keyframes logo-glow {
  0% {
    filter: drop-shadow(0 10px 25px rgba(255, 255, 255, 0.3));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 15px 35px rgba(248, 181, 0, 0.4));
    transform: scale(1.03);
  }
}

@keyframes logo-appear {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* عنوان تسجيل الدخول */
.login-title {
  color: var(--text-color);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 30px;
  position: relative;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  animation: title-appear 1.4s forwards ease-out;
}

.login-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 3px;
}

@keyframes title-appear {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* مجموعة الإدخال */
.input-group {
  position: relative;
  margin-bottom: 25px;
  animation: input-appear 0.6s forwards ease-out;
  animation-fill-mode: both;
  opacity: 0;
}

.input-group:nth-child(1) {
  animation-delay: 0.6s;
}

.input-group:nth-child(2) {
  animation-delay: 0.8s;
}

.input-group:nth-child(3) {
  animation-delay: 1s;
}

@keyframes input-appear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* أيقونة الإدخال */
.input-icon {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  transition: all 0.3s ease;
  pointer-events: none;
}

/* حقول الإدخال */
.login-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  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;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(248, 181, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.login-input:focus::placeholder {
  opacity: 0.8;
  transform: translateX(5px);
}

.login-input:focus + .input-icon {
  color: var(--accent-color);
  transform: translateY(-50%) scale(1.2);
}

/* تذكرني ونسيت كلمة المرور */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  animation: fade-in 1.6s forwards ease-out;
}

.checkbox-container {
  display: flex;
  align-items: center;
}

.auth-checkbox {
  margin-left: 8px;
  cursor: pointer;
}

.forgot-password {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

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

/* رسائل الخطأ والنجاح */
.error-message {
  background-color: rgba(255, 82, 82, 0.2);
  color: #ff5252;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid rgba(255, 82, 82, 0.3);
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.success-message {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  animation: bounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* زر تسجيل الدخول */
.login-button {
  width: 100%;
  padding: 16px;
  background: var(--button-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s ease;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 5px 15px rgba(76, 12, 112, 0.4),
              inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  animation: button-appear 1.8s forwards ease-out;
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6d28d9, #4c0c70);
  z-index: -1;
  transition: opacity 0.4s ease;
  opacity: 0;
}

.login-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(76, 12, 112, 0.5),
              0 0 0 0.5px rgba(255, 255, 255, 0.3);
}

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

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(76, 12, 112, 0.4),
              0 0 0 0.5px rgba(255, 255, 255, 0.2);
}

@keyframes button-appear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* أيقونة الزر */
.button-icon {
  margin-left: 10px;
  transition: all 0.4s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

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

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

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

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

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

  .logo-image {
    max-width: 280px;
  }
}
