/* دفتري — ورقة الأنماط المشتركة بين صفحات الموقع. */

:root {
  color-scheme: light dark;
  --brand: #0F766E;
  --brand-ink: #0B554F;
  --accent: #14B8A6;
  --bg: #FBFDFC;
  --surface: #FFFFFF;
  --surface-2: #F1F7F5;
  --text: #191C1B;
  --muted: #4A635F;
  --line: #DAE5E1;
  --owed: #B3261E;
  --credit: #2E6B3E;
  --shadow: 0 1px 2px rgba(16, 40, 36, .06), 0 8px 24px rgba(16, 40, 36, .06);
  --radius: 16px;
  --maxw: 1060px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5EEAD4;
    --brand-ink: #CCFBF1;
    --accent: #5EEAD4;
    --bg: #111413;
    --surface: #171B1A;
    --surface-2: #1D2322;
    --text: #E0E3E1;
    --muted: #BEC9C6;
    --line: #2C3533;
    --owed: #F2B8B5;
    --credit: #9BD6A8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .28);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--brand); text-underline-offset: 4px; }
a:hover { color: var(--brand-ink); }

/* مؤشّر تركيز واضح لمستخدمي لوحة المفاتيح. */
a:focus-visible,
.btn:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}

h1, h2, h3 { line-height: 1.45; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.8rem); }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }

/* الترويسة */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 66px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.site-nav { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none; color: var(--muted);
  padding: 7px 12px; border-radius: 10px; font-size: .95rem; font-weight: 600;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--brand); background: var(--surface-2); }

/* الواجهة */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); color: var(--brand-ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; font-size: .85rem; font-weight: 700; margin-bottom: 18px;
}
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--brand); } }
.hero p.lead { font-size: 1.14rem; color: var(--muted); max-width: 46ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 12px; font-weight: 700;
  text-decoration: none; border: 1px solid transparent; font-size: 1rem;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--brand); color: #042F2C; }
  .btn-primary:hover { background: var(--brand-ink); color: #042F2C; }
}
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.hero-note { font-size: .9rem; color: var(--muted); margin-top: 14px; }

/* لقطة الشاشة */
.phone {
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  padding: 18px; box-shadow: var(--shadow); max-width: 330px; margin-inline: auto;
}
.phone-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .8rem; margin-bottom: 14px; }
.phone-total { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.phone-total span { display: block; font-size: .82rem; color: var(--muted); }
.phone-total strong { font-size: 1.65rem; font-weight: 800; direction: ltr; unicode-bidi: isolate; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 4px; border-top: 1px solid var(--line); font-size: .95rem; }
.row:first-of-type { border-top: 0; }
.row .who { display: flex; flex-direction: column; }
.row .who small { color: var(--muted); font-size: .78rem; }
.amt { font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.amt.owed { color: var(--owed); }
.amt.credit { color: var(--credit); }

/* الأقسام */
section { padding: 40px 0; }
.section-head { max-width: 60ch; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.card h3 { margin-bottom: .35em; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card .ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-2); margin-bottom: 14px; font-size: 1.15rem;
}

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px; box-shadow: var(--shadow);
}
.panel.tinted { background: var(--surface-2); box-shadow: none; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { counter-increment: step; }
.step h3::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .85rem;
  margin-inline-end: 10px; vertical-align: -6px;
}
@media (prefers-color-scheme: dark) { .step h3::before { color: #042F2C; } }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 4px 20px; margin-bottom: 12px;
}
details[open] { padding-bottom: 14px; }
summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: left; color: var(--muted); font-weight: 700; }
details[open] summary::after { content: "\2212"; }
details p { color: var(--muted); margin: 0 0 .6em; font-size: .96rem; }

/* الصفحات القانونية */
.legal { padding: 56px 0 24px; }
.legal-head { border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 8px; }
.legal-head p { color: var(--muted); margin: 0; }
.stamp { font-size: .88rem; color: var(--muted); }
.legal-body { max-width: 74ch; }
.legal-body h2 { margin-top: 2em; scroll-margin-top: 90px; }
.legal-body ul { padding-inline-start: 1.3em; margin: 0 0 1em; }
.legal-body li { margin-bottom: .5em; }
.legal-body li::marker { color: var(--brand); }
.callout {
  background: var(--surface-2); border: 1px solid var(--line);
  border-inline-start: 4px solid var(--brand);
  border-radius: 14px; padding: 20px 22px; margin: 24px 0;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 26px 0 34px; }
.toc strong { display: block; margin-bottom: 8px; font-size: .95rem; }
.toc ol { margin: 0; padding-inline-start: 1.3em; columns: 2; column-gap: 30px; font-size: .95rem; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

table.plain { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: .95rem; }
table.plain th, table.plain td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { background: var(--surface-2); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* التذييل */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 34px 0 46px; color: var(--muted); font-size: .93rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .cards, .steps { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .hero { padding: 44px 0 24px; }
  .panel { padding: 24px; }
}
