/* =========================================================
   شاشة الدخول — بنفس لغة تصميم بقية الشاشات
   ========================================================= */

:root {
    --lg-teal: #1d6f6f;
    --lg-teal-dark: #145252;
    --lg-ink: #1d2b2b;
    --lg-muted: #7a8b8b;
    --lg-line: #e1eaea;
}

* {
    font-family: 'Droid Arabic Kufi', 'Segoe UI', 'Open Sans', sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
}

.login-body {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 14px;
    overflow-x: hidden;
}

/* --- الخلفية --- */
.login-bg {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* طبقة تعتيم: تضمن وضوح النص فوق أي صورة خلفية يرفعها المستخدم */
.login-veil {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, rgba(12, 45, 45, .82) 0%, rgba(8, 28, 28, .90) 100%);
    z-index: 1;
}

/* --- اختيار اللغة ---
   أزرار مباشرة في شريط زجاجي، بلا اعتماد على :hover
   فتعمل باللمس كما تعمل بالفأرة */
.login-lang {
    /* داخل التدفّق لا مثبّتاً: يبقى فوق البطاقة على كل المقاسات
       فلا يتداخل مع المحتوى ولا يحتاج معالجة خاصة للجوال */
    display: inline-flex;
    margin: 0 auto 20px;
    gap: 3px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .16);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

    .lang-btn:hover,
    .lang-btn:focus {
        background: rgba(255, 255, 255, .16);
        color: #fff;
        text-decoration: none;
    }

    /* اللغة الحالية مميّزة، فيعرف المستخدم أين هو */
    .lang-btn.active {
        background: #fff;
        color: var(--lg-teal);
    }

    .lang-btn img {
        width: 19px;
        height: 13px;
        object-fit: cover;
        border-radius: 2px;
        flex-shrink: 0;
    }

/* --- الحاوية --- */
.login-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 410px;
    text-align: center;
}

/* الشاشات الضيقة جداً: إخفاء نص اللغة والاكتفاء بالعلم */
@media (max-width: 359px) {
    .lang-btn span {
        display: none;
    }

    .lang-btn {
        padding: 8px 11px;
    }
}

/* --- الهوية: الشعار واسم المدرسة --- */
.login-brand {
    margin-bottom: 18px;
}

.lb-logo {
    width: 150px;
    height: 150px;
    margin: 0 auto 16px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-shadow: 0 6px 26px rgba(0, 0, 0, .3);
}

    .lb-logo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.lb-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .4);
    line-height: 1.5;
}

/* غير مستخدمة حالياً: الاسم صار واحداً حسب اللغة.
   تُركت لأن الشاشة قد تحتاجها إن أُعيد عرض الاسمين. */
.lb-name-en {
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    margin-top: 4px;
}

/* --- بطاقة الدخول --- */
.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, .3);
    overflow: hidden;
    text-align: start;
}

.login-head {
    background: linear-gradient(135deg, var(--lg-teal) 0%, var(--lg-teal-dark) 100%);
    color: #fff;
    padding: 17px 22px;
    text-align: center;
}

    .login-head h3 {
        margin: 0;
        font-size: 20.5px;
        font-weight: 700;
    }

    .login-head span {
        font-size: 13.5px;
        opacity: .85;
    }

.login-form {
    padding: 22px;
}

/* --- الحقول --- */
.lf-field {
    position: relative;
    margin-bottom: 14px;
}

    .lf-field > i {
        position: absolute;
        inset-inline-start: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--lg-muted);
        font-size: 16.5px;
        pointer-events: none;
    }

    .lf-field .form-control {
        height: 47px;
        /* 16px تمنع iOS من تكبير الصفحة تلقائياً عند التركيز على الحقل */
        font-size: 17.5px;
        border: 1px solid var(--lg-line);
        border-radius: 8px;
        background: #f8fbfb;
        padding-inline-start: 42px;
        padding-inline-end: 42px;
        box-shadow: none;
        transition: border-color .15s ease, background .15s ease;
    }

        .lf-field .form-control:focus {
            border-color: var(--lg-teal);
            background: #fff;
            box-shadow: 0 0 0 3px rgba(29, 111, 111, .12);
        }

