/* تصميم زجاجي لصفحة تسجيل الدخول */

:root {
    --primary-gradient: linear-gradient(135deg, #1E40AF 0%, #0066CC 100%);
    --secondary-gradient: linear-gradient(135deg, #003366 0%, #0A2463 100%);
    --royal-blue-dark: #002050;
    --royal-blue-medium: #0047AB;
    --royal-blue-light: #4169E1;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 51, 102, 0.37);
    --text-color: #ffffff;
    --text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-focus: rgba(255, 255, 255, 0.3);
    --button-bg: rgba(255, 255, 255, 0.2);
    --button-hover: rgba(255, 255, 255, 0.3);
    --transition: all 0.3s ease;
}

/* تصميم الصفحة الرئيسي */
.login-container {
    min-height: calc(100vh - 76px);
    /* ارتفاع الشاشة ناقص ارتفاع الناف بار */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--royal-blue-medium) 0%, var(--royal-blue-dark) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* خلفية متحركة */
.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.8) 0%, rgba(0, 32, 80, 0.8) 100%);
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.bg-circle:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
    background: linear-gradient(135deg, #1E40AF 0%, #0066CC 100%);
}

.bg-circle:nth-child(2) {
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -200px;
    animation-delay: 5s;
    background: linear-gradient(135deg, #0066CC 0%, #003366 100%);
}

.bg-circle:nth-child(3) {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.1);
    }
}

/* بطاقة تسجيل الدخول الزجاجية */
.glass-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 40px;
    color: var(--text-color);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* تأثير الانعكاس على البطاقة */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    animation: reflectLight 8s infinite linear;
    z-index: -1;
}

/* تحسينات خاصة للأجهزة المحمولة */
.mobile-view .glass-card {
    max-width: 95%;
    border-radius: 15px;
    padding: 25px 20px;
}

.mobile-view .login-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.mobile-view .login-subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.mobile-view .form-floating {
    margin-bottom: 15px;
}

.mobile-view .form-control {
    padding: 12px 15px;
    border-radius: 8px;
    height: 50px;
    font-size: 16px;
    /* منع تكبير iOS عند التركيز */
}

.mobile-view .form-floating label {
    padding: 12px 15px;
}

.mobile-view .input-icon,
.mobile-view .password-toggle {
    right: 12px;
}

.mobile-view .form-check {
    margin-bottom: 15px;
}

.mobile-view .form-check-input {
    width: 20px;
    height: 20px;
}

.mobile-view .form-check-label {
    font-size: 1rem;
}

.mobile-view .forgot-password {
    font-size: 1rem;
    margin-bottom: 15px;
}

.mobile-view .login-btn {
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
    height: 50px;
}

/* تعديلات RTL للهواتف */
html[dir="rtl"] .mobile-view .input-icon,
html[dir="rtl"] .mobile-view .password-toggle {
    right: auto;
    left: 12px;
}

html[dir="rtl"] .mobile-view .form-check-input {
    margin-left: 0;
    margin-right: 0;
}

html[dir="rtl"] .mobile-view .forgot-password {
    text-align: right;
}

@keyframes reflectLight {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* عنوان النموذج */
.login-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: var(--text-shadow);
}

/* وصف النموذج */
.login-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
    text-align: center;
    opacity: 0.8;
}

/* حقول الإدخال */
.form-floating {
    margin-bottom: 20px;
    position: relative;
}

.form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-color);
    padding: 15px 20px;
    height: auto;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    background: var(--input-focus);
    border-color: var(--input-border);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.form-floating label {
    color: var(--text-color);
    opacity: 0.8;
    padding: 15px 20px;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    opacity: 1;
}

/* أيقونات الحقول */
.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.7;
    z-index: 2;
}

/* زر إظهار/إخفاء كلمة المرور */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-color);
    opacity: 0.7;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition);
}

.password-toggle:hover {
    opacity: 1;
}

/* خانة "تذكرني" */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.form-check-label {
    font-size: 0.9rem;
    cursor: pointer;
}

/* رابط "نسيت كلمة المرور" */
.forgot-password {
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    display: block;
    text-align: left;
    margin-bottom: 20px;
}

.forgot-password:hover {
    opacity: 1;
    text-decoration: underline;
}

/* زر تسجيل الدخول */
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--royal-blue-medium) 0%, var(--royal-blue-dark) 100%);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--royal-blue-light) 0%, var(--royal-blue-medium) 100%);
}

.login-btn:hover::before {
    left: 100%;
}

/* حالة التحميل للزر */
.login-btn.loading {
    background: linear-gradient(135deg, var(--royal-blue-dark) 0%, var(--royal-blue-medium) 100%);
    pointer-events: none;
}

.spinner {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* رسائل التحقق */
.validation-message {
    color: #ffcccc;
    font-size: 0.85rem;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* تأثيرات الحركة */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تأخير الحركة */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* تجاوب مع الشاشات المختلفة */
@media (max-width: 768px) {

    .glass-card {
        padding: 35px 25px;
        max-width: 90%;
    }

    .login-title {
        font-size: 2rem;
    }

    .login-subtitle {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    /* تحسين حجم الحقول للأجهزة اللمسية */
    .form-control {
        padding: 14px 18px;
        font-size: 16px;
        /* منع تكبير iOS عند التركيز */
    }

    .form-floating label {
        padding: 14px 18px;
    }

    /* تحسين زر تسجيل الدخول */
    .login-btn {
        padding: 14px;
        font-size: 1.1rem;
        margin-top: 10px;
    }

    /* تقليل تأثيرات الحركة */
    .bg-circle {
        filter: blur(40px);
    }
}

/* الهواتف الصغيرة */
@media (max-width: 576px) {
    .glass-card {
        padding: 25px 20px;
        max-width: 95%;
        border-radius: 15px;
    }

    .login-title {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .login-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    /* تحسين الحقول للشاشات الصغيرة */
    .form-floating {
        margin-bottom: 15px;
    }

    .form-control {
        padding: 12px 15px;
        border-radius: 8px;
        height: 50px;
    }

    .form-floating label {
        padding: 12px 15px;
    }

    /* تحسين موضع أيقونات الحقول */
    .input-icon,
    .password-toggle {
        right: 12px;
    }

    /* تحسين خانة التذكر */
    .form-check {
        margin-bottom: 15px;
    }

    .form-check-input {
        width: 20px;
        height: 20px;
    }

    .form-check-label {
        font-size: 1rem;
    }

    /* تحسين رابط نسيت كلمة المرور */
    .forgot-password {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    /* تحسين زر تسجيل الدخول */
    .login-btn {
        padding: 12px;
        font-size: 1rem;
        border-radius: 8px;
        height: 50px;
    }

    /* تقليل تأثيرات الحركة للأداء الأفضل */
    .bg-circle {
        filter: blur(30px);
    }

    /* تعديلات RTL للهواتف */
    html[dir="rtl"] .input-icon,
    html[dir="rtl"] .password-toggle {
        right: auto;
        left: 12px;
    }

    html[dir="rtl"] .form-check-input {
        margin-left: 0;
        margin-right: 0;
    }

    html[dir="rtl"] .forgot-password {
        text-align: right;
    }
}

/* الهواتف الصغيرة جداً */
@media (max-width: 380px) {
    .login-container {
        padding: 10px;
    }

    .glass-card {
        padding: 20px 15px;
    }

    .login-title {
        font-size: 1.6rem;
    }

    .login-subtitle {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }

    .form-control {
        height: 48px;
    }

    .login-btn {
        height: 48px;
    }
}