/* =====================================================================
   تطبيق المرجع القانوني — ورقة الأنماط الرئيسية
   الهوية: أخضر العلم السوري #007A3D + الأبيض | RTL | Mobile-first
   ===================================================================== */

:root {
    --green:        #007A3D;
    --green-dark:   #005a2c;
    --green-darker: #004d26;
    --green-light:  #e8f5ee;
    --white:        #ffffff;
    --ink:          #1c2b22;
    --ink-soft:     #4c5c53;
    --line:         #dce7e0;
    --danger:       #c0392b;
    --gold:         #b98a2f;
    --radius:       12px;
    --shadow:       0 2px 10px rgba(0, 122, 61, .08);
    --shadow-lg:    0 8px 28px rgba(0, 122, 61, .16);
    --font: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
    font-family: var(--font);
    background: #f6faf7;
    color: var(--ink);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip; /* منع أي عنصر من توسيع الصفحة أفقياً (قائمة المستخدم وغيرها) */
}

img { max-width: 100%; height: auto; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }

.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 16px;
}

/* ================= الترويسة ================= */
.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--green);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-block: 10px;
    flex-wrap: wrap;             /* يلتف بأناقة على الشاشات الصغيرة */
}

.brand { flex-shrink: 0; }
.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--green);
    object-fit: cover;
    background: var(--white);
}

.header-title { flex: 1; min-width: 0; }
.header-title h1 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--green-darker);
    line-height: 1.4;
    overflow-wrap: break-word;   /* يلتف بدل القص على الجوال */
}
.header-subtitle {
    display: none;               /* يظهر من 768px فأعلى فقط */
    font-size: .8rem;
    color: var(--ink-soft);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* أزرار الضيف في الترويسة: دخول / الرجاء الاشتراك */
.header-auth { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: .88rem;
    font-weight: 700;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.header-btn:hover { text-decoration: none; }
.header-btn-outline {
    border: 1.5px solid var(--green);
    color: var(--green);
    background: var(--white);
}
.header-btn-outline:hover { background: var(--green-light); color: var(--green-dark); }
.header-btn-green {
    background: var(--green);
    color: var(--white);
    border: 1.5px solid var(--green);
}
.header-btn-green:hover { background: var(--green-dark); color: var(--white); }

.appt-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--green-light);
    border: 1.5px solid var(--green);
    color: var(--green);
    font-size: 1.1rem;
    transition: background .2s, color .2s, transform .2s;
}
.appt-bell:hover {
    background: var(--green);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
}
.appt-count {
    position: absolute;
    top: -5px;
    inset-inline-start: -5px;
    min-width: 19px;
    height: 19px;
    padding-inline: 5px;
    background: var(--danger);
    color: var(--white);
    border-radius: 999px;
    border: 2px solid var(--white);
    font-size: .68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.15); opacity: .8; }
}

/* ================= شريط التنقل ================= */
.main-nav {
    background: var(--green);
    box-shadow: 0 4px 20px rgba(0, 122, 61, .25);
}

.nav-inner { position: relative; }

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-block: 8px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .22); }
.nav-toggle-bar {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--white);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-menu {
    list-style: none;
    display: none;               /* تُفتح عبر الزر في الجوال */
    flex-direction: column;
    padding-bottom: 12px;
}
.nav-menu.open { display: flex; }

.nav-menu a,
.nav-menu > li > span {
    display: block;
    color: rgba(255, 255, 255, .88);
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 500;
    font-size: .95rem;
    transition: background .25s, color .25s;
}
.nav-menu a i { margin-inline-end: 6px; opacity: .9; }
.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, .18);
    color: var(--white);
    text-decoration: none;
}

.nav-item-disabled span {
    color: rgba(255, 255, 255, .5) !important;
    cursor: not-allowed;
}

/* أزرار الضيف القديمة أُزيلت — الدخول/الاشتراك الآن في الترويسة */

/* قائمة المستخدم المنسدلة (في الترويسة) */
.nav-user { position: relative; }

.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--green-light);
    border: 1.5px solid var(--green);
    border-radius: 999px;
    padding: 6px 16px;
    color: var(--green-darker);
    font-family: var(--font);
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    transition: background .2s, color .2s;
    max-width: 200px;
}
.nav-user-btn:hover, .nav-user.open .nav-user-btn { background: var(--green); color: var(--white); }
.nav-user-name {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-user-caret { font-size: .7rem; transition: transform .2s; }
.nav-user.open .nav-user-caret { transform: rotate(180deg); }

.nav-user-menu {
    list-style: none;
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0; /* تُفتح باتجاه داخل الشاشة — الزر في أقصى اليسار */
    background: var(--white);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 190px;
    max-width: calc(100vw - 16px);
    z-index: 220;
}
.nav-user.open .nav-user-menu { display: block; }

.nav-user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink) !important;
    border-radius: 10px !important;
    padding: 9px 14px !important;
    font-weight: 500;
}
.nav-user-menu a i { width: 18px; text-align: center; color: var(--green); opacity: 1 !important; }
.nav-user-menu a:hover { background: var(--green-light) !important; color: var(--green) !important; }
.nav-user-menu a.nav-logout, .nav-user-menu a.nav-logout i { color: var(--danger) !important; }
.nav-user-menu a.nav-logout:hover { background: #fdecea !important; }

.nav-user-divider { border-top: 1px solid var(--line); margin-block: 6px; }

/* ================= المحتوى ================= */
.site-main { flex: 1; padding-block: 24px 40px; }

/* ================= شبكة أيقونات الشاشة الرئيسية ================= */
.home-hero {
    text-align: center;
    margin-bottom: 28px;
}
.home-hero h2 {
    color: var(--green-darker);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.home-hero p { color: var(--ink-soft); }

.icons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.icon-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 12px;
    text-align: center;
    color: var(--ink);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.icon-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green);
    text-decoration: none;
    color: var(--green-darker);
}
.icon-card .icon-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    font-size: 1.7rem;
    background: var(--green-light);
    border: 2px solid var(--green);
    border-radius: 50%;
    margin-bottom: 10px;
}
.icon-card h3 { font-size: .98rem; font-weight: 700; }

