/*
 * الصفحات القانونية (privacy.php · refund.php) - فوق auth.css (الرأس والبطاقة ومتغيرات الألوان).
 * ⚠ كل الأسماء ببادئة lg- وبنطاق .lg-legal فلا تمس صفحات الدخول.
 */
.lg-legal { --lg-ac: var(--primary-2); }
html[data-theme="light"] .lg-legal { --lg-ac: var(--primary); }
.lg-legal .lg-hero { padding-bottom: 50px; }
.lg-legal .lg-tile-ic { color: #fff; }
.lg-legal .lg-tile-ic svg { width: 40px; height: 40px; display: block; }
.lg-legal .lg-wrap { max-width: 640px; }

.lg-doc { gap: 0; padding: 18px 18px 8px; }
.lg-upd {
    align-self: flex-start; margin-bottom: 12px; padding: 5px 12px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; color: var(--text-dim);
    background: var(--surface-2); border: 1px solid var(--border);
}
.lg-upd b { color: var(--text); font-weight: 800; }
.lg-intro { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; line-height: 2; color: var(--text); }

.lg-sec { padding: 16px 0; border-top: 1px solid var(--border); }
.lg-intro + .lg-sec { margin-top: 10px; }
.lg-sec h2 {
    display: flex; align-items: center; gap: 10px; margin: 0 0 8px;
    font-size: 15px; font-weight: 800; line-height: 1.6; color: var(--text);
}
.lg-sec h2 .n {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px; padding-top: 2px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: var(--lg-ac); background: rgba(57, 120, 232, 0.16);
}
.lg-sec p { margin: 0 0 8px; font-size: 13px; font-weight: 600; line-height: 2; color: var(--text-dim); }
.lg-sec ul { margin: 0; padding: 0; list-style: none; }
.lg-sec li {
    position: relative; padding-inline-start: 18px; margin-bottom: 6px;
    font-size: 13px; font-weight: 600; line-height: 2; color: var(--text-dim);
}
.lg-sec li::before {
    content: ""; position: absolute; inset-inline-start: 3px; top: 13px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.lg-sec p + ul { margin-top: 2px; }
.lg-sec ul + p { margin-top: 8px; }

.lg-ct { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.lg-ct-i {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; text-decoration: none;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.lg-ct-i:hover { border-color: var(--primary); }
.lg-ct-i .t { font-size: 11.5px; font-weight: 700; color: var(--text-dim); }
.lg-ct-i .nm { font-size: 13px; font-weight: 800; line-height: 1.6; }
.lg-ct-i .ph { font-size: 13px; font-weight: 800; color: var(--primary); text-align: start; unicode-bidi: isolate; }
@media (max-width: 460px) { .lg-ct { grid-template-columns: 1fr; } }

.lg-nb { white-space: nowrap; unicode-bidi: isolate; direction: ltr; }

/* ==========================================================================
 * تنظيم الصفحة: بطاقات الملخص · الفهرس · الجداول · الأعمدة · الخطوات · التنبيهات
 * ========================================================================== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.lg-legal .lg-wrap { max-width: 720px; }
.lg-doc { padding: 20px 20px 14px; }
.lg-sec { scroll-margin-top: 14px; }
.lg-p2 { margin-top: 10px; }

/* ملخص سريع */
.lg-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0 6px; }
.lg-fact {
    display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.lg-fact .ic {
    width: 36px; height: 36px; border-radius: 11px; margin-bottom: 4px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; color: var(--lg-ac); background: rgba(57, 120, 232, 0.16);
}
.lg-fact .ic svg { width: 20px; height: 20px; display: block; }
.lg-fact b { font-size: 13.5px; font-weight: 800; line-height: 1.6; color: var(--text); }
.lg-fact > span:last-child { font-size: 12px; font-weight: 600; line-height: 1.8; color: var(--text-dim); }

/* الفهرس */
.lg-toc { margin: 14px 0 4px; padding: 13px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.lg-toc summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--text); }
.lg-toc summary::-webkit-details-marker { display: none; }
.lg-toc summary::after { content: ""; width: 8px; height: 8px; border-inline-end: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim); transform: rotate(45deg); transition: transform 0.15s; margin-inline-end: 4px; }
.lg-toc[open] summary::after { transform: rotate(-135deg); }
.lg-toc[open] summary { margin-bottom: 8px; }
.lg-toc ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.lg-toc a {
    display: flex; align-items: center; gap: 9px; padding: 6px 0; text-decoration: none;
    font-size: 12.5px; font-weight: 700; line-height: 1.6; color: var(--text);
}
.lg-toc a:hover .t { color: var(--primary); }
.lg-toc .n {
    flex: 0 0 auto; min-width: 22px; height: 22px; border-radius: 7px; padding-top: 1px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; color: var(--lg-ac); background: rgba(57, 120, 232, 0.16);
}

/* الجداول */
.lg-tbl { width: 100%; margin: 6px 0 2px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.lg-tbl th, .lg-tbl td { padding: 11px 14px; text-align: start; vertical-align: top; font-size: 13px; line-height: 1.95; border-top: 1px solid var(--border); }
.lg-tbl thead th {
    border-top: 0; font-size: 11.5px; font-weight: 800; color: var(--text-dim); background: var(--surface-2);
}
.lg-tbl tbody th { width: 30%; font-weight: 800; color: var(--text); background: var(--surface-2); }
.lg-tbl tbody td { font-weight: 600; color: var(--text-dim); }
.lg-tbl tbody tr:first-child th, .lg-tbl tbody tr:first-child td { border-top: 1px solid var(--border); }
.lg-tbl tbody th + td { border-inline-start: 1px solid var(--border); }

/* عمودان: يحذف/يبقى · يمكن/لا يمكن */
.lg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 2px; }
.lg-col { padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); }
.lg-col-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; font-weight: 800; color: var(--text); }
.lg-col-h .ic { width: 26px; height: 26px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.lg-col-h .ic svg { width: 15px; height: 15px; display: block; }
.lg-col ul { margin: 0; padding: 0; list-style: none; }
.lg-col li, .lg-sec .lg-col li { display: flex; gap: 9px; align-items: flex-start; padding-inline-start: 0; margin-bottom: 7px; font-size: 12.5px; line-height: 1.9; }
.lg-col li::before, .lg-sec .lg-col li::before { display: none; }
.lg-col li .mk { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 5px; }
.lg-col li .mk svg { width: 16px; height: 16px; display: block; }
.lg-col-ok { border-color: rgba(32, 168, 102, 0.45); }
.lg-col-ok .lg-col-h .ic { color: var(--success); background: rgba(32, 168, 102, 0.16); }
.lg-col-ok li .mk { color: var(--success); }
.lg-col-no { border-color: rgba(217, 67, 67, 0.4); }
.lg-col-no .lg-col-h .ic { color: var(--danger); background: rgba(217, 67, 67, 0.15); }
.lg-col-no li .mk { color: var(--danger); }
.lg-col-keep { border-color: rgba(243, 154, 34, 0.45); }
.lg-col-keep .lg-col-h .ic { color: var(--warning); background: rgba(243, 154, 34, 0.16); }
.lg-col-keep li .mk { color: var(--warning); }

/* خطوات */
.lg-steps { list-style: none; margin: 8px 0 2px; padding: 0; }
.lg-steps li { position: relative; display: flex; gap: 14px; padding-bottom: 16px; }
.lg-steps li:last-child { padding-bottom: 2px; }
.lg-steps li::after {
    content: ""; position: absolute; inset-inline-start: 14px; top: 32px; bottom: 4px; width: 2px; background: var(--border);
}
.lg-steps li:last-child::after { display: none; }
.lg-steps .no {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; padding-top: 2px; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary-2), var(--primary));
}
.lg-steps b { display: block; margin-bottom: 2px; font-size: 13.5px; font-weight: 800; line-height: 1.8; color: var(--text); }
.lg-sec .lg-steps p { margin: 0; }

