﻿/* ============================================================
   WorkforceApply
   الهوية اللونية الرسمية للشركة

   الذهبي الأساسي:  #B89867
   الرمادي الأساسي: #4D5054
   الأخضر الثانوي:  #627E4D
   الأزرق الثانوي:  #94BBCA
   البيج:            #C5AB85
   ============================================================ */

:root {
    /* الألوان الأساسية */
    --company-gold: #B89867;
    --company-gray: #4D5054;
    /* الألوان الثانوية */
    --company-green: #627E4D;
    --company-blue: #94BBCA;
    /* درجات الذهبي */
    --gold-medium: #C5AB85;
    --gold-light: #D4C1A4;
    --gold-lighter: #E3D6C2;
    --gold-soft: #F1EAE1;
    /* درجات الرمادي */
    --gray-medium: #717376;
    --gray-light: #949698;
    --gray-lighter: #B8B9BB;
    --gray-soft: #DBDCDD;
    /* درجات الأخضر */
    --green-medium: #819871;
    --green-light: #A1B294;
    --green-lighter: #C0CBB8;
    --green-soft: #E0E5DB;
    /* درجات الأزرق */
    --blue-medium: #A9C9D5;
    --blue-light: #BFD6DF;
    --blue-lighter: #D4E4EA;
    --blue-soft: #EAF1F4;
    /* الأسطح والنصوص */
    --surface: #FFFFFF;
    --page-background: #F9F7F3;
    --text: #4D5054;
    --muted: #717376;
    --border: #DBDCDD;
    /* ألوان الحالات */
    --success: #627E4D;
    --success-background: #E0E5DB;
    --danger: #A54B50;
    --danger-background: #FBEDEE;
    --warning: #B89867;
    --warning-background: #F1EAE1;
    --info: #6F9BAD;
    --info-background: #EAF1F4;
    /* الظلال */
    --shadow-small: 0 4px 14px rgba(77, 80, 84, 0.08);
    --shadow-medium: 0 12px 34px rgba(77, 80, 84, 0.14);
    /* الحواف */
    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 22px;
    --transition: 180ms ease;
}

/* ============================================================
   الإعدادات العامة
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: radial-gradient( circle at 8% 8%, rgba(148, 187, 202, 0.16), transparent 30% ), radial-gradient( circle at 92% 90%, rgba(98, 126, 77, 0.09), transparent 28% ), linear-gradient( 180deg, #FFFFFF 0%, var(--page-background) 100% );
    font-family: Tahoma, Arial, "Segoe UI", sans-serif;
    line-height: 1.7;
}

/*
    ضروري حتى يبقى الفوتر في أسفل الشاشة
    عندما يكون محتوى الصفحة قصيرًا.
*/
#form1 {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
}

::selection {
    color: var(--company-gray);
    background: var(--gold-light);
}

/* ============================================================
   سهولة الوصول
   ============================================================ */

.skip-link {
    position: fixed;
    top: -100px;
    right: 16px;
    z-index: 9999;
    padding: 10px 16px;
    color: #FFFFFF;
    background: var(--company-gray);
    border: 1px solid var(--company-gold);
    border-radius: var(--radius-small);
    transition: top var(--transition);
}

    .skip-link:focus {
        top: 16px;
    }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(184, 152, 103, 0.42);
    outline-offset: 3px;
}

/* ============================================================
   الهيدر
   ============================================================ */

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(219, 220, 221, 0.95);
    box-shadow: var(--shadow-small);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* الخط العلوي بألوان الهوية */

.header-accent {
    height: 4px;
    background: linear-gradient( 90deg, var(--company-blue) 0%, var(--company-green) 34%, var(--company-gold) 68%, var(--gold-medium) 100% );
}

.header-container {
    width: min(1180px, calc(100% - 32px));
    min-height: 78px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ============================================================
   هوية البوابة
   ============================================================ */

.brand-link {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
}

    .brand-link:focus-visible {
        outline-color: rgba(184, 152, 103, 0.5);
    }

/* أيقونة البوابة */

.brand-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    color: #FFFFFF;
    background: linear-gradient( 145deg, var(--company-gold), var(--gold-medium) );
    border: 1px solid var(--gold-light);
    border-radius: 14px;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px rgba(184, 152, 103, 0.26);
}

    .brand-mark svg {
        width: 28px;
        height: 28px;
    }

/* اسم البوابة */

.brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

    .brand-text strong {
        color: var(--company-gray);
        font-size: 19px;
        font-weight: 800;
        white-space: nowrap;
    }

    .brand-text small {
        color: var(--gray-medium);
        font-size: 11px;
        letter-spacing: 0.7px;
        direction: ltr;
        text-align: right;
    }

/* ============================================================
   القائمة الرئيسية
   ============================================================ */