.icon-card.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}
.icon-card.is-disabled:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--line);
    color: var(--ink);
}
.icon-card .badge-soon {
    display: inline-block;
    margin-top: 6px;
    font-size: .72rem;
    background: var(--green-light);
    color: var(--green-darker);
    border-radius: 999px;
    padding: 2px 10px;
}

/* ================= النماذج (دخول / تسجيل) ================= */
.auth-wrap {
    max-width: 480px;
    margin-inline: auto;
}
.auth-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 4px solid var(--green);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 26px 22px;
}
.auth-card h2 {
    text-align: center;
    color: var(--green-darker);
    font-size: 1.35rem;
    margin-bottom: 4px;
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--ink-soft);
    font-size: .9rem;
    margin-bottom: 20px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: .95rem;
}
.form-group label .req { color: var(--danger); }

.form-control {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: #fcfdfb;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 11px 14px;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 122, 61, .15);
    background: var(--white);
}
.form-control.is-invalid { border-color: var(--danger); }

.field-error {
    color: var(--danger);
    font-size: .84rem;
    margin-top: 5px;
}
.field-hint {
    color: var(--ink-soft);
    font-size: .8rem;
    margin-top: 5px;
}

.btn {
    display: inline-block;
    width: 100%;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
    color: var(--white);
    background: var(--green);
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.btn:hover { background: var(--green-dark); color: var(--white); text-decoration: none; }
.btn:active { transform: scale(.99); }
.btn-outline {
    background: var(--white);
    color: var(--green);
    border: 2px solid var(--green);
}
.btn-outline:hover { background: var(--green-light); color: var(--green-darker); }

.auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: .92rem;
    color: var(--ink-soft);
}

