/* style.css - Premium Split-Screen Login (Mobile Optimized) */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

* { box-sizing: border-box; } /* 🔴 أهم سطر لمنع الكسر والعصرة 🔴 */

:root {
    --primary: #1e3a8a; /* كحلي مؤسسي */
    --secondary: #3b82f6;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
}

body {
    margin: 0;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    background-color: var(--bg-light);
}

.split-layout {
    display: flex;
    min-height: 100vh;
}

/* --- جانب الفورم --- */
.form-side {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    padding: 40px;
}

.form-container {
    width: 100%;
    max-width: 420px;
}

.lang-switcher {
    text-align: left;
    margin-bottom: 30px;
}

.lang-switcher span {
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 14px;
    transition: 0.3s;
}

.lang-switcher span:hover { color: var(--primary); }

.mobile-brand-icon {
    display: none;
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}

h3 { margin: 0; font-size: 28px; color: var(--text-dark); font-weight: 800; }
.sub-text { margin: 8px 0 30px 0; color: var(--text-muted); font-size: 15px; }

/* الحقول */
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--text-dark); font-size: 14px; }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 15px;
    color: #94a3b8;
    font-size: 18px;
}

.toggle-password {
    position: absolute;
    left: 15px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    user-select: none;
    transition: 0.2s;
}
.toggle-password:hover {
    color: var(--primary);
}

.input-wrapper input {
    width: 100%;
    padding: 14px 45px 14px 45px; 
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    background-color: #f8fafc;
}

.input-wrapper input:focus {
    border-color: var(--secondary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* تظبيط الأيقونات في حالة اللغة الإنجليزية LTR */
html[dir="ltr"] .input-icon { right: auto; left: 15px; }
html[dir="ltr"] .toggle-password { left: auto; right: 15px; }

/* الأزرار */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(30, 58, 138, 0.5);
}

.error-msg {
    color: #ef4444;
    text-align: center;
    margin-top: 15px;
    font-weight: 700;
    font-size: 14px;
    min-height: 20px;
}

.register-link {
    text-align: center;
    margin-top: 30px;
    font-size: 15px;
    color: var(--text-muted);
}

.register-link a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 800;
    margin-right: 5px;
}

.register-link a:hover { text-decoration: underline; }

/* --- جانب البراندنج (الشركات) --- */
.brand-side {
    flex: 1.2;
    background: linear-gradient(135deg, #0f172a, var(--primary));
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.brand-side::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.brand-content {
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: 80px;
    height: 80px;
    background: white;
    color: var(--primary);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    margin-bottom: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.brand-content h1 { font-size: 48px; margin: 0 0 20px 0; font-weight: 800; line-height: 1.2; }
.brand-content p { font-size: 18px; line-height: 1.7; opacity: 0.9; margin-bottom: 40px; }

.features { display: flex; gap: 20px; flex-wrap: wrap; }
.features span {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(5px);
}

/* ================= 🔴 سحر الموبايل النظيف 🔴 ================= */
@media (max-width: 900px) {
    .brand-side { display: none !important; } 
    .mobile-brand-icon { display: block; }
    
    html, body { overflow-x: hidden; width: 100vw; height: auto; min-height: 100vh; }
    
    .split-layout { 
        display: block; 
        height: auto; 
        min-height: 100vh; 
    }
    
    /* 🔴 تفريغ مساحة للهوامش عشان متبقاش مخنوقة */
    .form-side { 
        padding: 20px; 
        min-height: 100vh; 
        display: flex; 
        align-items: center; /* بيخلي الفورم متسنترة في النص */
        justify-content: center; 
        width: 100vw; 
    }
    
    .form-container { width: 100%; max-width: 100%; }
    
    /* تكبير مقاسات الزراير والحقول لمنع زووم الآيفون */
    input, select, button { font-size: 16px !important; } 
    
    /* 🔴 تظبيط المودالات على الموبايل عشان الشاشة متسحبش 🔴 */
    .modal-content { 
        width: 95% !important; 
        padding: 20px !important; 
        max-height: 90vh !important; 
        overflow-y: auto !important; 
        margin: 10px auto !important;
    }
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* محاذاة الأيقونة اللي على اليمين (الإيميل/القفل) */
.input-wrapper .input-icon {
    position: absolute;
    right: 12px;
    color: #64748b;
}

/* محاذاة أيقونة العين اللي على الشمال */
.input-wrapper .toggle-password {
    position: absolute;
    left: 12px;
    cursor: pointer;
    color: #64748b;
}

/* إعطاء مساحة جوه الحقل عشان الكلام ميجيش فوق الأيقونات */
.input-wrapper input {
    padding-right: 40px !important;
    padding-left: 40px !important;
    width: 100%;
}
