﻿/* =========================================
   المتغيرات العامة
   ========================================= */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --background: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --secondary: #64748b;
    --border: #cbd5e1;
    --danger: #dc2626;
    --focus: rgba(37, 99, 235, 0.20);
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    --navbar-height: 45px;
}


/* =========================================
   الإعدادات العامة
   ========================================= */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

a,
button,
input {
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

    a:focus-visible,
    button:focus-visible,
    input:focus-visible {
        outline: 3px solid var(--focus);
        outline-offset: 3px;
    }


/* =========================================
   شريط الروابط العلوي
   ========================================= */

/* =========================================
   شريط التنقل العلوي - التصميم الجديد
   ========================================= */

.top-navbar {
    position: relative;
    z-index: 1000;
    width: 100%;
    height: 45px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e8edf5;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 5px 20px rgba(15, 23, 42, 0.06);
    direction: rtl;
}

.top-navbar-container {
    width: min(100%, 1400px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0 30px;
}

.navbar-links {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.top-nav-link {
    position: relative;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 18px;
    border-radius: 12px;
    color: #334155;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

    .top-nav-link::after {
        content: "";
        position: absolute;
        right: 18px;
        bottom: 3px;
        left: 18px;
        height: 3px;
        border-radius: 10px;
        background: var(--primary);
        opacity: 0;
        transform: scaleX(0.4);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .top-nav-link:hover {
        background: #f1f6ff;
        color: var(--primary);
        transform: translateY(-1px);
    }

        .top-nav-link:hover::after {
            opacity: 1;
            transform: scaleX(1);
        }

.nav-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    border-radius: 10px;
    background: #eff6ff;
    font-size: 17px;
}


/* =========================================
   النافبار في الشاشات المتوسطة
   ========================================= */

@media (max-width: 1000px) {

    .top-navbar {
        height: auto;
        min-height: 68px;
    }

    .top-navbar-container {
        padding: 8px 15px;
    }

    .navbar-links {
        width: 100%;
        height: auto;
        gap: 5px;
    }

    .top-nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }

    .nav-icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 15px;
    }
}


/* =========================================
   النافبار على الموبايل
   ========================================= */

@media (max-width: 700px) {

    .navbar-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .top-nav-link {
        width: 100%;
        min-height: 46px;
        justify-content: flex-start;
        padding: 7px 9px;
        border: 1px solid #e8edf5;
        border-radius: 10px;
        background: #ffffff;
        font-size: 12px;
        white-space: normal;
    }

        .top-nav-link::after {
            display: none;
        }

        .top-nav-link:hover {
            border-color: #bfdbfe;
            transform: none;
        }

    .nav-icon {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
        font-size: 14px;
    }
}


@media (max-width: 380px) {

    .navbar-links {
        grid-template-columns: 1fr;
    }
}
/* =========================================
   الهيكل الرئيسي
   ========================================= */

.auth-shell {
    width: 100%;
    min-height: calc(100vh - var(--navbar-height));
    display: grid;
    grid-template-columns: 1fr 1fr;
    direction: ltr;
    background: var(--card);
}


/* =========================================
   صورة الجامعة
   ========================================= */

.hero-panel {
    position: relative;
    min-width: 0;
    min-height: calc(100vh - var(--navbar-height));
    overflow: hidden;
    background: #0f172a;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
    animation: heroFade 0.8s ease both;
}


/* =========================================
   جزء فورم تسجيل الدخول
   ========================================= */

.form-panel {
    min-width: 0;
    min-height: calc(100vh - var(--navbar-height));
    display: grid;
    place-items: center;
    padding: 36px 40px;
    direction: rtl;
    background: var(--card);
}

.form-card {
    width: min(100%, 450px);
    animation: slideUp 0.65s ease both;
}


/* =========================================
   شعار واسم المنصة
   ========================================= */

.brand {
    margin-bottom: 22px;
    text-align: center;
}

.brand-mark {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient( 135deg, var(--primary), #60a5fa );
    color: #ffffff;
    box-shadow: var(--shadow);
}

    .brand-mark span {
        font-size: 2.05rem;
        font-weight: 700;
    }

.app-name {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
}

.app-subtitle {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}


/* =========================================
   عنوان تسجيل الدخول
   ========================================= */

.form-heading {
    margin-bottom: 22px;
    text-align: center;
}

    .form-heading h1 {
        margin: 0;
        color: var(--text);
        font-size: 30px;
        font-weight: 700;
        line-height: 1.3;
    }


/* =========================================
   الفورم
   ========================================= */

.auth-form {
    display: grid;
    gap: 18px;
}


/* =========================================
   حقل الرقم القومي
   ========================================= */

.field-group label {
    display: block;
    margin-bottom: 9px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    text-align: right;
}

.input-shell {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-shell input {
        width: 100%;
        height: 52px;
        padding: 0 48px 0 16px;
        border: 1px solid var(--border);
        border-radius: 12px;
        outline: none;
        background: #ffffff;
        color: var(--text);
        font-size: 16px;
        direction: rtl;
        text-align: right;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

        .input-shell input::placeholder {
            color: #94a3b8;
        }

        .input-shell input:hover {
            border-color: #94a3b8;
        }

        .input-shell input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px var(--focus);
        }

.input-icon {
    position: absolute;
    right: 16px;
    z-index: 2;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--secondary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.field-group.is-invalid input {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.error-message {
    min-height: 18px;
    margin: 6px 0 0;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
    text-align: right;
}


/* =========================================
   تذكرني
   ========================================= */

.remember-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

    .check-row input {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
        margin: 0;
        accent-color: var(--primary);
        cursor: pointer;
    }


/* =========================================
   زر تسجيل الدخول
   ========================================= */

.primary-button {
    position: relative;
    width: 100%;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.27);
}

    .primary-button:hover {
        background: var(--primary-hover);
        transform: translateY(-1px);
    }

    .primary-button:active {
        transform: translateY(0);
    }

    .primary-button:disabled {
        cursor: not-allowed;
        opacity: 0.72;
        transform: none;
    }

.button-loader {
    width: 18px;
    height: 18px;
    display: none;
    flex: 0 0 18px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.primary-button.is-loading .button-loader {
    display: inline-block;
}


/* =========================================
   الفاصل والتسجيل الجديد
   ========================================= */

.divider {
    width: 100%;
    height: 1px;
    margin-top: 3px;
    background: #e2e8f0;
}

.register-text {
    margin: 0;
    color: var(--secondary);
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
}

.register-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    margin-right: 4px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

    .register-link:hover {
        color: var(--primary-hover);
        text-decoration: underline;
    }


/* =========================================
   رسائل الخطأ
   ========================================= */

.alert-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
}


/* =========================================
   الفوتر
   ========================================= */

.site-footer {
    margin-top: 32px;
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

    .site-footer a {
        color: var(--primary);
        font-weight: 700;
        text-decoration: none;
    }

        .site-footer a:hover {
            text-decoration: underline;
        }


/* =========================================
   الحركات
   ========================================= */

@keyframes heroFade {

    from {
        opacity: 0;
        transform: scale(1.02);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {

    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* =========================================
   الشاشات الأقل من 1200
   ========================================= */

@media (max-width: 1200px) {

    .top-navbar-container {
        padding-right: 24px;
        padding-left: 24px;
    }

    .navbar-links {
        gap: 6px 13px;
    }

    .top-nav-link {
        font-size: 14px;
    }

    .navbar-brand-name {
        font-size: 18px;
    }

    .form-panel {
        padding-right: 30px;
        padding-left: 30px;
    }
}


/* =========================================
   الشاشات الأقل من 1000
   ========================================= */

@media (max-width: 1000px) {

    .top-navbar-container {
        min-height: auto;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 9px 16px;
    }

    .navbar-brand-name {
        display: none;
    }

    .navbar-links {
        width: 100%;
        justify-content: center;
    }

    .top-nav-link {
        min-height: 40px;
        padding: 6px 5px;
        font-size: 13px;
    }

        .top-nav-link span {
            font-size: 16px;
        }
}


/* =========================================
   التابلت
   ========================================= */

@media (max-width: 900px) {

    .auth-shell {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .hero-panel {
        min-height: 290px;
    }

    .form-panel {
        min-height: auto;
        padding: 38px 22px;
    }
}


/* =========================================
   الموبايل
   ========================================= */

@media (max-width: 620px) {

    .top-navbar {
        min-height: auto;
    }

    .top-navbar-container {
        min-height: auto;
        padding: 8px 10px;
    }

    .navbar-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .top-nav-link {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        padding: 6px 4px;
        font-size: 12px;
        line-height: 1.4;
        text-align: center;
        white-space: normal;
    }

        .top-nav-link span {
            font-size: 14px;
        }

    .hero-panel {
        min-height: 220px;
    }

    .form-panel {
        padding: 30px 18px;
    }

    .form-card {
        width: 100%;
    }

    .brand {
        margin-bottom: 18px;
    }

    .brand-mark {
        width: 62px;
        height: 62px;
        margin-bottom: 14px;
        border-radius: 17px;
    }

        .brand-mark span {
            font-size: 1.8rem;
        }

    .app-name {
        font-size: 18px;
    }

    .app-subtitle {
        font-size: 16px;
    }

    .form-heading {
        margin-bottom: 18px;
    }

        .form-heading h1 {
            font-size: 26px;
        }

    .input-shell input {
        font-size: 15px;
    }

    .site-footer {
        margin-top: 25px;
    }
}


/* =========================================
   الموبايلات الصغيرة
   ========================================= */

@media (max-width: 380px) {

    .navbar-links {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        min-height: 190px;
    }

    .form-panel {
        padding: 26px 14px;
    }

    .brand-mark {
        width: 58px;
        height: 58px;
    }

    .app-name {
        font-size: 17px;
    }

    .app-subtitle {
        font-size: 15px;
    }

    .form-heading h1 {
        font-size: 24px;
    }

    .register-text {
        font-size: 14px;
    }
}
/* =========================================================
   شريط الروابط الموجود في نهاية الصفحة
   ========================================================= */

.bottom-navbar {
    position: static;
    width: 100%;
    padding: 14px 20px;
    background: #0f2b5b;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    direction: rtl;
}

    .bottom-navbar .top-navbar-container {
        width: min(100%, 1200px);
        margin: 0 auto;
    }

    .bottom-navbar .navbar-links {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 14px 28px;
    }

    .bottom-navbar .top-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #ffffff;
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        transition: color 0.2s ease, transform 0.2s ease;
    }

        .bottom-navbar .top-nav-link:hover {
            color: #1b4fc0;
            transform: translateY(-2px);
        }

    .bottom-navbar .nav-icon {
        font-size: 18px;
    }

/* =========================================================
   تنسيق شريط الروابط على الهاتف
   ========================================================= */

@media (max-width: 650px) {

    .bottom-navbar .navbar-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .bottom-navbar .top-nav-link {
        justify-content: center;
        padding: 8px;
        text-align: center;
    }
}


/* =========================================================
   جعل الصفحة كلها داخل ارتفاع الشاشة بدون Scroll
   ========================================================= */

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden !important;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}


/* =========================================================
   محتوى تسجيل الدخول يأخذ المساحة المتبقية
   بعد حجز مساحة النافبار السفلية
   ========================================================= */

.auth-shell {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    flex: 1 1 auto;
    overflow: hidden;
}


/* إلغاء ارتفاع الشاشة الكامل من جزئي الصفحة */

.hero-panel,
.form-panel {
    height: 100% !important;
    min-height: 0 !important;
}


/* =========================================================
   النافبار السفلية
   ========================================================= */

.bottom-navbar {
    position: static !important;
    flex: 0 0 auto;
    width: 100%;
    min-height: 66px;
    padding: 10px 20px;
    background: #0f2b5b;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    direction: rtl;
    z-index: 1000;
}

    .bottom-navbar .top-navbar-container {
        width: min(100%, 1200px);
        margin: 0 auto;
    }

    .bottom-navbar .navbar-links {
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 30px;
    }

    .bottom-navbar .top-nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        color: #ffffff;
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
    }

        .bottom-navbar .top-nav-link:hover {
            color: #1b4fc0;
        }

    .bottom-navbar .nav-icon {
        font-size: 17px;
    }


/* =========================================================
   ضبط الهاتف بدون عمل Scroll
   ========================================================= */

@media (max-width: 650px) {

    .bottom-navbar {
        min-height: 84px;
        padding: 7px 8px;
    }

        .bottom-navbar .navbar-links {
            min-height: 70px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 5px 8px;
        }

        .bottom-navbar .top-nav-link {
            padding: 4px;
            font-size: 11px;
            white-space: normal;
            text-align: center;
        }

        .bottom-navbar .nav-icon {
            font-size: 14px;
        }

    .form-panel {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        overflow-y: auto;
    }
}
/* =========================================================
   إصلاح ألوان روابط النافبار في وضع الموبايل
   ========================================================= */

@media (max-width: 650px) {

    .bottom-navbar .top-nav-link,
    .bottom-navbar .top-nav-link:link,
    .bottom-navbar .top-nav-link:visited {
        background: rgba(255, 255, 255, 0.10) !important;
        color: #ffffff !important;
        border: 1px solid rgba(255, 255, 255, 0.20) !important;
        border-radius: 8px;
        box-shadow: none !important;
    }

        .bottom-navbar .top-nav-link:hover,
        .bottom-navbar .top-nav-link:focus,
        .bottom-navbar .top-nav-link:active {
            background: rgba(255, 255, 255, 0.20) !important;
            color: #ffffff !important;
        }

        .bottom-navbar .top-nav-link span {
            color: #ffffff !important;
        }
}