/* ================= التنبيهات ================= */
.alert {
    position: relative;
    border-radius: 10px;
    padding: 12px 44px 12px 16px;
    margin-bottom: 16px;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-success { background: #e7f7ee; color: #145a32; border-color: #a9dfbf; }
.alert-danger  { background: #fdecea; color: #922b21; border-color: #f5b7b1; }
.alert-warning { background: #fef9e7; color: #7d6608; border-color: #f9e79f; }
.alert-close {
    position: absolute;
    top: 8px;
    inset-inline-end: 12px;
    background: none;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: .6;
}
.alert-close:hover { opacity: 1; }

/* ================= النافذة المنبثقة ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 40, 15, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 16px;
}
.modal-overlay.show { display: flex; }

.modal-box {
    background: var(--white);
    border-radius: 16px;
    border-top: 5px solid var(--green);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
    padding: 30px 24px 24px;
    text-align: center;
    animation: modalIn .3s ease;
}
@keyframes modalIn {
    from { transform: translateY(18px) scale(.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-box .modal-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--green-light);
    border: 2px solid var(--green);
    border-radius: 50%;
}
.modal-box h3 {
    color: var(--green-darker);
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.modal-box p { color: var(--ink-soft); margin-bottom: 20px; }

/* ================= التوست ================= */
.toast {
    position: fixed;
    bottom: 22px;
    inset-inline-start: 50%;
    transform: translateX(50%) translateY(20px);
    background: var(--ink);
    color: var(--white);
    border-radius: 999px;
    padding: 10px 22px;
    font-size: .92rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 600;
    max-width: calc(100vw - 32px);
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

/* ================= التذييل (بنمط التصميم المرجعي) ================= */
.site-footer {
    background: var(--green-dark);
    color: rgba(255, 255, 255, .8);
    margin-top: auto;
    border-top: 4px solid var(--green-darker);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block: 38px;
}
.footer-col h3 {
    color: var(--white);
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; font-size: .92rem; }
.footer-col li i { width: 18px; text-align: center; margin-inline-end: 6px; opacity: .85; }
.footer-col p { font-size: .92rem; color: rgba(255, 255, 255, .78); }
.footer-col a { color: rgba(255, 255, 255, .72); transition: color .2s; }
.footer-col a:hover { color: var(--white); text-decoration: none; }

/* أيقونات التواصل الاجتماعي */
.social-links { display: flex; gap: 8px; margin-top: 14px; }
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
    color: var(--white) !important;
    transition: background .25s, transform .25s;
}
.social-links a:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }

/* حالة الاشتراك في التذييل */
.footer-sub {
    margin-top: 14px;
    background: rgba(255, 255, 255, .08);
    border-radius: 10px;
    padding: 10px 14px;
}
.footer-sub p { font-size: .88rem; margin: 0; }
.footer-sub a { color: #ffe27a; font-weight: 700; }
.footer-sub a:hover { color: var(--white); }

.sub-days strong { color: #ffe27a; font-size: 1.05rem; }
.sub-days .sub-days-low, .sub-days-low { color: #ff9d8a !important; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-block: 14px;
    text-align: center;
    font-size: .85rem;
    color: rgba(255, 255, 255, .75);
}

/* ================= نقاط التحول (Tablet / Desktop) ================= */
@media (min-width: 480px) {
    .icons-grid { grid-template-columns: repeat(3, 1fr); }
    .brand-logo { width: 56px; height: 56px; }
    .header-title h1 { font-size: 1.15rem; }
}

@media (min-width: 768px) {
    .brand-logo { width: 68px; height: 68px; }
    .header-title h1 { font-size: 1.4rem; }
    .header-subtitle { display: block; }
    .icons-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-card { padding: 32px 30px; }
}

@media (min-width: 992px) {
    .nav-toggle { display: none; }
    .nav-menu {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 2px;
        padding-block: 8px;
    }
    .nav-menu a, .nav-menu > li > span { padding: 8px 13px; font-size: .9rem; }
    .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 34px; }
    .icons-grid { grid-template-columns: repeat(5, 1fr); }
    .home-hero h2 { font-size: 1.9rem; }
}

/* هواتف صغيرة جداً: ترويسة من صفّين —
   الصف الأول: الشعار + اسم المنصة (لا يلتف حرفاً حرفاً)
   الصف الثاني: أزرار المستخدم (دخول/اشتراك/قائمة المستخدم/الجرس) بعرض كامل */
@media (max-width: 479px) {
    .header-inner { row-gap: 8px; }
    .brand { order: 1; }
    .header-title {
        order: 2;
        flex: 1 1 auto;
        min-width: 130px;        /* يمنع انهيار العنوان إلى حروف متراصة */
    }
    .header-title h1 { overflow-wrap: normal; word-break: keep-all; }
    .header-user {
        order: 3;
        flex: 0 0 100%;          /* صف ثانٍ بعرض كامل */
        justify-content: space-between; /* زر الاشتراك يميناً وقائمة المستخدم يساراً */
        gap: 7px;
    }
    /* عندما تكون قائمة المستخدم وحدها في الصف (بدون زر اشتراك/جرس) — تُثبَّت أقصى اليسار */
    .header-user > .nav-user:only-child { margin-inline-start: auto; }
    /* الزائر: زر «اشتراك» يميناً وزر «دخول» يساراً — مثل عرض المشترك المجاني */
    .header-user > .header-auth { flex: 1 1 100%; display: flex; justify-content: space-between; }
    .header-auth .header-btn-green { order: -1; }
    .header-btn { padding: 6px 13px; font-size: .8rem; gap: 5px; }
    .nav-user-btn { max-width: 160px; padding: 5px 12px; }
    .nav-user-name { max-width: 90px; }
    .appt-bell { width: 38px; height: 38px; font-size: 1rem; }
}

/* إبراز المادة عند الانتقال إليها بالمرساة + مراعاة الترويسة اللاصقة */
.article-card { scroll-margin-top: 150px; }
.article-card:target {
    box-shadow: 0 0 0 3px rgba(0, 122, 61, .35);
    border-color: var(--green);
}

/* طباعة */
@media print {
    .site-header, .site-footer, .main-nav, .btn { display: none !important; }
}

/* =====================================================================
   المرحلة الثانية — صفحات المحتوى
   ===================================================================== */

/* ---------- ترويسة الصفحات ---------- */
.page-hero {
    text-align: center;
    margin-bottom: 22px;
    padding: 22px 16px;
    background: linear-gradient(135deg, var(--green-light), #ffffff);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.page-hero h2 { color: var(--green-darker); font-size: 1.4rem; font-weight: 800; }
.page-hero p  { color: var(--ink-soft); font-size: .95rem; margin-top: 4px; }
.hero-badge { color: var(--gold); font-size: 1rem; }

/* ---------- بوكس البحث الموحد ---------- */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.search-input {
    flex: 1;
    font-family: inherit;
    font-size: 1rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
    min-width: 0;
}
.search-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 122, 61, .15);
}
.search-btn {
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    color: var(--white);
    background: var(--green);
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.search-btn:hover { background: var(--green-dark); }

/* ---------- رقائق البحث (تصميم search_EX.jpeg) ---------- */
.search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f1eefb;
    border: 1px solid #ddd6f3;
    border-radius: 10px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1px solid #cfc7ea;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--ink);
}
.chip-x {
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}
.chip-x:hover { color: var(--danger); text-decoration: none; }
.chip-clear { background: var(--green); color: var(--white); border-color: var(--green); }
.chip-clear:hover { background: var(--green-dark); color: var(--white); text-decoration: none; }

/* ---------- شريط الفلاتر (قائمة التصنيفات المنسدلة تشيك) ---------- */
.filters-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}
.filter-dropdown { position: relative; }
.filter-dropdown summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1.5px solid var(--green);
    color: var(--green-darker);
    border-radius: 999px;
    padding: 9px 18px;
    font-weight: 700;
    font-size: .95rem;
    user-select: none;
}
.filter-dropdown summary::-webkit-details-marker { display: none; }
.filter-dropdown summary:hover { background: var(--green-light); }
.filter-count {
    background: var(--green);
    color: var(--white);
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
}
.filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    z-index: 150;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    width: min(320px, calc(100vw - 32px));
    max-height: 60vh;
    overflow-y: auto;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .95rem;
}
.check-row:hover { background: var(--green-light); }
.check-row input { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.filter-panel .btn { margin-top: 10px; padding: 9px; font-size: .95rem; }
.filter-reset {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: .85rem;
}

.results-count { color: var(--ink-soft); font-size: .92rem; margin-bottom: 12px; }
.results-count strong { color: var(--green-darker); }

/* ---------- قائمة القوانين ---------- */
.law-list { display: flex; flex-direction: column; gap: 10px; }
.law-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    background: var(--white);
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--green);
    border-radius: 10px;
    padding: 13px 16px;
    color: var(--ink);
    transition: box-shadow .2s, transform .2s;
}
.law-row:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.law-cat {
    background: var(--green-light);
    color: var(--green-darker);
    border-radius: 999px;
    padding: 2px 12px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.law-name { flex: 1; font-weight: 700; min-width: 200px; }
.law-meta { color: var(--ink-soft); font-size: .85rem; white-space: nowrap; }

/* ---------- شاشة القانون (مواد + شريط جانبي) ---------- */
.law-layout { display: flex; flex-direction: column; gap: 18px; }
.laws-side {
    display: none;               /* تُخفى على الجوال — تظهر من 900px فأعلى */
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    max-height: 420px;
    overflow-y: auto;
}
.laws-side h3 {
    font-size: 1rem;
    color: var(--green-darker);
    border-bottom: 2px solid var(--green);
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.laws-side ul { list-style: none; }
.laws-side li a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--ink);
    font-size: .88rem;
    line-height: 1.5;
}
.laws-side li a small { color: var(--ink-soft); }
.laws-side li a:hover { background: var(--green-light); text-decoration: none; }
.laws-side li a.current { background: var(--green); color: var(--white); }
.laws-side li a.current:hover { background: var(--green-dark); color: var(--white); }
.laws-side li a.current small { color: rgba(255,255,255,.8); }

