/* ==========================================
   1. تهيئة عامة ومتغيرات الألوان (CSS Variables)
   ========================================== */
:root {
    --primary-blue: #134e73;       /* اللون الأزرق الغامق الأساسي من الصورة */
    --light-bg: #eff6ff;          /* خلفية الحقول الزرقاء الخفيفة */
    --text-dark: #1e293b;         /* لون النصوص الداكنة */
    --text-muted: #64748b;        /* لون النصوص الثانوية الهادئة */
    --white: #ffffff;
    --transition: all 0.3s ease;
}

/* تصفير الهوامش لضمان تطابق الأبعاد عبر المتصفحات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--white);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* This stylesheet was originally written assuming <body> directly contains
   the login markup (display:flex laid the two panes out side by side).
   In this Blazor app <body>'s real child is #app (the Blazor mount div),
   so body:flex left #app sized to its content instead of the viewport,
   leaving a dead strip on the right. #app must fill its parent regardless
   of which page/layout is mounted inside it. */
#app {
    display: block;
    width: 100%;
    min-height: 100vh;
}

/* الحاوية الرئيسية المقسمة إلى نصفين */
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ==========================================
   2. تصميم القسم الأيمن (نموذج الدخول)
   ========================================== */
.form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background-color: var(--white);
}

.form-container {
    width: 100%;
    max-width: 450px;
}

.form-header {
    text-align: right;
    margin-bottom: 35px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-header .brand-name {
    color: var(--primary-blue);
}

.form-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* الحقول والتنسيقات الخاصة بالمدخلات */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
}

.input-wrapper, .select-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 45px; /* مسافة إضافية جهة اليسار للأيقونة */
    border: none;
    background-color: var(--light-bg);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-dark);
    transition: var(--transition);
    text-align: right;
}

/* لضمان بقاء البريد الإلكتروني وكلمة المرور باتجاه LTR داخل الحقل */
.input-wrapper input[type="email"],
.input-wrapper input[type="password"] {
    direction: ltr;
}

.input-wrapper input:focus {
    outline: 2px solid rgba(19, 78, 115, 0.2);
    background-color: #e2f0fd;
}

/* أيقونات الحقول جهة اليسار كما في الصورة */
.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
}

/* تنسيق قائمة اختيار اللغة */
.select-wrapper select {
    width: 100%;
    padding: 16px;
    border: 1px solid #e2e8f0;
    background-color: var(--white);
    border-radius: 8px;
    font-size: 15px;
    appearance: none; /* إخفاء سهم المتصفح الافتراضي */
    -webkit-appearance: none;
    color: var(--text-dark);
    cursor: pointer;
    text-align: right;
}

.select-arrow {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-blue);
    font-size: 14px;
    pointer-events: none;
}

/* التذكر ونسيان كلمة المرور */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-password:hover {
    text-decoration: underline;
}

/* زر تسجيل الدخول */
.submit-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: #0e3b57;
}

/* ==========================================
   3. تصميم القسم الأيسر الداكن (تعريف النظام)
   ========================================== */
.info-section {
    flex: 1.1; /* أوسع قليلاً من قسم الفورم لمحاكاة الصورة */
    background-color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--white);
}

.info-content {
    width: 100%;
    max-width: 650px;
    text-align: center;
}

.system-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
}

.system-desc {
    font-size: 15px;
    color: #cbd5e1;
    max-width: 500px;
    margin: 0 auto 50px auto;
    line-height: 1.8;
}

/* شبكة المربعات الثمانية (Grid System) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.service-card {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.service-card:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.service-card i {
    font-size: 26px;
    color: var(--white);
}

.service-card span {
    font-size: 13px;
    font-weight: 600;
}

/* ==========================================
   4. التجاوب مع الشاشات المختلفة (Responsive)
   ========================================== */

/* للشاشات المتوسطة (الأجهزة اللوحية واللابتوب الصغير) */
@media (max-width: 1100px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr); /* تحويل الشبكة لعمودين بدلاً من 4 لتبدو مريحة */
    }
    
    .system-title {
        font-size: 26px;
    }
}

/* للهواتف والشاشات الصغيرة */
@media (max-width: 850px) {
    .login-wrapper {
        flex-direction: column; /* جعل العناصر تحت بعضها */
    }
    
    .form-section {
        padding: 40px 20px;
    }
    
    .info-section {
        padding: 50px 20px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين للهواتف لسهولة القراءة واللمس */
    }
    
    .system-title {
        font-size: 24px;
    }
    
    .system-desc {
        margin-bottom: 30px;
    }
}

/* للهواتف الصغيرة جداً */
@media (max-width: 400px) {
    .services-grid {
        grid-template-columns: 1fr; /* عمود واحد لعدم تداخل البطاقات */
    }
}