/* === الأنماط الأساسية === */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    /* overflow: hidden; -- إزالة هذا للسماح بالتمرير إذا لزم الأمر في الصفحات الأخرى */
    background-color: #f8f9fa; /* توحيد لون الخلفية */
    color: #212529;    /* توحيد لون النص */
    direction: rtl;    /* تأكيد الاتجاه */
    display: flex;     /* يستخدم لتوسيط محتوى تسجيل الدخول */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative; /* للسماح بتراكب الخلفية */
    z-index: 0;
}

/* --- حاويات الصفحات --- */
/* حاوية عامة تستخدمها dashboard, carts, camera */
.page-container {
    max-width: 950px;
    width: 95%;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    position: relative; /* لمنع تداخل ظل الخلفية معها */
    z-index: 1;
}

/* حاوية تسجيل الدخول (من ملفك الأصلي مع تعديلات طفيفة) */
.login-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px; /* توحيد الحواف */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* تعديل الظل قليلاً */
    text-align: center;
    width: 380px; /* زيادة طفيفة في العرض */
    max-width: 90%;
    position: relative; /* لضمان ظهوره فوق الخلفية */
    z-index: 1;
}

/* خلفية تسجيل الدخول (من ملفك الأصلي) */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e'); /* يمكنك تغيير الصورة */
    background-size: cover;
    background-position: center;
    filter: blur(4px) brightness(0.7); /* تعديل الفلتر */
    z-index: -1; /* خلف العناصر الأخرى */
}

