/* assets/css/pages/auth.css */

/* =========================================
   1. إعدادات الصفحة الأساسية لمنع السكرول
========================================= */
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh; /* الحل السحري لدعم شاشات اللاب توب */
    overflow: hidden; /* منع أي سكرول خارجي */
    font-family: 'Changa', sans-serif;
}

/* --- الحاوية الرئيسية (مقسومة نصفين) --- */
.login-split-section {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    background: #F8F5F2;
    overflow: hidden;
}

/* --- الجانب الأيسر (الصورة) --- */
.login-image-side {
    position: relative;
    flex: 1.2;
    display: none;
    overflow: hidden;
}

@media (min-width: 992px) {
    .login-image-side {
        display: block;
    }
}

.login-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomOutEffect 20s ease-in-out infinite alternate;
}

@keyframes zoomOutEffect {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.login-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(35, 55, 79, 0.7) 0%, rgba(151, 106, 65, 0.4) 100%);
    z-index: 1;
}

.login-image-content {
    position: absolute;
    bottom: 10%;
    left: 10%;
    right: 10%;
    z-index: 2;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.login-image-content h2 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.login-image-content p {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
}

/* --- الجانب الأيمن (الفورم) --- */
.login-form-side {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px; /* تقليل الحشو الخارجي */
    background: #F8F5F2;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    padding: 25px 30px; /* تقليل الحشو الداخلي ليتسع في الشاشة */
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(35, 55, 79, 0.08);
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    max-height: 95vh; /* لضمان عدم خروجها عن الشاشة في الشاشات الصغيرة جداً */
    overflow-y: auto;
}

/* إخفاء السكرول الداخلي للفورم */
.login-form-wrapper::-webkit-scrollbar { display: none; }
.login-form-wrapper { -ms-overflow-style: none; scrollbar-width: none; }

/* زر العودة للرئيسية */
.back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #976A41;
    text-decoration: none;
    font-size: 13px; /* تصغير الخط */
    font-weight: 600;
    margin-bottom: 15px; /* تقليل المسافة السفلية */
    transition: transform 0.3s ease;
}
.back-home-link:hover {
    transform: translateX(-5px);
}
html[dir="ltr"] .back-home-link:hover {
    transform: translateX(5px);
}

.login-header {
    text-align: center;
    margin-bottom: 20px; /* تقليل المسافة */
}

.login-logo {
    height: 40px; /* تصغير الشعار */
    margin-bottom: 10px;
}

.login-header h2 {
    color: #23374F;
    font-size: 24px; /* تصغير العنوان */
    font-weight: 800;
    margin: 0 0 5px 0;
}

.login-header p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* --- الحقول العصرية (Floating Labels) --- */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 12px; /* تقليل المسافة بين الحقول (كانت 20) */
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 12px 40px 12px 15px; /* تصغير الحشو الرأسي (كان 16) */
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    background: #F8F5F2;
    font-family: 'Changa', sans-serif;
    font-size: 14px;
    color: #23374F;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
html[dir="ltr"] .input-group input {
    padding: 12px 15px 12px 40px;
}

.input-group input:focus {
    border-color: #976A41;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(151, 106, 65, 0.1);
}

.input-group label {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    font-family: 'Changa', sans-serif;
    pointer-events: none;
    transition: all 0.25s ease;
    background: transparent;
    padding: 0 4px;
}
html[dir="ltr"] .input-group label {
    right: auto;
    left: 15px;
}

/* حركة الليبل */
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 0;
    right: 10px;
    font-size: 11px;
    color: #976A41;
    background: #fff;
    font-weight: 600;
    border-radius: 4px;
}
html[dir="ltr"] .input-group input:focus ~ label,
html[dir="ltr"] .input-group input:not(:placeholder-shown) ~ label {
    right: auto;
    left: 10px;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    width: 18px; /* تصغير الأيقونة */
    height: 18px;
    color: #adb5bd;
    transition: color 0.3s ease;
    pointer-events: none;
}
html[dir="ltr"] .input-icon {
    left: auto;
    right: 15px;
}

.input-group input:focus ~ .input-icon {
    color: #976A41;
}

/* --- زر الإرسال --- */
.btn-modern-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px; /* تصغير الحشو */
    background: linear-gradient(135deg, #23374F 0%, #1a2a3d 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Changa', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 5px;
}

.btn-modern-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(35, 55, 79, 0.3);
}

.btn-modern-submit:active {
    transform: translateY(0);
}

.btn-modern-submit svg {
    transition: transform 0.3s ease;
    width: 18px;
    height: 18px;
}
html[dir="rtl"] .btn-modern-submit svg {
    transform: rotate(180deg);
}

.btn-modern-submit:hover svg {
    transform: translateX(5px);
}
html[dir="rtl"] .btn-modern-submit:hover svg {
    transform: translateX(-5px) rotate(180deg);
}

/* --- رسائل الخطأ --- */
.alert-error {
    background: #ffecec;
    color: #cc0000;
    padding: 8px 12px; /* تصغير */
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    border-right: 4px solid #cc0000;
    text-align: center;
}
html[dir="ltr"] .alert-error {
    border-right: none;
    border-left: 4px solid #cc0000;
}

/* --- التذييل --- */
.login-footer-text {
    text-align: center;
    margin-top: 15px; /* تصغير */
    font-size: 13px;
    color: #6c757d;
}

.login-footer-text a {
    color: #976A41;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer-text a:hover {
    color: #23374F;
}

/* --- الأنيميشن (Animations) --- */
.animate-slide-up {
    animation: slideUpFade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.animate-slide-left {
    animation: slideLeftFade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateX(-30px);
}
html[dir="ltr"] .animate-slide-left {
    transform: translateX(30px);
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes slideUpFade {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideLeftFade {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* =========================================
   مؤشر قوة كلمة المرور (Password Strength)
========================================= */
.password-strength {
    margin-top: -5px;
    margin-bottom: 5px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    height: 0;
}

.password-strength.active {
    opacity: 1;
    visibility: visible;
    height: auto;
}

.strength-bar {
    height: 4px;
    background: #e1e1e1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 3px;
}

.strength-bar span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
    font-family: 'Changa', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-align: right;
    transition: color 0.3s ease;
}

html[dir="ltr"] .strength-text {
    text-align: left;
}

/* =========================================
   التجاوب مع الجوال
========================================= */
@media (max-width: 768px) {
    html, body {
        overflow: auto; /* السماح بالسكرول في الجوال فقط */
        height: auto;
    }
    .login-split-section {
        height: auto;
        min-height: 100vh;
    }
    .login-form-side {
        padding: 30px 15px;
    }
    .login-form-wrapper {
        padding: 25px 20px;
        box-shadow: none;
        background: transparent;
        max-height: none;
    }
}