/* =========================================================
   مستحقاتي — أنماط الموقع (RTL، بلا اعتماد على مكتبات)
   ========================================================= */

:root {
  --ink: #0e1f1c;
  --ink-soft: #33443f;
  --muted: #5d6f6a;
  --line: #dfe6e3;
  --line-strong: #c9d4d0;
  --bg: #f6f8f7;
  --card: #ffffff;
  --brand: #0f6b5c;
  --brand-dark: #0a4d42;
  --brand-tint: #e8f2ef;
  --gold: #a8801f;
  --gold-tint: #fbf4e3;
  --danger: #9c2f1c;
  --danger-tint: #fdeeea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 31, 28, .05), 0 8px 24px rgba(14, 31, 28, .06);
  --maxw: 1080px;
  --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  line-height: 1.4;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(1.6rem, 4.2vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

img, svg { max-width: 100%; }

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

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 100;
}
.skip:focus { inset-inline-start: 12px; }

/* ---------- الترويسة ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.12rem;
  margin-inline-end: auto;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  flex: none;
}
.brand small {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .93rem;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 999px;
}
.nav a:hover { background: var(--brand-tint); color: var(--brand-dark); }
.nav a[aria-current="page"] { background: var(--brand); color: #fff; }

/* ---------- أقسام عامة ---------- */

main { display: block; }

.section { padding: 40px 0; }
.section-tight { padding: 26px 0; }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 14px;
}

.lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.grid > *, .calc-shell > *, .footer-grid > * { min-width: 0; }

.note {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .95rem;
  background: var(--brand-tint);
  border: 1px solid #cfe4de;
  color: var(--ink-soft);
}
.note-warn { background: var(--gold-tint); border-color: #eddfb8; color: #5c4708; }
.note-danger { background: var(--danger-tint); border-color: #f3cfc6; color: #6d2013; }
.note strong { color: inherit; }

ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li {
  position: relative;
  padding-inline-start: 26px;
  margin-bottom: 9px;
}
ul.clean li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: .62em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .8;
}

/* ---------- الواجهة (Hero) ---------- */

.hero {
  background:
    radial-gradient(1100px 420px at 80% -10%, #dcefe9 0%, rgba(220, 239, 233, 0) 60%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 34px 0 30px;
}
.hero h1 { margin-bottom: 12px; max-width: 24ch; text-wrap: balance; }
.hero .lede { margin-bottom: 20px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(15, 107, 92, .22); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand-dark); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--brand-tint); }

.trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: .88rem;
  color: var(--muted);
  padding: 0;
  margin: 0;
  list-style: none;
}
.trust-line li { display: flex; align-items: center; gap: 6px; }
.trust-line li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 700;
}

/* ---------- بطاقات الحاسبات ---------- */

.calc-list { display: grid; gap: 14px; grid-template-columns: 1fr; }
.calc-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
a.calc-item:hover { border-color: var(--line-strong); }
.calc-icon {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 11px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  display: grid; place-items: center;
  font-weight: 700;
}
.calc-item h3 { margin-bottom: 2px; font-size: 1.05rem; }
.calc-item p { margin: 0; font-size: .92rem; color: var(--muted); }
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef1f0;
  color: var(--muted);
  vertical-align: middle;
  margin-inline-start: 6px;
}
.badge-live { background: var(--brand-tint); color: var(--brand-dark); }

/* ---------- الحاسبة ---------- */

.calc-shell { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }

.form-field { margin-bottom: 16px; }
.form-field:last-child { margin-bottom: 0; }

label, .field-label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 6px;
}

.hint {
  display: block;
  font-weight: 400;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.6;
}

input[type="number"], input[type="date"], input[type="text"], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  min-height: 46px;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(15, 107, 92, .22);
  outline-offset: 1px;
  border-color: var(--brand);
}

.input-group { position: relative; }
.input-group .suffix {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .9rem;
  pointer-events: none;
}
.input-group input { padding-inline-start: 46px; }