/* --- الهيدر والفوتر العام (لـ page-container) --- */
header {
    background-color: #4a5568;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}
header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.header-actions { /* للأزرار في الهيدر */
    display: flex;
    gap: 10px;
    align-items: center;
}
.header-actions .header-btn { /* تنسيق زر الهيدر */
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.header-actions .header-btn:hover {
     background-color: rgba(255, 255, 255, 0.2);
}

footer {
    text-align: center;
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    color: #6c757d;
    margin-top: auto; /* دفع الفوتر لأسفل */
    font-size: 0.9rem;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
}


/* --- أنماط صفحات المصادقة (تسجيل الدخول، نسيت كلمة المرور) --- */
.auth-container main { /* هذا سيطبق على forgot-password.html */
    max-width: 450px;
    width: 90%;
    margin: 40px auto;
    padding: 30px;
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
}
.auth-container header { /* هيدر صفحات المصادقة */
    background-color: #4a5568;
    color: white;
    padding: 15px 20px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}
.auth-container header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
}

/* عنوان صفحة تسجيل الدخول (من ملفك الأصلي) */
.login-container h1 {
    color: #333;
    margin-bottom: 30px;
    font-weight: 500;
}

/* تعليمات صفحة نسيت كلمة المرور */
.auth-container .instructions {
    color: #495057;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* --- تنسيق النماذج (عام لصفحات المصادقة) --- */
.form-group,
.login-container .input-group /* استهداف كلاس تسجيل الدخول أيضاً */
{
    margin-bottom: 20px;
    text-align: right;
    position: relative; /* مطلوب لأيقونة العين */
}

.form-group label { /* مسمى الحقل */
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* حاوية حقل كلمة المرور لإضافة الأيقونة */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* تنسيق حقول الإدخال (موحد) */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"], /* إضافة حقول أخرى */
select /* إضافة القوائم المنسدلة */
{
    width: 100%;
    padding: 10px 12px; /* توحيد الحشوة */
    border: 1px solid #ced4da; /* توحيد الحدود */
    border-radius: 4px; /* توحيد الحواف */
    box-sizing: border-box;
    font-size: 1rem; /* توحيد حجم الخط */
    transition: border-color 0.2s ease, box-shadow 0.2s ease; /* تعديل الانتقال */
    color: #333;
}
/* تعديل حشوة حقل كلمة المرور لوجود الأيقونة */
.password-input-container input[type="password"],
.password-input-container input[type="text"] /* إذا كان النص يظهر بدلاً من كلمة المرور */
{
    padding-left: 40px; /* مساحة للأيقونة على اليسار (في RTL) */
}

input::placeholder {
    color: #aaa;
}

input:focus,
select:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* أيقونة إظهار/إخفاء كلمة المرور */
.password-input-container i#togglePassword {
    position: absolute;
    top: 50%;
    left: 12px; /* تغيير لليسار بسبب RTL */
    right: auto; /* إلغاء التحديد لليمين */
    transform: translateY(-50%);
    cursor: pointer;
    color: #777;
    font-size: 1.1em; /* تعديل بسيط للحجم */
}
.password-input-container i#togglePassword:hover {
    color: #333;
}

/* --- تنسيق الأزرار (موحد) --- */
.btn,
button[type="submit"] /* استهداف زر تسجيل الدخول أيضاً */
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px; /* توحيد الحشوة */
    font-size: 1rem; /* توحيد حجم الخط */
    font-weight: 500;
    border-radius: 5px; /* توحيد الحواف */
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%; /* جعل الأزرار تملأ العرض في نماذج المصادقة */
    margin-top: 10px; /* إضافة هامش علوي بسيط */
}
.btn:disabled,
button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-primary,
button[type="submit"] /* زر تسجيل الدخول يأخذ اللون الأساسي */
{
    background-color: #0d6efd; /* أزرق Bootstrap */
}
.btn-primary:hover:not(:disabled),
button[type="submit"]:hover:not(:disabled) {
    background-color: #0b5ed7;
}
/* يمكنك إضافة .btn-success, .btn-danger, .btn-secondary هنا إذا احتجتها */
.btn-success { background-color: #198754; }
.btn-success:hover:not(:disabled) { background-color: #157347; }
.btn-danger { background-color: #dc3545; }
.btn-danger:hover:not(:disabled) { background-color: #bb2d3b; }
.btn-secondary { background-color: #6c757d; }
.btn-secondary:hover:not(:disabled) { background-color: #5c636a; }

/* أيقونة التحميل داخل الزر */
.loading-icon {
    margin-right: 5px; /* مسافة بسيطة */
}

/* --- الروابط (نسيت كلمة المرور، العودة للتسجيل) --- */
.forgot-password,
.form-links {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}
.forgot-password a,
.form-links a {
    color: #0d6efd; /* لون الرابط */
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    margin: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.forgot-password a:hover,
.form-links a:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

/* --- رسائل الحالة (عامة) --- */
.message {
    padding: 10px; /* تقليل الحشوة */
    margin-top: 15px;
    margin-bottom: 15px; /* إضافة هامش سفلي */
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem; /* تصغير الخط قليلاً */
    display: none; /* إخفاء مبدئي */
}
.message.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
    display: block; /* إظهار عند إضافة الكلاس */
}
.message.error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    display: block; /* إظهار عند إضافة الكلاس */
}
/* رسالة المعلومات العامة (مثل رسالة "لم يتم التفعيل بعد") */
.message.info {
    background-color: #cff4fc; /* أزرق فاتح */
    color: #055160;
    border: 1px solid #b6effb;
    display: block; /* إظهار عند إضافة الكلاس */
}


/* --- تجاوب إضافي لـ login-container --- */
@media (max-width: 576px) {
    .login-container {
        padding: 25px;
    }
    .login-container h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    button[type="submit"], .btn { /* التأكد من تطبيقها على كل الأزرار */
        padding: 10px 15px;
        font-size: 1rem;
    }
    .forgot-password, .form-links {
        font-size: 0.85rem;
    }
}

/* --- (يمكن إضافة أنماط التجاوب الخاصة بـ page-container هنا إذا لم تكن موجودة) --- */
@media (max-width: 768px) {
    /* قواعد التجاوب لـ page-container, header, footer ... الخ */
    .page-container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }
    /* ... باقي قواعد التجاوب للصفحات الأخرى ... */
}
