/* ============================================================
   مارا العقارية — تصميم مقترح (نمط تحريري داكن)
   مستوحى من OpenTailwind 007 (رخصة MIT) ومُعاد بناؤه عربياً
   بلا Tailwind وبلا أي اعتمادية خارجية.
   كل الخصائص اتجاهية منطقية (inline-start/end) لدعم RTL أصلاً.
   ============================================================ */

@import url("fonts.css");

:root {
  /* الهوية — الأخضر والذهبي معدّلان ليتنفّسا على خلفية داكنة */
  --brand: #1f9c7c;
  --brand-soft: #2fbf99;
  --brand-deep: #0f5c4a;
  --gold: #e2bb55;
  --gold-soft: #f0d799;

  --bg: #060f0d;
  --surface: #0d1b17;
  --surface-2: #13251f;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);

  --ink: #f3f8f6;
  --body: #9db2ab;
  --muted: #7c9089;

  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;
  --r-xl: 36px;
  --pill: 999px;

  --max: 1200px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .55em; font-weight: 800; line-height: 1.3; }
h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); letter-spacing: -1.4px; line-height: 1.15; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); letter-spacing: -.6px; }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1.1em; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 22px; }
.accent { color: var(--gold); }
.center { text-align: center; }

/* ---------- شريط علوي عائم بشكل كبسولة ---------- */
.topbar {
  position: fixed; inset-block-start: 18px; inset-inline: 0;
  z-index: 60; display: flex; justify-content: center;
  padding-inline: 18px; pointer-events: none;
}
.topbar-inner {
  pointer-events: auto;
  width: 100%; max-width: 1060px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  height: 62px; padding-inline: 10px 20px;
  background: rgba(13, 27, 23, .82);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--line); border-radius: var(--pill);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  inline-size: 42px; block-size: 42px; border-radius: 14px;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  color: #fff; font-weight: 800; font-size: 1.25rem;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(31, 156, 124, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { color: var(--ink); font-size: 1rem; font-weight: 800; }
.brand-text span { color: var(--muted); font-size: .72rem; }

.mainnav { display: flex; align-items: center; gap: 4px; }
.mainnav a {
  padding: 9px 15px; border-radius: var(--pill);
  color: var(--body); font-size: .93rem; font-weight: 500;
  transition: color .2s, background .2s;
}
.mainnav a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.mainnav a.is-active { color: var(--ink); background: rgba(255, 255, 255, .09); }

.navtoggle {
  display: none; inline-size: 42px; block-size: 42px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255, 255, 255, .04); cursor: pointer;
  position: relative;
}
.navtoggle span, .navtoggle::before, .navtoggle::after {
  content: ""; position: absolute; inset-inline: 11px; block-size: 2px;
  background: var(--ink); border-radius: 2px; transition: .25s;
}
.navtoggle::before { inset-block-start: 14px; }
.navtoggle span { inset-block-start: 20px; }
.navtoggle::after { inset-block-start: 26px; }

/* ---------- أزرار ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 26px; border-radius: var(--pill);
  font-family: inherit; font-size: .97rem; font-weight: 700;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #c9a227);
  color: #22190a; box-shadow: 0 12px 30px rgba(226, 187, 85, .28);
}
.btn-gold:hover { box-shadow: 0 18px 44px rgba(226, 187, 85, .4); }
.btn-ghost { background: rgba(255, 255, 255, .05); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { padding: 10px 20px; font-size: .9rem; }
/* السهم يشير لليسار لأن اتجاه القراءة من اليمين لليسار */
.btn .arw { transition: transform .2s; }
.btn:hover .arw { transform: translateX(-4px); }