.jump-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: .92rem;
}
.jump-form input {
    width: 120px;
    font-family: inherit;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
}
.btn-sm { width: auto; padding: 8px 16px; font-size: .9rem; }

.article-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    scroll-margin-top: 150px;
    transition: box-shadow .2s;
}
.article-card:hover { box-shadow: var(--shadow); }
.article-flash { animation: flashBg 1.8s ease; }
@keyframes flashBg {
    0%, 60% { background: #fff8e1; border-color: var(--gold); }
    100% { background: var(--white); }
}
.article-title {
    color: var(--green-darker);
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.article-text { color: var(--ink); line-height: 2; }

.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.act-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 700;
    color: var(--green-darker);
    background: var(--green-light);
    border: 1px solid var(--green);
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.act-btn:hover { background: var(--green); color: var(--white); text-decoration: none; }
.act-count {
    background: var(--green);
    color: var(--white);
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
}
.act-btn:hover .act-count { background: var(--white); color: var(--green-darker); }
.act-danger { color: var(--danger); border-color: var(--danger); background: #fdecea; }
.act-danger:hover { background: var(--danger); color: var(--white); }

.article-panel {
    margin-top: 12px;
    background: #fbfdfb;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
}
.article-panel h4 { color: var(--green-darker); font-size: .95rem; margin-bottom: 8px; }
.panel-item {
    padding: 10px 12px;
    background: var(--white);
    border-inline-start: 3px solid var(--gold);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: .92rem;
    line-height: 1.9;
}

/* ---------- نتائج البحث ---------- */
.search-results { display: flex; flex-direction: column; gap: 12px; }
.result-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--gold);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--ink);
    transition: box-shadow .2s, transform .2s;
}
.result-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.result-law { font-weight: 700; font-size: .95rem; }
.result-mada { color: var(--green-darker); font-weight: 800; font-size: .92rem; margin-bottom: 4px; }
.result-text { color: var(--ink-soft); font-size: .92rem; line-height: 1.9; }

mark.hl {
    background: #ffe3e0;
    color: var(--danger);
    font-weight: 800;
    border-radius: 4px;
    padding: 0 3px;
}