.main-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    min-height: 44px;
    padding: 9px 14px;
    color: var(--company-gray);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

    .nav-link:hover {
        color: var(--company-green);
        background: var(--green-soft);
        border-color: var(--green-lighter);
        transform: translateY(-1px);
    }

    .nav-link:focus-visible {
        outline-color: rgba(98, 126, 77, 0.34);
    }

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
}

    .nav-icon svg {
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9px;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

/* زر تقديم طلب جديد */

.nav-link-primary {
    color: #FFFFFF;
    background: linear-gradient( 135deg, var(--company-green), var(--green-medium) );
    border-color: var(--company-green);
    box-shadow: 0 7px 18px rgba(98, 126, 77, 0.22);
}

    .nav-link-primary:hover {
        color: #FFFFFF;
        background: linear-gradient( 135deg, var(--green-medium), var(--company-green) );
        border-color: var(--company-gold);
        box-shadow: 0 9px 22px rgba(98, 126, 77, 0.28);
    }

/* ============================================================
   زر قائمة الجوال
   ============================================================ */

.mobile-menu-button {
    width: 44px;
    height: 44px;
    padding: 10px;
    background: #FFFFFF;
    border: 1px solid var(--gray-soft);
    border-radius: 12px;
    cursor: pointer;
    display: none;
}

    .mobile-menu-button:hover {
        background: var(--gold-soft);
        border-color: var(--gold-light);
    }

    .mobile-menu-button span {
        width: 100%;
        height: 2px;
        margin: 4px 0;
        background: var(--company-gray);
        border-radius: 2px;
        display: block;
        transition: transform var(--transition), opacity var(--transition);
    }

/* ============================================================
   محتوى الصفحات
   ============================================================ */

.main-content {
    width: 100%;
    padding: 44px 0 56px;
    flex: 1 0 auto;
}

.page-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

/* ============================================================
   الفوتر
   ============================================================ */

.main-footer {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.88);
    background: linear-gradient( 135deg, var(--company-gray), var(--gray-medium) );
    border-top: 3px solid var(--company-gold);
}

.footer-container {
    width: min(1180px, calc(100% - 32px));
    min-height: 130px;
    margin: 0 auto;
    padding: 28px 0;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-mark {
    width: 10px;
    height: 42px;
    flex: 0 0 10px;
    background: linear-gradient( 180deg, var(--gold-medium), var(--company-gold) );
    border-radius: 10px;
}

.footer-brand strong {
    color: #FFFFFF;
    font-size: 15px;
}

.footer-brand p {
    margin: 3px 0 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

    .footer-links a {
        transition: color var(--transition);
    }

        .footer-links a:hover {
            color: var(--gold-light);
        }

.footer-copy {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    white-space: nowrap;
}

/* ============================================================
   Toast الموحد
   ============================================================ */

.app-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 3000;
    width: min(430px, calc(100% - 32px));
    min-height: 64px;
    padding: 13px 14px;
    color: var(--text);
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-right: 5px solid var(--info);
    border-radius: 14px;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    gap: 12px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}

    .app-toast.show {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }

    /* Toast نجاح */

    .app-toast.success {
        background: var(--success-background);
        border-right-color: var(--success);
    }

    /* Toast خطأ */

    .app-toast.error {
        background: var(--danger-background);
        border-right-color: var(--danger);
    }

    /* Toast تحذير */

    .app-toast.warning {
        background: var(--warning-background);
        border-right-color: var(--warning);
    }

    /* Toast معلومات */

    .app-toast.info {
        background: var(--info-background);
        border-right-color: var(--info);
    }

.toast-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

    .toast-icon::before {
        content: "i";
        font-size: 14px;
        font-weight: 800;
        line-height: 1;
    }

.app-toast.success .toast-icon {
    color: var(--success);
}

    .app-toast.success .toast-icon::before {
        content: "✓";
    }

.app-toast.error .toast-icon {
    color: var(--danger);
}

    .app-toast.error .toast-icon::before {
        content: "!";
    }

.app-toast.warning .toast-icon {
    color: var(--warning);
}

    .app-toast.warning .toast-icon::before {
        content: "!";
    }

.app-toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
}

.toast-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0;
    color: var(--gray-medium);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

    .toast-close:hover {
        color: var(--danger);
        background: rgba(77, 80, 84, 0.07);
    }

/* ============================================================
   شاشة التحميل
   ============================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    padding: 20px;
    background: rgba(77, 80, 84, 0.68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
}

    .loading-overlay.show {
        visibility: visible;
        opacity: 1;
    }

.loading-card {
    width: min(360px, 100%);
    padding: 30px 24px;
    text-align: center;
    background: #FFFFFF;
    border: 1px solid var(--gold-light);
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .loading-card strong {
        margin-top: 16px;
        color: var(--company-gray);
        font-size: 16px;
    }

    .loading-card small {
        margin-top: 5px;
        color: var(--gray-medium);
        font-size: 12px;
    }

.loading-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid var(--gray-soft);
    border-top-color: var(--company-gold);
    border-right-color: var(--company-green);
    border-radius: 50%;
    animation: loading-spin 750ms linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   الشاشات المتوسطة والجوال
   ============================================================ */

@media (max-width: 820px) {
    .header-container {
        position: relative;
        min-height: 72px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

        .brand-mark svg {
            width: 26px;
            height: 26px;
        }

    .brand-text strong {
        font-size: 17px;
    }

    .mobile-menu-button {
        display: block;
    }

    .main-navigation {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        left: 0;
        padding: 12px;
        background: #FFFFFF;
        border: 1px solid var(--border);
        border-top: 3px solid var(--company-gold);
        border-radius: 16px;
        box-shadow: var(--shadow-medium);
        display: none;
        flex-direction: column;
        align-items: stretch;
    }

        .main-navigation.open {
            display: flex;
        }

    .nav-link {
        width: 100%;
    }

    .main-content {
        padding: 28px 0 40px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 18px;
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
    }

        .footer-brand div {
            text-align: right;
        }

    .footer-links {
        justify-content: center;
    }

    .app-toast {
        right: 16px;
        bottom: 16px;
    }
}

/* ============================================================
   شاشات الجوال الصغيرة
   ============================================================ */

@media (max-width: 460px) {
    .header-container,
    .page-container,
    .footer-container {
        width: min(100% - 22px, 1180px);
    }

    .brand-text small {
        display: none;
    }

    .brand-mark {
        border-radius: 12px;
    }

    .main-content {
        padding-top: 22px;
    }

    .footer-copy {
        white-space: normal;
    }
}

/* ============================================================
   تقليل الحركة لمن يفعّل الخيار في نظام التشغيل
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
