/* Almadaa SAS — المركز القانوني (الخصوصية · الشروط · حذف الحساب · الدعم).
   ملفٌّ واحدٌ للصفحات الأربع: خطُّ النظام Cairo المستضاف محلّياً (سياسة CSP تسمح بالخطوط من الموقع نفسه فقط)،
   وألوانُ النظام: حبرٌ فحميّ، والأزرق الأساسيّ، وذهبُ الشعار لمسةً. الصفحاتُ تبقى مقروءةً لو تعذّر تحميله. */
@import url("/fonts/cairo.css");

:root {
  --ink: #171717;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e7e7ea;
  --line-2: #f0f0f2;
  --bg: #f7f7f8;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-50: #eef4ff;
  --primary-100: #dbe7fe;
  --gold: #b8912f;
  --gold-50: #fbf6ea;
  --ok: #047857;
  --ok-50: #ecfdf5;
  --warn: #92400e;
  --warn-50: #fffbeb;
  --warn-line: #fcd34d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 23, 23, 0.04), 0 8px 24px -16px rgba(23, 23, 23, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.95;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
strong { color: var(--ink); font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ── الشريط العلويّ ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 40px; width: auto; display: block; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.tabs a:hover { color: var(--ink); background: var(--line-2); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--primary); background: var(--primary-50); }

/* ── عنوان الصفحة ── */
.hero {
  background:
    radial-gradient(900px 260px at 85% -40%, var(--primary-50), transparent 70%),
    radial-gradient(700px 240px at 10% -50%, var(--gold-50), transparent 70%),
    var(--card);
  border-bottom: 1px solid var(--line);
}
.hero .inner { padding-top: 52px; padding-bottom: 44px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: 0;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--gold); }
.hero h1 { font-size: clamp(30px, 4.4vw, 42px); line-height: 1.35; font-weight: 700; color: var(--ink); margin: 10px 0 10px; }
.lead { font-size: 17px; color: var(--muted); max-width: 680px; line-height: 1.9; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
}
.chip.is-new { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }

/* ── التخطيط: فهرسٌ جانبيّ ثابت + المستند ── */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; padding-top: 36px; padding-bottom: 72px; align-items: start; }
.layout.single { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.toc { position: sticky; top: 92px; }
.toc-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding-inline-start: 12px; }
.toc ol { list-style: none; border-inline-start: 1px solid var(--line); }
.toc li a {
  display: block; padding: 5px 12px; margin-inline-start: -1px;
  border-inline-start: 2px solid transparent;
  font-size: 14px; line-height: 1.6; color: var(--muted);
}
.toc li a:hover { color: var(--ink); border-inline-start-color: var(--line); text-decoration: none; }
.toc li a.is-active { color: var(--primary); border-inline-start-color: var(--primary); font-weight: 600; }
.toc details > summary { display: none; }

.doc { min-width: 0; counter-reset: sec; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px 40px;
}
.doc section { padding: 30px 0; border-top: 1px solid var(--line-2); scroll-margin-top: 92px; }
.doc section:first-child { border-top: 0; }
.doc h2 {
  display: flex; align-items: center; gap: 12px;
  font-size: 21px; line-height: 1.5; font-weight: 700; color: var(--ink); margin-bottom: 12px;
}
.doc.numbered section > h2::before {
  counter-increment: sec; content: counter(sec);
  flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary-50); color: var(--primary); font-size: 14.5px; font-weight: 700;
}
.doc h3 { font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 20px 0 6px; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { padding-inline-start: 22px; margin: 8px 0; }
.doc li { margin: 6px 0; padding-inline-start: 4px; }
.doc ul li::marker { color: var(--gold); }
.doc ol li::marker { color: var(--primary); font-weight: 700; }

/* ── جداول ── */
.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.8; }
th, td { padding: 12px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line-2); }
th { background: #fafafa; color: var(--ink); font-weight: 700; font-size: 13.5px; border-bottom-color: var(--line); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--ink); font-weight: 600; width: 42%; }

/* ── صناديق ── */
.summary {
  background: linear-gradient(180deg, var(--primary-50), #f8fbff);
  border: 1px solid var(--primary-100); border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 24px;
}
.summary h2 { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.summary ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.summary li { position: relative; padding-inline-start: 30px; font-size: 15px; line-height: 1.8; }
.summary li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 5px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.callout { border-radius: 12px; padding: 16px 20px; margin: 16px 0; font-size: 15px; line-height: 1.85; }
.callout.ok { background: var(--ok-50); border: 1px solid #a7f3d0; }
.callout.ok strong { color: var(--ok); }
.callout.warn { background: var(--warn-50); border: 1px solid var(--warn-line); }
.callout.warn, .callout.warn p, .callout.warn strong { color: var(--warn); }
.callout h3 { margin-top: 0; color: inherit; }

/* ── الدعم ── */
.contact-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin: 14px 0;
}
.contact-card .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.contact-card .mail { font-size: 19px; font-weight: 700; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.6); transition: background 150ms ease, transform 150ms ease;
}
.btn:hover { background: #1d4ed8; text-decoration: none; transform: translateY(-1px); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.cards a {
  display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  color: var(--ink); font-weight: 700; font-size: 15.5px; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.cards a span { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }
.cards a:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }

/* ── التذييل ── */
.site-foot { background: var(--card); border-top: 1px solid var(--line); }
.site-foot .inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 26px; padding-bottom: 26px; }
.site-foot .who { display: flex; align-items: center; gap: 14px; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.site-foot .who img { height: 30px; width: auto; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.site-foot nav a { color: var(--ink-2); }

/* ── شاشاتٌ أضيق ── */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 24px; }
  .toc { position: static; }
  .toc details {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 6px;
  }
  .toc details > summary {
    display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none;
    padding: 10px 12px; font-size: 15px; font-weight: 700; color: var(--ink);
  }
  .toc details > summary::-webkit-details-marker { display: none; }
  .toc details > summary::after { content: "▾"; color: var(--muted); transition: transform 150ms ease; }
  .toc details[open] > summary::after { transform: rotate(180deg); }
  .toc .toc-title { display: none; }
  .toc ol { border: 0; padding: 0 6px 10px; }
  .toc li a { border: 0; padding: 6px 8px; border-radius: 8px; }
  .toc li a.is-active { background: var(--primary-50); }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .inner { padding: 0 16px; }
  .topbar .inner { height: auto; flex-direction: column; align-items: stretch; gap: 6px; padding-top: 10px; padding-bottom: 8px; }
  .brand img { height: 32px; }
  .tabs { margin: 0 -16px; padding: 0 16px; }
  .tabs a { padding: 6px 12px; font-size: 13.5px; }
  .hero .inner { padding-top: 32px; padding-bottom: 28px; }
  .lead { font-size: 15.5px; }
  .panel { padding: 4px 18px; border-radius: 14px; }
  .doc section { padding: 24px 0; scroll-margin-top: 120px; }
  .doc h2 { font-size: 18.5px; }
  .summary { padding: 18px; }
  .summary ul { grid-template-columns: minmax(0, 1fr); }
  table { font-size: 13.5px; }
  th, td { padding: 10px 12px; }
  td:first-child { width: auto; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .contact-card .mail { font-size: 17px; }
}
@media print {
  .topbar, .toc, .site-foot nav { display: none; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 0; padding: 0; }
  .layout { display: block; }
}