/* ---------- ترقيم الصفحات ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.page-btn {
    background: var(--white);
    border: 1.5px solid var(--green);
    color: var(--green-darker);
    border-radius: 999px;
    padding: 8px 20px;
    font-weight: 700;
    font-size: .92rem;
}
.page-btn:hover { background: var(--green); color: var(--white); text-decoration: none; }
.page-info { color: var(--ink-soft); font-size: .9rem; }

/* ---------- الاجتهادات ---------- */
.ejt-list { display: flex; flex-direction: column; gap: 10px; }
.ejt-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 16px;
    transition: box-shadow .2s;
}
.ejt-card:hover { box-shadow: var(--shadow); }
.ejt-year {
    display: inline-block;
    background: var(--green);
    color: var(--white);
    border-radius: 999px;
    padding: 1px 12px;
    font-size: .78rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.ejt-text { font-size: .95rem; line-height: 1.9; margin-bottom: 6px; }
.read-more { font-size: .88rem; font-weight: 700; }

/* ---------- بطاقات العقود/الصيغ/المرافعات ---------- */
.doc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.doc-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    color: var(--ink);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--green); text-decoration: none; }
.doc-card-icon { font-size: 1.8rem; }
.doc-card h3 { color: var(--green-darker); font-size: 1.02rem; margin: 8px 0 6px; }
.doc-card p { color: var(--ink-soft); font-size: .88rem; line-height: 1.8; margin-bottom: 8px; }

/* ---------- صفحة عرض النص (ورقة) ---------- */
.doc-paper {
    max-width: 820px;
    margin-inline: auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 20px;
}
.doc-head { text-align: center; border-bottom: 3px double var(--green); padding-bottom: 14px; margin-bottom: 16px; }
.doc-head-icon { font-size: 2.2rem; }
.doc-head h2 { color: var(--green-darker); font-size: 1.3rem; margin: 8px 0 2px; }
.doc-head-cat { color: var(--ink-soft); font-size: .88rem; }
.doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 18px;
}
.doc-body { line-height: 2.1; font-size: 1.02rem; }

/* ---------- حالة فارغة ---------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--ink-soft);
}
.empty-state h3 { color: var(--green-darker); margin-bottom: 8px; }
.empty-icon { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.empty-state .btn { width: auto; margin-top: 14px; padding: 10px 26px; }
.empty-note { color: var(--ink-soft); font-size: .9rem; }

/* ---------- الرئيسية: المحتوى المميز ---------- */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 30px;
}
.featured-col {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}
.featured-title {
    color: var(--green-darker);
    font-size: 1.05rem;
    font-weight: 800;
    border-bottom: 2px solid var(--green);
    padding-bottom: 8px;
    margin-bottom: 10px;
}
.featured-item {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ink);
    transition: background .2s;
}
.featured-item:hover { background: var(--green-light); text-decoration: none; }
.featured-cat { display: block; font-size: .75rem; color: var(--gold); font-weight: 700; }
.featured-name { display: block; font-size: .9rem; font-weight: 500; line-height: 1.7; }

/* ---------- الصفحات الثابتة (حول/خصوصية/اتفاقية/اتصل) ---------- */
.static-page { max-width: 860px; margin-inline: auto; }
.static-hero { text-align: center; margin-bottom: 22px; }
.static-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid var(--green);
    box-shadow: var(--shadow-lg);
    margin-bottom: 12px;
}
.static-hero h2 { color: var(--green-darker); font-size: 1.5rem; }
.static-tagline { color: var(--ink-soft); font-size: 1.05rem; }
.static-brand { color: var(--gold); font-weight: 700; font-size: .95rem; }
.static-signature { text-align: center; color: var(--green-darker); font-weight: 700; margin-top: 26px; }
.static-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}
.static-cta .btn { width: auto; padding: 12px 30px; }

.prose {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-bottom: 18px;
}
.prose .lead { font-size: 1.05rem; font-weight: 500; color: var(--ink); }
.prose p { margin-bottom: 12px; line-height: 2; }
.prose h3 {
    color: var(--green-darker);
    font-size: 1.12rem;
    margin: 20px 0 10px;
    padding-inline-start: 12px;
    border-inline-start: 4px solid var(--green);
}
.prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-inline-start: 24px; margin-bottom: 12px; }
.prose li { margin-bottom: 8px; line-height: 1.95; }
.prose.legal li { font-size: .95rem; }

/* ---------- اتصل بنا ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 22px;
}
.contact-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}
.contact-card h4 { color: var(--green-darker); margin-bottom: 12px; font-size: 1.02rem; }
.contact-list { list-style: none; }
.contact-list li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
    font-size: .92rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.contact-list li:last-child { border-bottom: none; }
.contact-list li span { color: var(--ink-soft); font-size: .82rem; }
.contact-note { color: var(--ink-soft); font-size: .85rem; margin-top: 10px; }
.contact-form-wrap {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 18px;
    margin-bottom: 20px;
}
.contact-form-wrap h3 { color: var(--green-darker); margin-bottom: 4px; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions .btn { width: auto; padding: 10px 26px; }

.footer-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; }

/* ---------- دفتر المواعيد ---------- */
.cal-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}
.cal-toolbar .search-box { margin-bottom: 0; flex: 1; }
.btn-add { width: auto; padding: 10px 24px; }

.appt-form-wrap {
    background: var(--white);
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--green);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.appt-form h3 { color: var(--green-darker); margin-bottom: 14px; }