.radio-row { display: grid; gap: 8px; }
.radio-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  cursor: pointer;
  background: #fff;
  font-size: .95rem;
  font-weight: 500;
}
.radio-opt input { margin-top: 4px; accent-color: var(--brand); flex: none; }
.radio-opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.radio-opt small { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
  gap: 3px;
}
.seg label {
  margin: 0;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-soft);
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked) { background: var(--brand); color: #fff; }
.seg label:focus-within { outline: 3px solid rgba(15, 107, 92, .22); }

.error-text {
  color: var(--danger);
  font-size: .88rem;
  font-weight: 500;
  margin-top: 8px;
  display: none;
}
.error-text.is-on { display: block; }

/* نتيجة */

.result-card {
  scroll-margin-top: 90px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #4aa88f);
}

.result-head { font-size: .92rem; color: var(--muted); margin-bottom: 4px; }
.result-amount {
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.result-amount .cur { font-size: .95rem; font-weight: 600; color: var(--muted); margin-inline-start: 6px; }
.result-sub { font-size: .92rem; color: var(--ink-soft); margin-top: 6px; }

.breakdown { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.breakdown li span:first-child { color: var(--ink-soft); }
.breakdown li span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.breakdown li.total { border-bottom: 0; padding-bottom: 0; }
.breakdown li.total span { font-weight: 700; color: var(--brand-dark); }

.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result-actions .btn { padding: 10px 18px; font-size: .95rem; }

.empty-state { color: var(--muted); font-size: .95rem; }

/* ---------- جداول ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
  min-width: 400px;
}
table.data th, table.data td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
table.data thead th {
  background: #f2f6f4;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 700; background: #fafcfb; }

/* ---------- الأسئلة الشائعة ---------- */

details.faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
details.faq[open] { border-color: var(--line-strong); }
details.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  margin-inline-start: auto;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--brand);
  font-weight: 400;
  flex: none;
}
details.faq[open] summary::after { content: "−"; }
details.faq .faq-body { padding-top: 10px; color: var(--ink-soft); font-size: .96rem; }
details.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- الاقتباسات النظامية ---------- */

blockquote.law {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .96rem;
  color: var(--ink-soft);
}
blockquote.law cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: .84rem;
  color: var(--muted);
}

/* ---------- التذييل ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 30px 0 34px;
  margin-top: 30px;
  font-size: .92rem;
  color: var(--muted);
}
.footer-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
.footer-grid h4 { font-size: .95rem; color: var(--ink); margin-bottom: 8px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  font-size: .85rem;
}

.meta-line {
  font-size: .85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
}

/* ---------- صفحات المحتوى ---------- */

.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .5em; }

.page-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 26px 0 22px;
}

/* ---------- بيان الطباعة ---------- */

.statement { display: none; }

@media print {
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .no-print, .hero, .skip { display: none !important; }
  .section, .section-tight { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  .statement { display: none !important; }
  .statement.is-printing { display: block !important; }
  .statement-head { border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 14px; }
  .statement table { width: 100%; border-collapse: collapse; }
  .statement th, .statement td { border: 1px solid #999; padding: 6px 8px; text-align: start; font-size: 11pt; }
  .statement .stmt-total { font-size: 14pt; font-weight: 700; margin-top: 12px; }
  .statement .stmt-foot { margin-top: 16px; font-size: 9.5pt; color: #333; }
}

/* ---------- استجابة ---------- */

@media (max-width: 560px) {
  .site-header .wrap { min-height: 56px; gap: 8px; }
  .brand { font-size: 1.02rem; }
  .brand small { display: none; }
  .nav a { font-size: .86rem; padding: 6px 8px; }
  .nav a.nav-secondary { display: none; }
  .hero { padding: 26px 0 24px; }
}

@media (min-width: 720px) {
  body { font-size: 17.5px; }
  .section { padding: 56px 0; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .calc-list { grid-template-columns: 1fr 1fr; }
  .calc-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 22px; }
  .card, .result-card { padding: 26px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .hero { padding: 54px 0 46px; }
  .site-header .wrap { min-height: 68px; }
}

@media (min-width: 1024px) {
  .calc-shell { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- مسار التنقل والبطاقات القُطرية ---------- */
.crumbs {
  font-size: .84rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 12px;
}
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--brand-dark); text-decoration: underline; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 500; }

.country-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 22px;
  height: 100%;
}
.country-card:hover { border-color: var(--brand); }
.country-card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.country-card p { font-size: .95rem; color: var(--ink-soft); margin: 0 0 12px; }
.country-card .card-list { list-style: none; padding: 0; margin: 0; font-size: .92rem; color: var(--ink-soft); }
.country-card .card-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.country-card .card-list li:first-child { border-top: 0; }
.country-card .card-list a { color: var(--brand-dark); text-decoration: none; font-weight: 500; }
.country-card.is-soon { opacity: .82; }
.country-mark {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  display: inline-grid; place-items: center;
  font-size: .92rem; font-weight: 700;
}