.lf-eye {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--lg-muted);
    padding: 6px 8px;
    cursor: pointer;
}

    .lf-eye:hover {
        color: var(--lg-teal);
    }

/* --- زر الدخول --- */
.lf-submit {
    width: 100%;
    height: 47px;
    border: none;
    border-radius: 8px;
    background: var(--lg-teal);
    color: #fff;
    font-size: 16.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}

    .lf-submit:hover {
        background: var(--lg-teal-dark);
    }

    .lf-submit:active {
        transform: translateY(1px);
    }

/* --- رسائل الخطأ --- */
.login-error {
    background: #fdf0ee;
    border: 1px solid #f3c9c2;
    border-radius: 8px;
    color: #a5372a;
    padding: 9px 13px;
    margin-bottom: 14px;
    font-size: 14.5px;
}

    .login-error ul {
        margin: 0;
        padding-inline-start: 18px;
    }

    .login-error:empty {
        display: none;
    }

/* --- التذييل --- */
.login-foot {
    margin-top: 16px;
    color: rgba(255, 255, 255, .72);
    font-size: 13.5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
}

    .login-foot span {
        white-space: nowrap;
    }

    .login-foot i {
        opacity: .8;
    }

/* --- الجوال --- */
@media (max-width: 480px) {
    .login-wrap {
        max-width: 100%;
    }

    .lb-logo {
        width: 128px;
        height: 128px;
    }

    .lb-name {
        font-size: 16.5px;
    }

    .login-form {
        padding: 18px 16px;
    }

    .lang-btn {
        padding: 7px 12px;
        font-size: 13.5px;
    }

        .lang-btn img {
            width: 17px;
            height: 12px;
        }
}

/* --- الشاشات القصيرة أفقياً --- */
@media (max-height: 640px) {
    .lb-logo {
        width: 110px;
        height: 110px;
        margin-bottom: 12px;
    }

    .lb-name {
        font-size: 15.5px;
    }

    .login-brand {
        margin-bottom: 12px;
    }
}

/* =========================================================
   حالة إرسال النموذج
   ========================================================= */

/* الحالتان متراكبتان: تبديلهما لا يُغيّر عرض الزر فلا يقفز */
.lf-submit {
    position: relative;
}

    .lf-submit .lf-busy {
        display: none;
    }

    .lf-submit.busy .lf-idle {
        display: none;
    }

    .lf-submit.busy .lf-busy {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .lf-submit:disabled,
    .lf-submit.busy {
        opacity: .75;
        cursor: progress;
    }

/* خطأ الشبكة — يختلف عن خطأ بيانات الدخول */
.lf-neterr {
    background: #fdefed;
    border: 1px solid #f5d0cb;
    border-radius: 8px;
    padding: 11px 14px;
    margin-bottom: 14px;
    color: #96291d;
    font-size: 13.5px;
    text-align: center;
}


/* =========================================================
   اختيار نوع الحساب — مبدّل منزلق
   ========================================================= */
.lf-kind {
    position: relative;
    display: flex;
    background: #eef4f4;
    border-radius: 11px;
    padding: 4px;
    margin-bottom: 20px;
}

/* المؤشّر المنزلق خلف الخيارات: أوضح من تلوين كل خيار،
   وينقل الإحساس بأنهما وجهان لمفتاح واحد */
.lk-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    /* inset-inline-start يعمل بالاتجاهين: right في العربية
       و left في الإنجليزية بلا قاعدة منفصلة */
    inset-inline-start: 4px;
    width: calc(50% - 4px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

.lk-opt {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 8px;
    margin: 0;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: #7a8b8b;
    transition: color .18s;
}

    /* المدخل مخفي: التسمية كلها هي زر الاختيار */
    .lk-opt input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .lk-opt i {
        font-size: 14px;
    }

    .lk-opt.active {
        color: #155252;
    }

        .lk-opt.active i {
            color: #1d6f6f;
        }

@media (max-width: 380px) {
    .lk-opt {
        font-size: 12.5px;
        padding: 9px 6px;
    }

        .lk-opt i {
            font-size: 13px;
        }
}