.appt-list { display: flex; flex-direction: column; gap: 12px; }
.appt-card {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    align-items: flex-start;
}
.appt-past { opacity: .6; }
.appt-date {
    text-align: center;
    background: var(--green-light);
    border: 1px solid var(--green);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 96px;
}
.appt-day { display: block; font-weight: 800; color: var(--green-darker); font-size: .95rem; direction: ltr; }
.appt-time { display: block; font-size: .8rem; color: var(--ink-soft); direction: ltr; }
.appt-body { flex: 1; min-width: 180px; }
.appt-body h3 { font-size: 1rem; color: var(--ink); margin-bottom: 4px; }
.appt-body p { font-size: .9rem; color: var(--ink-soft); line-height: 1.8; }
.appt-actions { display: flex; gap: 8px; align-items: center; }
.appt-actions form { margin: 0; }

.page-side-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: .92rem;
    font-weight: 700;
}

/* ---------- نقاط تحول المرحلة الثانية ---------- */
@media (min-width: 640px) {
    .filters-bar { flex-direction: row; align-items: flex-start; }
    .filters-search { flex: 1; }
    .doc-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr 1fr; }
    .cal-toolbar { flex-direction: row; align-items: center; }
}

@media (min-width: 900px) {
    .featured-grid { grid-template-columns: repeat(3, 1fr); }
    .doc-grid { grid-template-columns: repeat(3, 1fr); }
    .law-layout { flex-direction: row; align-items: flex-start; }
    .laws-side { display: block; width: 300px; flex-shrink: 0; position: sticky; top: 150px; max-height: calc(100vh - 170px); }
    .law-content { flex: 1; min-width: 0; }
    .contact-grid { grid-template-columns: 1fr 1fr; }
    .doc-paper { padding: 36px 40px; }
    .prose { padding: 30px 34px; }
    .page-hero h2 { font-size: 1.7rem; }
}

/* ---------- طباعة ---------- */
@media print {
    .no-print, .article-actions, .jump-form, .search-box, .search-chips,
    .filters-bar, .pagination, .page-side-links, .laws-side { display: none !important; }
    .doc-paper, .article-card, .prose { border: none; box-shadow: none; }
}

/* =====================================================================
   تعديلات العميل — الدفعة الأولى
   ===================================================================== */

