/* ===== الألوان ===== */
:root {
  --bg: #F3F7F5; --surface: #FFFFFF; --surface-alt: #EEF4F1; --text: #10231F; --muted: #55665F; --border: #DCE6E1;
  --primary: #0D6B55; --primary-strong: #0A5242; --primary-soft: #E2F1EC; --accent: #C9962E; --gold: #E7C27A; --bad: #B42318;
  --shadow: 0 1px 2px rgba(16, 35, 31, .05), 0 8px 24px rgba(16, 35, 31, .06);
  --radius: 18px; --hero-1: #0A4F40; --hero-2: #0D6B55; --hero-3: #0F7A61;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1714; --surface: #12221E; --surface-alt: #172B26; --text: #E6EFEC; --muted: #9DB2AB; --border: #223933;
    --primary: #3FB896; --primary-strong: #62CDAE; --primary-soft: #173A31; --accent: #E2B85A; --bad: #F97066;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
    --hero-1: #07362C; --hero-2: #0A4F40; --hero-3: #0D6B55;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1714; --surface: #12221E; --surface-alt: #172B26; --text: #E6EFEC; --muted: #9DB2AB; --border: #223933;
  --primary: #3FB896; --primary-strong: #62CDAE; --primary-soft: #173A31; --accent: #E2B85A; --bad: #F97066;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
  --hero-1: #07362C; --hero-2: #0A4F40; --hero-3: #0D6B55;
  color-scheme: dark;
}

/* ===== الأساس ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text); overflow-wrap: anywhere;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, -apple-system, sans-serif;
  font-size: 16.5px; line-height: 1.85;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-strong); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--surface); padding: 8px 14px; border-radius: 10px; z-index: 60; }
.skip:focus { top: 12px; }

/* اللغة اللي مش مختارة بتستخبى */
html[lang="ar"] [data-lang="en"], html[lang="en"] [data-lang="ar"] { display: none !important; }
html[lang="en"] body { line-height: 1.75; }

