/* =========================================
   إعدادات عامة ومتغيرات الألوان (Theme)
========================================= */
:root {
    --primary-color: #0A192F; /* أزرق داكن فخم */
    --accent-color: #D4AF37;  /* ذهبي أنيق */
    --text-main: #333333;
    --text-light: #777777;
    --bg-color: #F8F9FA;
    --white: #FFFFFF;
    --error: #E63946;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* =========================================
   تخطيط الشاشة (Grid Layout)
========================================= */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-banner {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, #112B4F 100%);
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    position: relative;
}

.brand-name {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 2px 4px 10px rgba(0,0,0,0.3);
}

.brand-slogan {
    font-size: 1.2rem;
    color: var(--white);
    opacity: 0.9;
}

/* =========================================
   نموذج الدخول (Form Styling)
========================================= */
.login-form-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: var(--white);
}

.form-wrapper {
    width: 100%;
    max-width: 400px;
}

.form-wrapper h2 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 5px;
}

.sub-text {
    color: var(--text-light);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #FAFAFA;
}

.input-group input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
    background: var(--white);
}

.password-wrapper {
    position: relative;
}

.toggle-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-light);
}

/* =========================================
   الأزرار والحالات (Buttons & States)
========================================= */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.btn-primary:hover {
    background: #112B4F;
}

.btn-primary:disabled {
    background: #A0A0A0;
    cursor: not-allowed;
}

.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid var(--white);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.error-alert {
    background: #FDE8E8;
    color: var(--error);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
}

/* =========================================
   التجاوب مع الشاشات (Responsive)
========================================= */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .login-banner {
        flex: 0.4;
        padding: 20px;
    }

    .brand-name {
        font-size: 3.5rem;
    }
    
    .login-form-section {
        flex: 0.6;
        align-items: flex-start;
        padding-top: 40px;
        border-radius: 30px 30px 0 0;
        margin-top: -30px; /* لعمل تداخل جميل في الجوال */
        z-index: 2;
    }
}