/* تنبيه */
.lg-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border); }
.lg-note .ic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.lg-note .ic svg { width: 16px; height: 16px; display: block; }
.lg-note b { display: block; font-size: 13px; font-weight: 800; line-height: 1.8; color: var(--text); }
.lg-sec .lg-note p { margin: 0; font-size: 12.5px; }
.lg-note-info { background: rgba(57, 120, 232, 0.09); border-color: rgba(57, 120, 232, 0.35); }
.lg-note-info .ic { color: var(--lg-ac); background: rgba(57, 120, 232, 0.16); }
.lg-note-warn { background: rgba(243, 154, 34, 0.1); border-color: rgba(243, 154, 34, 0.45); }
.lg-note-warn .ic { color: var(--warning); background: rgba(243, 154, 34, 0.18); }

/* ذيل الصفحة */
.lg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 10px; border-top: 1px solid var(--border); }
.lg-foot a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--lg-ac); text-decoration: none; }
.lg-foot a svg { width: 15px; height: 15px; display: block; }

/* الجوال: الجدول يصير بطاقات */
@media (max-width: 560px) {
    .lg-cols { grid-template-columns: 1fr; }
    .lg-facts { gap: 8px; }
    .lg-fact { padding: 12px; }
    .lg-fact .ic { width: 32px; height: 32px; }
    .lg-fact b { font-size: 12.5px; }
    .lg-fact > span:last-child { font-size: 11.5px; line-height: 1.7; }
    .lg-toc ol { grid-template-columns: 1fr; }
    .lg-tbl, .lg-tbl tbody, .lg-tbl tr, .lg-tbl th, .lg-tbl td { display: block; width: 100%; }
    .lg-tbl { border: 0; border-radius: 0; overflow: visible; }
    .lg-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .lg-tbl tbody tr { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
    .lg-tbl tbody tr:last-child { margin-bottom: 0; }
    .lg-tbl tbody th, .lg-tbl tbody td, .lg-tbl tbody tr:first-child th, .lg-tbl tbody tr:first-child td { border: 0; }
    .lg-tbl tbody th { width: 100%; padding: 10px 14px 8px; }
    .lg-tbl tbody td { padding: 8px 14px 12px; border-inline-start: 0; }
    .lg-tbl tbody th + td { border-inline-start: 0; }
}
@media (max-width: 380px) { .lg-doc { padding: 16px 14px 10px; } }

@media print {
    .lg-hero, .lg-toc, .lg-foot, .lg-ct { display: none !important; }
    .lg-card, .lg-doc { box-shadow: none !important; border: 0 !important; }
}

/* الخطوات ليست قائمة نقطية: نلغي نقطة القائمة العامة وازاحتها */
.lg-sec .lg-steps li { padding-inline-start: 0; margin-bottom: 0; padding-bottom: 16px; }
.lg-sec .lg-steps li:last-child { padding-bottom: 2px; }
.lg-sec .lg-steps li::before { display: none; }

/*
 * ───────────── الكمبيوتر: الشريط العلوي الثابت لصفحتي السياسات للزائر قبل الدخول (بلا قائمة جانبية) ─────────────
 * داخل الحساب يتولى desktop.css الشريط نفسه. هنا: أبيض بعرض الصفحة، العنوان وفوقه سطر صغير باسم الهوية، وأزرار الثيم واللغة في النهاية.
 */
@media (min-width: 900px) {
    html:not([data-dk]) .lg-legal > .lg-hero {
        position: fixed; top: 0; inset-inline: 0; z-index: 900; box-sizing: border-box; display: flex; align-items: center; height: 72px; padding: 0 28px; overflow: visible;
        background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 6px 18px -14px rgba(20, 36, 90, .35);
    }
    html:not([data-dk]) .lg-legal > .lg-hero > .lg-in { flex: 1; width: auto; max-width: none; margin: 0; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 14px; }
    html:not([data-dk]) .lg-legal :is(.lg-c1, .lg-c2, .lg-c3, .lg-tile, .lg-brand p) { display: none; }
    html:not([data-dk]) .lg-legal .lg-brand { margin: 0; text-align: start; }
    html:not([data-dk]) .lg-legal .lg-brand::before { content: "Fast Creator"; display: block; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text-dim); direction: ltr; text-align: start; }
    html:not([data-dk]) .lg-legal .lg-brand h1 { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.25; color: var(--text); }
    html:not([data-dk]) .lg-legal .lg-hero .panel-top { margin: 0; padding: 0; }
    html:not([data-dk]) .lg-legal .lg-hero .icon-btn, html:not([data-dk]) .lg-legal .lg-hero a.lang-switch.lang-globe {
        width: 42px !important; min-width: 42px !important; height: 42px !important; border-radius: 13px !important;
        background: var(--surface) !important; color: var(--text-dim) !important; border: 1px solid var(--border) !important; box-shadow: none;
    }
    html:not([data-dk]) .lg-legal .lg-hero .icon-btn:hover, html:not([data-dk]) .lg-legal .lg-hero a.lang-switch.lang-globe:hover { background: var(--surface-2) !important; color: var(--primary) !important; }
    html:not([data-dk]) .lg-legal .lg-hero :is(.icon-btn, a.lang-globe) svg { stroke: currentColor; color: inherit; }
    html:not([data-dk]) .lg-legal .lg-wrap { margin-top: 0; padding-top: 96px; }
}
@media (min-width: 900px) { html:not([data-dk]) .mt-install { top: auto; bottom: 24px; inset-inline-end: 28px; inset-inline-start: auto; } }