/* ---------- الواجهة ---------- */
.hero { padding-block: 170px 40px; position: relative; overflow: clip; }
.hero::before {
  content: ""; position: absolute; inset-block-start: -180px; inset-inline-start: 50%;
  transform: translateX(50%);
  inline-size: min(1100px, 100%); block-size: 620px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(31, 156, 124, .22), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--gold); font-size: .8rem; font-weight: 700;
  letter-spacing: 2.5px; margin-bottom: 26px;
}
.eyebrow::before {
  content: ""; inline-size: 7px; block-size: 7px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 5px rgba(226, 187, 85, .16);
}
.hero .lead {
  max-width: 660px; margin-inline: auto; margin-block: 26px 38px;
  font-size: clamp(1.02rem, 1.9vw, 1.2rem); color: var(--body);
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- لوحة الواجهة البصرية ---------- */
.showcase {
  margin-block-start: 64px; border-radius: var(--r-xl);
  overflow: hidden; position: relative;
  box-shadow: var(--glow); background: var(--surface);
}
.showcase-art { aspect-ratio: 16 / 8.4; inline-size: 100%; }
@media (max-width: 640px) { .showcase-art { aspect-ratio: 16 / 13; } }

.showcase-chips {
  position: absolute; inset-block-end: 0; inset-inline: 0;
  padding: 46px 26px 24px;
  background: linear-gradient(to top, rgba(6, 15, 13, .94), rgba(6, 15, 13, .5) 55%, transparent);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.chip-label {
  color: var(--gold); font-size: .75rem; font-weight: 700;
  letter-spacing: 1.6px; margin-inline-end: 6px;
}
.chip {
  padding: 8px 16px; border-radius: var(--pill);
  background: rgba(255, 255, 255, .09); border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font-size: .85rem; font-weight: 500;
}

/* ---------- شريط الإحصاءات ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; margin-block-start: 26px;
}
.stat { background: var(--surface); padding: 30px 20px; text-align: center; }
.stat b {
  display: block; color: var(--ink);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 800;
  letter-spacing: -1px; line-height: 1.2;
}
.stat b em { color: var(--gold); font-style: normal; }
.stat span { color: var(--muted); font-size: .87rem; line-height: 1.6; display: block; margin-block-start: 6px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- الأقسام ---------- */
.section { padding-block: 96px; }
.section-head { max-width: 660px; margin-inline: auto; margin-block-end: 52px; text-align: center; }
.section-head p { color: var(--body); margin: 0; }

/* ---------- بطاقات المشاريع ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 22px; }

.pcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.pcard:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.pcard-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.pcard-media img { inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform .5s; }
.pcard:hover .pcard-media img { transform: scale(1.05); }
.pcard-tag {
  position: absolute; inset-block-start: 14px; inset-inline-start: 14px;
  padding: 7px 14px; border-radius: var(--pill);
  background: rgba(6, 15, 13, .82); border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font-size: .78rem; font-weight: 700;
}
.pcard-tag.ready { background: #157a61; border-color: transparent; color: #fff; }
.pcard-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.pcard-loc { display: flex; align-items: center; gap: 7px; color: var(--gold); font-size: .82rem; font-weight: 600; margin-block-end: 10px; }
.pcard-body h3 { margin-block-end: 10px; }
.pcard-body > p { font-size: .92rem; margin-block-end: 18px; flex: 1; }
.pcard-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-block-start: 16px; border-block-start: 1px solid var(--line);
}
.pcard-meta span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--pill);
  background: var(--surface-2); color: var(--body); font-size: .78rem;
}
.icon { inline-size: 15px; block-size: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- الخدمات (شبكة أيقونات) ---------- */
.grid-svc { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 20px; }
.svc {
  padding: 32px 26px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .3s, transform .3s;
}
.svc:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.svc-ico {
  inline-size: 52px; block-size: 52px; border-radius: 16px;
  background: linear-gradient(140deg, rgba(31, 156, 124, .28), rgba(31, 156, 124, .1));
  border: 1px solid rgba(47, 191, 153, .3);
  display: grid; place-items: center; color: var(--brand-soft);
  margin-block-end: 20px;
}
.svc-ico .icon { inline-size: 24px; block-size: 24px; stroke-width: 1.7; }
.svc h3 { margin-block-end: 8px; }
.svc p { font-size: .92rem; margin: 0; }

/* ---------- نداء ختامي ---------- */
.cta {
  border-radius: var(--r-xl); padding: 70px 34px; text-align: center;
  background:
    radial-gradient(90% 130% at 50% 0%, rgba(31, 156, 124, .3), transparent 68%),
    var(--surface);
  border: 1px solid var(--line);
}
.cta p { max-width: 520px; margin-inline: auto; margin-block-end: 30px; }

/* ---------- التذييل ---------- */
.footer { border-block-start: 1px solid var(--line); padding-block: 56px 34px; margin-block-start: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer h4 { color: var(--ink); font-size: .95rem; margin-block-end: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-block-end: 10px; }
.footer li a { color: var(--body); font-size: .92rem; transition: color .2s; }
.footer li a:hover { color: var(--gold); }
.footer-note {
  margin-block-start: 40px; padding-block-start: 24px; border-block-start: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: .85rem;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }

/* ---------- الجوال ---------- */
@media (max-width: 980px) {
  .navtoggle { display: block; }
  .mainnav {
    position: absolute; inset-block-start: calc(100% + 12px); inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 14px;
    background: rgba(13, 27, 23, .97);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    display: none;
  }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 12px 16px; }
  .topbar-inner { position: relative; }
  .hero { padding-block-start: 140px; }
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   الصفحات الداخلية — ترويسة، فلاتر، نماذج، صفحات نظامية
   ============================================================ */

/* ---------- ترويسة الصفحة ---------- */
.page-hero { padding-block: 160px 10px; position: relative; overflow: clip; }
.page-hero::before {
  content: ""; position: absolute; inset-block-start: -240px; inset-inline-start: 50%;
  transform: translateX(50%); inline-size: min(900px, 100%); block-size: 520px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(31, 156, 124, .2), transparent 70%);
  pointer-events: none;
}
.page-hero > * { position: relative; }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin-block-end: .4em; }
.page-hero > .container > p { max-width: 640px; color: var(--body); }

.breadcrumb { color: var(--muted); font-size: .87rem; margin-block-end: 18px; }
.breadcrumb a { color: var(--gold); }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- شريط الفلاتر ---------- */
.search-bar {
  display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 16px; align-items: end;
  padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
@media (max-width: 860px) { .search-bar { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .search-bar { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { color: var(--ink); font-size: .85rem; font-weight: 600; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: .95rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 13px 15px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.8; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 156, 124, .18);
}
.field select { appearance: none; cursor: pointer; padding-inline-end: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  /* background-position لا يدعم الكلمات الاتجاهية المنطقية؛ `left` هنا صحيح لأن الموقع RTL فقط */
  background-position: left 18px top 50%, left 13px top 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { background: rgba(255, 255, 255, .07); }
.btn-block { width: 100%; justify-content: center; }
.results-count { color: var(--muted); font-size: .9rem; margin-block: 26px 18px; }
.mt-3 { margin-block-start: 26px; }

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 60px 24px;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
}

/* ---------- تنبيهات ---------- */
.callout {
  padding: 20px 24px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  border-inline-start: 3px solid var(--brand);
}
.callout p:last-child { margin-block-end: 0; }
.callout a { color: var(--gold); text-decoration: underline; }
.callout strong { color: var(--ink); }
.callout.warn { border-inline-start-color: var(--gold); background: rgba(226, 187, 85, .06); }

/* ---------- نداء جانبي ---------- */
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  padding: 40px; border-radius: var(--r-xl);
  background: radial-gradient(90% 160% at 100% 0%, rgba(31, 156, 124, .26), transparent 66%), var(--surface);
  border: 1px solid var(--line);
}
.cta-band h2 { margin-block-end: .3em; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.cta-band p { margin: 0; }

/* ---------- تواصل ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.info-item { display: flex; gap: 16px; align-items: flex-start; margin-block-end: 26px; }
.info-item h4 { color: var(--ink); font-size: .98rem; margin: 0 0 4px; }
.info-item p { margin: 0; font-size: .93rem; }
.info-item a { color: var(--gold); }
.card-icon {
  flex: 0 0 auto; inline-size: 46px; block-size: 46px; border-radius: 14px;
  background: linear-gradient(140deg, rgba(31, 156, 124, .26), rgba(31, 156, 124, .08));
  border: 1px solid rgba(47, 191, 153, .28);
  display: grid; place-items: center; color: var(--brand-soft);
}
.card-icon .icon { inline-size: 21px; block-size: 21px; }

.form-card { padding: 32px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-card .field { margin-block-end: 18px; }
.consent { display: flex; gap: 11px; align-items: flex-start; font-size: .88rem; margin-block-end: 22px; }
.consent input { margin-block-start: 5px; accent-color: var(--brand); inline-size: 17px; block-size: 17px; flex: 0 0 auto; }
.consent a { color: var(--gold); text-decoration: underline; }
.form-note { font-size: .82rem; color: var(--muted); margin-block: 14px 0; }
.form-status {
  display: none; margin-block-start: 16px; padding: 14px 18px;
  border-radius: var(--r-sm); font-size: .9rem;
  background: rgba(31, 156, 124, .12); border: 1px solid rgba(47, 191, 153, .3); color: var(--ink);
}
.form-status.show { display: block; }
.form-status.error { background: rgba(226, 187, 85, .1); border-color: rgba(226, 187, 85, .35); }
.field .err { color: var(--gold); font-size: .8rem; min-height: 1px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--gold); }

/* ---------- الصفحات النظامية ---------- */
.legal-layout { display: grid; grid-template-columns: 260px 1fr; gap: 46px; align-items: start; }
@media (max-width: 900px) { .legal-layout { grid-template-columns: 1fr; gap: 26px; } }

.legal-toc {
  position: sticky; inset-block-start: 100px;
  padding: 24px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  font-size: .89rem; max-height: calc(100vh - 130px); overflow-y: auto;
}
@media (max-width: 900px) { .legal-toc { position: static; max-height: none; } }
.legal-toc h4 { color: var(--ink); font-size: .95rem; margin-block-end: 14px; }
.legal-toc ol, .legal-toc ul { padding-inline-start: 1.2em; margin: 0; }
.legal-toc li { margin-block-end: 9px; }
.legal-toc a { color: var(--body); }
.legal-toc a:hover { color: var(--gold); }

.legal-body { max-width: 780px; }
.legal-body h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  margin-block: 44px .6em; padding-block-end: 12px;
  border-block-end: 1px solid var(--line); scroll-margin-top: 110px;
}
.legal-body h2:first-child { margin-block-start: 0; }
.legal-body h3 { margin-block-start: 26px; }
.legal-body a { color: var(--gold); text-decoration: underline; }
.legal-body strong { color: var(--ink); }
.legal-body ul, .legal-body ol { padding-inline-start: 1.5em; }
.legal-body li { margin-block-end: .55em; }
.meta-line { color: var(--muted); font-size: .87rem; margin-block-end: 30px; }

.table-wrap { overflow-x: auto; margin-block: 22px; border: 1px solid var(--line); border-radius: var(--r); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 460px; }
.table-wrap th, .table-wrap td { padding: 13px 16px; text-align: start; border-block-end: 1px solid var(--line); }
.table-wrap th { background: var(--surface-2); color: var(--ink); font-weight: 700; white-space: nowrap; }
.table-wrap tr:last-child td { border-block-end: none; }
.table-wrap td { color: var(--body); }

/* ---------- إتاحة ---------- */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px;
}
.skip-link {
  position: absolute; inset-inline-start: -9999px; inset-block-start: 0; z-index: 100;
  background: var(--gold); color: #22190a; padding: 12px 20px; border-end-end-radius: 12px; font-weight: 700;
}
.skip-link:focus { inset-inline-start: 0; }

/* نص مخفي بصرياً ومقروء لقارئات الشاشة — يُستخدم لضبط تسلسل العناوين */
.sr-only {
  position: absolute; inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