/* ---------- شريط تنبيه نسخة العرض المجانية (ديمو) ---------- */
.demo-note {
    background: #fef9e7;
    border: 1px solid #f9e79f;
    border-inline-start: 4px solid var(--gold, #c9a227);
    color: #7d6608;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .92rem;
    margin-bottom: 14px;
    line-height: 1.9;
}
.demo-note a { color: var(--green-darker, #006b2c); font-weight: 800; }
.demo-note strong { color: #6b5306; }

/* ---------- مجلات قانونية ---------- */
.mag-card { text-decoration: none; color: inherit; display: block; }
.mag-card:hover { text-decoration: none; }
.mag-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: .88rem;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.mag-meta-view { margin: 4px 0 14px; }
.mag-tag {
    background: var(--green-light, #e6f4ec);
    border-radius: 999px;
    padding: 3px 12px;
    color: var(--green-darker, #006b2c);
}
.mag-tag strong { font-weight: 800; }
.mag-title {
    color: var(--green-darker, #006b2c);
    font-size: 1.02rem;
    font-weight: 800;
    margin-bottom: 6px;
}

/* ---------- المساعد القانوني ---------- */
.ai-answer { border-inline-start: 5px solid var(--green, #009639); margin-bottom: 22px; }
.ai-groups-title { color: var(--green-darker, #006b2c); margin: 18px 0 10px; font-size: 1.05rem; }
.ai-group { margin-bottom: 20px; }
.ai-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: .98rem;
    font-weight: 800;
    border-inline-start: 4px solid var(--green, #009639);
    padding-inline-start: 10px;
    margin-bottom: 10px;
}

/* ---------- المعلومات الشخصية ---------- */
.profile-card { max-width: 620px; }
.profile-list { margin: 0 0 18px; }
.profile-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px solid var(--line, #dce7e0);
}
.profile-row:last-child { border-bottom: none; }
.profile-row dt { width: 170px; flex-shrink: 0; color: var(--ink-soft); font-weight: 700; font-size: .92rem; }
.profile-row dt i { width: 18px; text-align: center; margin-inline-end: 6px; color: var(--green, #009639); }
.profile-row dd { margin: 0; font-weight: 700; color: var(--ink); }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-actions .btn { width: auto; padding: 10px 22px; }
.sub-type { border-radius: 999px; padding: 4px 16px; font-size: .9rem; font-weight: 800; }
.sub-type-free    { background: #eef1f4; color: #4c5c53; }
.sub-type-monthly { background: #fef3d8; color: #8a6d00; }
.sub-type-yearly  { background: #e7f7ee; color: #145a32; }
.sub-type-expired { background: #fdecea; color: #922b21; }

/* ---------- باقات الاشتراكات ---------- */
.pkg-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.pkg-card {
    background: var(--white, #fff);
    border: 1px solid var(--line, #dce7e0);
    border-top: 5px solid var(--green, #009639);
    border-radius: 16px;
    box-shadow: var(--shadow, 0 2px 10px rgba(0,0,0,.06));
    padding: 26px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pkg-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pkg-icon { font-size: 2.4rem; }
.pkg-head h3 { color: var(--green-darker, #006b2c); font-size: 1.25rem; font-weight: 800; }
.pkg-desc { color: var(--ink-soft); font-size: .95rem; line-height: 1.9; }
.pkg-prices { list-style: none; margin: 0; padding: 0; }
.pkg-prices li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--green-light, #e6f4ec);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: .95rem;
}
.pkg-prices li strong { color: var(--green-darker, #006b2c); font-size: 1.15rem; }
.pkg-cta { width: auto; align-self: center; padding: 12px 44px; font-size: 1.05rem; }
.pkg-hint { color: var(--ink-soft); font-size: .82rem; }

/* ---------- الاشتراك عبر شام كاش ---------- */
.subscribe-grid { display: grid; gap: 18px; grid-template-columns: 1fr; margin-bottom: 18px; }
.panel-card {
    background: var(--white, #fff);
    border: 1px solid var(--line, #dce7e0);
    border-radius: 16px;
    box-shadow: var(--shadow, 0 2px 10px rgba(0,0,0,.06));
    padding: 22px;
    margin-bottom: 18px;
}
.panel-card h3 { color: var(--green-darker, #006b2c); font-size: 1.08rem; margin-bottom: 14px; }
.shamcash-card { text-align: center; }
.shamcash-label { color: var(--ink-soft); margin-bottom: 4px; }
.shamcash-account {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--green-darker, #006b2c);
    background: var(--green-light, #e6f4ec);
    border-radius: 12px;
    padding: 10px;
    margin: 0 0 14px;
}
.shamcash-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 14px; }
.shamcash-qr img {
    width: 180px;
    height: 180px;
    border: 3px solid var(--green, #009639);
    border-radius: 14px;
    object-fit: contain;
    background: #fff;
}
.shamcash-qr span { color: var(--ink-soft); font-size: .85rem; }
.shamcash-steps { text-align: start; color: var(--ink-soft); font-size: .92rem; line-height: 2; }

/* ---------- صلاحيات المدراء ---------- */
.perms-fieldset { border: 1px dashed var(--line, #dce7e0); border-radius: 12px; padding: 14px; }
.perms-fieldset legend { padding: 0 8px; color: var(--ink-soft); font-size: .9rem; font-weight: 700; }
.perms-grid { display: grid; gap: 6px; grid-template-columns: 1fr; }

/* ---------- جداول بسيطة في صفحات الموقع (طلباتي السابقة وغيرها) ---------- */
.table-wrap { overflow-x: auto; }
.panel-card .admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.panel-card .admin-table th,
.panel-card .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line, #dce7e0); text-align: start; }
.panel-card .admin-table th { color: var(--green-darker, #006b2c); background: var(--green-light, #e6f4ec); }
.panel-card .admin-table tbody tr:hover { background: #f6faf7; }
.cell-muted { color: var(--ink-soft); }

/* ---------- نقاط تحول ---------- */
@media (min-width: 640px) {
    .pkg-grid { grid-template-columns: repeat(2, 1fr); }
    /* بطاقة اشتراك واحدة (اشتراك كلي) تُوسَّط في الصفحة */
    .pkg-grid:has(> .pkg-card:only-child) { grid-template-columns: minmax(0, 560px); justify-content: center; }
    .subscribe-grid { grid-template-columns: 1fr 1.2fr; }
    .perms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .perms-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ================= تعديلات Update_2 ================= */

/* زر «اشتراك» البارز في الترويسة للمشترك المجاني */
.header-btn-subscribe {
    position: relative;
    box-shadow: 0 0 0 0 rgba(0, 150, 57, .45);
    animation: subscribe-pulse 2.4s infinite;
}
@keyframes subscribe-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 150, 57, .45); }
    70%  { box-shadow: 0 0 0 10px rgba(0, 150, 57, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 150, 57, 0); }
}

/* رابط «تكملة الاشتراك» داخل قائمة المستخدم — خط عريض */
.nav-user-menu a.nav-sub-extra { font-weight: 800; }
.nav-user-menu a.nav-sub-extra strong { font-weight: 800; }

/* تلميح قرب انتهاء الاشتراك */
.sub-expiry-alert a.sub-expiry-link { color: inherit; font-weight: 800; text-decoration: underline; }
.sub-expiry-alert a.sub-expiry-link:hover { color: var(--green-darker); }

/* أيقونات Font Awesome داخل شبكة الأيقونات (سجل المحاميين / سجل الخبراء) */
.icon-card .icon-emoji i { font-size: 1.5rem; color: var(--green); }

/* ===== الظهور الدائم: محامون وخبراء المنصة ===== */
.top-members { margin-block: 26px; }
.top-members-title {
    color: var(--green-darker);
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.top-members-title i { color: var(--gold); margin-inline-end: 6px; }
.top-members-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.top-member-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
/* الكرت أصبح رابطاً لصفحة السجل — بلا خط تحتي وبلون النص العادي */
a.top-member-card { display: block; text-decoration: none; color: inherit; }
a.top-member-card:hover { color: inherit; text-decoration: none; }
.top-member-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green);
}
.top-member-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 10px;
    margin-bottom: 8px;
    background: var(--green-light);
    color: var(--green-darker);
}
.top-member-badge.is-expert { background: #fef3d8; color: #8a5a00; }
.top-member-name { display: block; font-size: .98rem; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.top-member-info { font-size: .84rem; color: var(--ink-soft); line-height: 1.8; margin: 0; }

/* ===== شركاء منصة المرجع القانوني — شريط متحرك ===== */
.partners-section { margin-block: 30px 10px; }
.partners-title {
    color: var(--green-darker);
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
}
.partners-title i { color: var(--gold); margin-inline-end: 6px; }
.partners-marquee {
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 0;
}
.partners-track {
    display: flex;
    align-items: center;
    gap: 40px;
    width: max-content;
    animation: partners-scroll 30s linear infinite;
}
.partners-marquee:hover .partners-track { animation-play-state: paused; }
@keyframes partners-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(50%); }
}
.partner-logo { display: inline-flex; flex-shrink: 0; }
.partner-logo img {
    height: 64px;
    width: auto;
    object-fit: contain;
    filter: grayscale(.35);
    transition: filter .25s, transform .25s;
}
.partner-logo:hover img { filter: none; transform: scale(1.06); }

/* لا يظهر سكشن الشركاء عند الاستعراض عبر الجوال */
@media (max-width: 767.98px) {
    .partners-section { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .partners-track { animation: none; }
    .header-btn-subscribe { animation: none; }
    .banners-track { transition: none; }
}

/* ===== لافتات الرئيسية (Update_3) — سلايدر صور بعرض الصفحة (حاوية الموقع) تحت الهدر ===== */
.banners-section {
    margin: 14px 0 22px;  /* بعرض حاوية الصفحة — متوازٍ مع باقي أقسام الموقع */
}
.banners-viewport {
    position: relative;
    overflow: hidden;
    height: 170px;
    background: var(--green-darker);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
    border: 2px solid var(--gold);
    border-radius: var(--radius, 12px);
}
.banners-track {
    display: flex;
    height: 100%;
    transition: transform .55s ease-in-out;
}
.banner-slide { flex: 0 0 100%; height: 100%; }
.banner-slide img,
.banner-slide .banner-link {
    display: block;
    width: 100%;
    height: 170px;
}
.banner-slide img { object-fit: cover; }
.banner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--green-darker);
    font-size: .95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    opacity: .85;
    transition: opacity .2s, background .2s;
}
.banner-nav:hover { opacity: 1; background: var(--white); }
.banner-prev { inset-inline-start: 14px; }
.banner-next { inset-inline-end: 14px; }
.banner-dots {
    position: absolute;
    bottom: 10px;
    inset-inline: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.banner-dot {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}
.banner-dot:hover { background: rgba(255, 255, 255, .85); }
.banner-dot.is-active { background: var(--white); transform: scale(1.25); }

/* الاظهار ليس ضمن الجوال: السكشن يُخفى على الشاشات الصغيرة */
@media (max-width: 767.98px) {
    .banners-section { display: none; }
}

/* ===== نافذة تحميل التطبيق (Update_4) ===== */
.app-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 18px; }
.app-modal[hidden] { display: none; }
.app-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 40, 20, .55); backdrop-filter: blur(3px); }
.app-modal-card {
    position: relative;
    background: var(--white);
    border-radius: 18px;
    border-top: 4px solid var(--gold);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .3);
    max-width: 420px;
    width: 100%;
    padding: 26px 24px 20px;
    text-align: center;
    animation: app-modal-in .25s ease-out;
}
@keyframes app-modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.app-modal-close {
    position: absolute; top: 10px; inset-inline-start: 12px;
    background: none; border: none; font-size: 1.7rem; line-height: 1;
    color: var(--ink-soft); cursor: pointer;
}
.app-modal-close:hover { color: var(--green); }
.app-modal-logo { width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--green); object-fit: cover; }
.app-modal-card h3 { color: var(--green-darker); margin: 12px 0 6px; }
.app-modal-desc { color: var(--ink-soft); font-size: .92rem; margin-bottom: 18px; }
.app-modal-buttons { display: grid; gap: 10px; }
.app-store-btn {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 12px 16px; border-radius: 12px; border: none; cursor: pointer;
    text-decoration: none; font-family: inherit; transition: transform .15s, box-shadow .15s;
}
.app-store-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); text-decoration: none; }
.app-store-btn i { font-size: 1.9rem; }
.app-store-btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.3; }
.app-store-btn small { font-size: .72rem; opacity: .85; }
.app-store-btn strong { font-size: 1.05rem; }
.app-android { background: #1b8a3d; color: #fff; }
.app-ios { background: #1c1c1e; color: #fff; width: 100%; }
.app-ios-instructions {
    margin-top: 14px; text-align: start; background: var(--green-light, #e9f7ef);
    border: 1px solid var(--green); border-radius: 12px; padding: 12px 16px; font-size: .88rem;
}
.app-ios-instructions h4 { color: var(--green-darker); margin-bottom: 8px; }
.app-ios-instructions ol { padding-inline-start: 20px; display: grid; gap: 6px; }
.app-ios-instructions p { margin-top: 8px; color: var(--ink-soft); }
.app-modal-note { margin-top: 14px; font-size: .8rem; color: var(--ink-soft); }