/* ===== الهيدر ===== */
.site-header {
  position: sticky; top: 0; z-index: 40; color: #fff;
  background: linear-gradient(125deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}
.bar { display: flex; align-items: center; gap: 14px; min-height: 64px; padding-top: env(safe-area-inset-top); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; min-width: 0; }
.brand:hover { color: #fff; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { color: rgba(255, 255, 255, .88); text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; }
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }
.tools { display: flex; gap: 8px; flex: none; }
.btn-round {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1); color: #fff;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; flex: none; overflow-wrap: normal;
}
.btn-round:hover { background: rgba(255, 255, 255, .2); }
.btn-round.icon { padding: 0; width: 40px; }
.btn-round svg { width: 18px; height: 18px; }
.ic-sun { display: none; }
:root[data-theme="dark"] .ic-sun { display: block; }
:root[data-theme="dark"] .ic-moon { display: none; }
.menu-btn { display: none; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px;
  border-radius: 14px; font-weight: 700; font-size: 17px; text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-gold { background: var(--gold); color: #2B1D00; }
.btn-gold:hover { background: #f0cd88; color: #2B1D00; }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); color: #fff; }
.btn-wa { background: #16A34A; color: #fff; }
.btn-wa:hover { background: #128a3e; color: #fff; }
.btn-soft { background: var(--surface-alt); color: var(--text); border-color: var(--border); }

/* ===== Hero ===== */
.hero {
  color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(circle at 18% 30%, rgba(231, 194, 122, .25), transparent 42%), linear-gradient(125deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: linear-gradient(rgba(255, 255, 255, .9) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .9) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%); mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-home { padding: 56px 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: end; }
.hero-text { padding-bottom: 72px; }
.pill { display: inline-block; background: var(--gold); color: #2B1D00; font-weight: 700; font-size: 14px; padding: 4px 14px; border-radius: 999px; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.18; margin: 16px 0 12px; letter-spacing: -.3px; }
.hero .lead { font-size: clamp(17px, 2.3vw, 21px); color: rgba(255, 255, 255, .9); margin: 0 0 26px; max-width: 600px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.stat { background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; padding: 8px 16px; line-height: 1.4; }
.stat b { display: block; font-size: 22px; color: var(--gold); }
.stat small { font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.hero-phone { display: flex; justify-content: center; align-self: end; }
.hero-phone .phone { width: min(330px, 80vw); margin-bottom: -150px; transform: rotate(-3deg); }
html[dir="ltr"] .hero-phone .phone { transform: rotate(3deg); }
.hero-page { padding: 48px 0 70px; }
.hero-page h1 { font-size: clamp(32px, 5.5vw, 50px); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.meta span { background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .16); padding: 4px 12px; border-radius: 999px; }

/* ===== إطار الموبايل ===== */
.phone { background: #0B0F0E; padding: 10px; border-radius: 44px; box-shadow: 0 30px 60px rgba(0, 0, 0, .35), 0 0 0 2px #2B3330; position: relative; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #050707; z-index: 2; }
.phone img { border-radius: 35px; width: 100%; height: auto; aspect-ratio: 720 / 1561; object-fit: cover; object-position: top; background: var(--surface-alt); }

/* ===== الأقسام ===== */
.section { padding: 72px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.3; margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0; font-size: 17.5px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.section.alt .feature { background: var(--bg); box-shadow: none; }
.feature .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 12px; }
.feature .ic svg { width: 26px; height: 26px; }
.feature h3 { margin: 0 0 4px; font-size: 19px; line-height: 1.45; }
.feature p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.75; }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 230px; gap: 22px; overflow-x: auto; padding: 8px 4px 26px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shot { scroll-snap-align: center; margin: 0; text-align: center; }
.shot .phone { border-radius: 34px; padding: 8px; }
.shot .phone::before { top: 14px; width: 10px; height: 10px; margin-left: -5px; }
.shot .phone img { border-radius: 27px; }
.shot figcaption { margin-top: 14px; font-weight: 600; font-size: 15.5px; line-height: 1.5; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: relative; box-shadow: var(--shadow); }
.step::before { counter-increment: step; content: counter(step); width: 38px; height: 38px; border-radius: 12px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }
.step h3 { margin: 0 0 4px; font-size: 18.5px; }
.step p { margin: 0; color: var(--muted); font-size: 15.5px; }

.band {
  border-radius: 26px; padding: 36px; color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: radial-gradient(circle at 85% 20%, rgba(231, 194, 122, .28), transparent 45%), linear-gradient(125deg, var(--hero-1), var(--hero-2));
}
.band h2 { margin: 0 0 4px; font-size: clamp(22px, 3.4vw, 30px); line-height: 1.35; }
.band p { margin: 0; color: rgba(255, 255, 255, .88); }

.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 18px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

/* ===== صفحات النص (الخصوصية والإعلانات) ===== */
.highlights { margin-top: -38px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; position: relative; z-index: 2; }
.hl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; }
.hl .ic { width: 44px; height: 44px; border-radius: 13px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.hl .ic svg { width: 24px; height: 24px; }
.hl b { display: block; font-size: 16.5px; line-height: 1.5; }
.hl small { color: var(--muted); font-size: 14px; line-height: 1.6; display: block; margin-top: 2px; }

.layout { margin-top: 28px; padding-bottom: 40px; display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.toc { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.toc h2 { font-size: 14px; color: var(--muted); margin: 2px 8px 8px; font-weight: 600; }
.toc ol, .toc-mobile ol { list-style: none; margin: 0; padding: 0; }
.toc a, .toc-mobile a { display: flex; gap: 8px; padding: 7px 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 15px; line-height: 1.5; }
.toc a:hover { background: var(--surface-alt); }
.toc a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toc .n, .toc-mobile .n { color: var(--muted); min-width: 1.2em; }
.toc a.active .n { color: var(--primary); }
details.toc-mobile { display: none; }
.content { min-width: 0; }
.single { margin-top: 28px; padding-bottom: 40px; max-width: 880px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 16px; scroll-margin-top: 84px; }
.card h2 { font-size: 22px; line-height: 1.4; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.card h2 .num { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 16px; flex: none; }
.card h2 .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.card h2 .ic svg { width: 22px; height: 22px; }
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 6px 0 4px; padding-inline-start: 22px; }
.card li { margin: 6px 0; }
.card li::marker { color: var(--accent); }
.sub { font-weight: 700; margin: 16px 0 4px !important; display: flex; align-items: center; gap: 8px; }
.sub .dot { width: 10px; height: 10px; border-radius: 50%; }
.sub.yes .dot { background: var(--accent); }
.sub.no .dot { background: var(--bad); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.box { background: var(--surface-alt); border-radius: 14px; padding: 6px 16px 10px; }
.note { background: var(--primary-soft); border-radius: 14px; padding: 12px 16px; margin-top: 12px; }
.path { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; padding: 1px 8px; font-size: .94em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.code {
  direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 14.5px; line-height: 1.6;
  background: #0B1714; color: #D7F5EA; border-radius: 12px; padding: 14px 16px; margin: 10px 0; overflow-x: auto; white-space: pre;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; direction: ltr; text-align: start; }
html[dir="rtl"] .kv dd { text-align: right; }

.table-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.65; }
th, td { text-align: start; padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--surface-alt); font-weight: 700; font-size: 14px; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }

/* ===== الفوتر ===== */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 40px; padding: 32px 0 max(28px, env(safe-area-inset-bottom)); }
.foot { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.foot-brand { display: flex; gap: 12px; align-items: center; }
.foot-brand img { border-radius: 12px; }
.foot-brand b { display: block; line-height: 1.5; }
.foot-brand small { color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.foot-links a:hover { color: var(--primary); }
.copy { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); padding-top: 16px; }

.to-top {
  position: fixed; inset-inline-end: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); cursor: pointer; z-index: 30;
  display: grid; place-items: center; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 22px; height: 22px; }

/* ===== الموبايل ===== */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-text { padding-bottom: 20px; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .cta, .stats { justify-content: center; }
  .hero-phone .phone { width: min(290px, 74vw); margin-bottom: -120px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  details.toc-mobile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
  details.toc-mobile summary { cursor: pointer; padding: 10px 2px; font-weight: 600; }
  details.toc-mobile ol { margin-bottom: 10px; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; top: 100%; inset-inline: 0; flex-direction: column; gap: 2px; padding: 10px 16px 16px;
    background: linear-gradient(180deg, var(--hero-2), var(--hero-1)); box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 12px; font-size: 16px; }
  .tools { margin-inline-start: auto; }
  .btn-round:not(.icon) .label { display: inline; }
  .steps, .highlights, .cols { grid-template-columns: 1fr; }
  .highlights { gap: 10px; }
  .card { padding: 18px 16px; }
  .card h2 { font-size: 19.5px; }
  .band { padding: 26px 20px; text-align: center; justify-content: center; }
  .foot { grid-template-columns: 1fr; }
  .table-wrap { border: 0; overflow: visible; }
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
  td { border-bottom: 1px solid var(--border); padding: 9px 14px; }
  td::before { content: attr(data-label); display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .btn { width: 100%; }
  .brand { font-size: 15.5px; }
}
@media print {
  .site-header, .toc, details.toc-mobile, .to-top, .skip, .tools { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { background: #fff; color: #000; }
  .hero::after { display: none; }
  .hero .lead, .meta span { color: #000; background: none; }
  .card, .hl { box-shadow: none; break-inside: avoid; }
  .layout { grid-template-columns: 1fr; }
}
