/* ============================================
   نظام التصميم — منصة "عقاري"
   الهوية: عمق أخضر-كحلي (ثقة/رسوخ) + نحاسي دافئ (اعتماد/توثيق)
   الفكرة: كل عقار بيمر برحلة "توثيق واعتماد" — زي ختم رسمي
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=El+Messiri:wght@500;600;700&family=Cairo:wght@400;500;600;700&display=swap');

:root {
  /* الألوان */
  --ink: #16302B;          /* أخضر كحلي غامق - الهيدر والفوتر والعناصر الرئيسية */
  --ink-2: #1F4B43;        /* أخضر بترولي - أزرار وروابط */
  --parchment: #F5F1E6;    /* خلفية المحتوى الدافئة */
  --surface: #FFFFFF;
  --brass: #B4894F;        /* نحاسي - أزرار الحث على اتخاذ إجراء والأسعار */
  --brass-dark: #96703D;
  --brick: #A8503A;        /* حالات: قيد المراجعة / تنبيه */
  --success: #3F7A56;
  --text: #1A211F;
  --muted: #6B7570;
  --line: #E3DAC5;

  --radius: 14px;
  --shadow: 0 4px 20px rgba(22, 48, 43, 0.08);
  --shadow-lg: 0 12px 40px rgba(22, 48, 43, 0.16);

  --font-display: 'El Messiri', 'Cairo', sans-serif;
  --font-body: 'Cairo', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  line-height: 1.3;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ نمط الشبكة الهندسية (مستوحى من الأرابيسك) ============ */
.geo-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    linear-gradient(30deg, var(--brass) 12%, transparent 12.5%, transparent 87%, var(--brass) 87.5%, var(--brass)),
    linear-gradient(150deg, var(--brass) 12%, transparent 12.5%, transparent 87%, var(--brass) 87.5%, var(--brass)),
    linear-gradient(30deg, var(--brass) 12%, transparent 12.5%, transparent 87%, var(--brass) 87.5%, var(--brass)),
    linear-gradient(150deg, var(--brass) 12%, transparent 12.5%, transparent 87%, var(--brass) 87.5%, var(--brass));
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px;
  pointer-events: none;
}

/* ============ الهيدر ============ */
.site-header {
  background: var(--ink);
  color: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .seal {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brass);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-size: 16px;
  transform: rotate(-8deg);
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-weight: 500; color: #DCE6E2; transition: color .2s; font-size: 15px; }
.nav-links a:hover { color: var(--brass); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  transition: transform .15s, box-shadow .15s, background .2s;
}
.btn:active { transform: scale(0.97); }
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover { background: var(--brass-dark); }
.btn-outline { background: transparent; border: 1.5px solid #DCE6E2; color: var(--surface); }
.btn-outline:hover { background: rgba(255,255,255,0.08); }
.btn-primary { background: var(--ink-2); color: #fff; }
.btn-primary:hover { background: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ============ الهيرو ============ */
.hero {
  background: var(--ink);
  color: var(--surface);
  position: relative;
  overflow: hidden;
  padding: 72px 0 100px;
}
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 44px; color: #fff; margin-bottom: 16px; }
.hero p.lead { color: #C7D4CE; font-size: 18px; margin-bottom: 36px; }

.search-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 10px;
  position: relative;
  z-index: 2;
  margin-top: -46px;
}
.search-box select, .search-box input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--parchment);
}
.search-box .btn { padding: 12px 26px; }

/* ============ بطاقات العقارات ============ */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; }
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--muted); margin-top: 6px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { position: relative; height: 200px; background: var(--line); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }

/* شارة الختم - العنصر المميز للتصميم */
.stamp {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--surface);
  border-radius: 50%;
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  border: 2px dashed var(--success);
  transform: rotate(-10deg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  text-align: center;
  line-height: 1.2;
}
.stamp.pending { color: var(--brick); border-color: var(--brick); }
.stamp span { font-size: 16px; }

.card-price {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--brass);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}
.card-body { padding: 18px; }
.card-body h3 { font-size: 18px; margin-bottom: 6px; }
.card-loc { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.card-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }
.card-meta span { display: flex; align-items: center; gap: 4px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ============ نماذج الإدخال ============ */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=tel], input[type=number], input[type=password], textarea, select {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--parchment);
  color: var(--text);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--ink-2);
  background: var(--surface);
}
textarea { resize: vertical; min-height: 100px; }

.file-drop {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--parchment);
  cursor: pointer;
  transition: border-color .2s;
}
.file-drop:hover { border-color: var(--brass); }
.file-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.file-preview .thumb { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; position: relative; }
.file-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-preview .thumb .name { font-size: 11px; padding: 4px; background: var(--ink); color: #fff; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}
.chip.active { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }

#map-picker { height: 320px; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line); }

.steps { display: flex; gap: 8px; margin-bottom: 32px; }
.step { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.step.active { background: var(--brass); }

/* ============ حالة/بادج ============ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge-pending { background: #FBEDE6; color: var(--brick); }
.badge-approved { background: #E7F3EC; color: var(--success); }
.badge-rejected { background: #FBE9E9; color: #B23A3A; }
.badge-needs_edit { background: #FDF3DA; color: #96703D; }

/* ============ مودال ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22,48,43,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-close { position: absolute; top: 16px; left: 16px; background: none; border: none; font-size: 20px; color: var(--muted); }
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.otp-inputs input {
  width: 52px; height: 60px; text-align: center; font-size: 24px; font-weight: 700;
}

/* ============ فوتر ============ */
.site-footer { background: var(--ink); color: #B9C6C0; padding: 48px 0 24px; margin-top: 60px; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.site-footer .copyright { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 32px; padding-top: 20px; text-align: center; font-size: 13px; }

/* ============ Toast ============ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 14px 24px; border-radius: 10px;
  box-shadow: var(--shadow-lg); z-index: 2000; font-size: 14px; font-weight: 500;
  opacity: 0; transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }
.toast.error { background: #B23A3A; }

/* ============ Loader ============ */
.loader { display: flex; justify-content: center; padding: 40px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--brass); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ استجابة للموبايل ============ */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .hero h1 { font-size: 30px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .search-box { grid-template-columns: 1fr; margin-top: 20px; }
}

/* دعم تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* focus واضح لإمكانية الوصول */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

/* ============ Chip كـ checkbox (بدون JS) ============ */
.chip-checkbox { display: none; }
.chip-label {
  display: inline-flex; padding: 9px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s;
}
.chip-checkbox:checked + .chip-label { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }

.detail-hero-img { width:100%; height:420px; object-fit:cover; border-radius:var(--radius); }
.thumbs-row { display:flex; gap:10px; margin-top:10px; overflow-x:auto; }
.thumbs-row img { width:90px; height:70px; object-fit:cover; border-radius:8px; }
.detail-grid { display:grid; grid-template-columns:2fr 1fr; gap:32px; margin-top:28px; align-items:start; }
.info-list { display:flex; flex-wrap:wrap; gap:16px; margin:20px 0; }
.info-list .item { background:var(--surface); padding:14px 20px; border-radius:12px; box-shadow:var(--shadow); text-align:center; min-width:100px; }
.info-list .item b { display:block; font-size:20px; color:var(--ink); }
.info-list .item span { font-size:12px; color:var(--muted); }
.feature-tag { background:var(--surface); border:1px solid var(--line); padding:8px 14px; border-radius:999px; font-size:13px; display:inline-block; margin:4px; }
.sidebar-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow); padding:24px; position:sticky; top:100px; }
#detail-map, #map-picker { height:300px; border-radius:12px; margin-top:10px; }
@media (max-width:900px){ .detail-grid{ grid-template-columns:1fr; } }

.admin-shell { display:flex; min-height:calc(100vh - 76px); }
.admin-sidebar { width:220px; background:var(--ink); color:#fff; padding:24px 0; flex-shrink:0; }
.admin-sidebar a { display:block; padding:12px 24px; color:#C7D4CE; font-weight:500; }
.admin-sidebar a.active, .admin-sidebar a:hover { background:rgba(255,255,255,0.08); color:#fff; border-right:3px solid var(--brass); }
.admin-main { flex:1; padding:32px; }
.tabs-filter { display:flex; gap:8px; margin-bottom:20px; }
.tab-btn { padding:9px 18px; border-radius:999px; border:1px solid var(--line); background:var(--surface); font-size:14px; font-weight:600; }
.tab-btn.active { background:var(--ink-2); color:#fff; border-color:var(--ink-2); }
.review-item { background:var(--surface); border-radius:12px; box-shadow:var(--shadow); padding:20px; margin-bottom:16px; }
.review-item .top { display:flex; justify-content:space-between; align-items:start; gap:16px; }
.review-item .thumbs { display:flex; gap:6px; margin:12px 0; overflow-x:auto; }
.review-item .thumbs img { width:70px; height:56px; object-fit:cover; border-radius:6px; }
.review-actions { display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; }
.review-actions .btn { padding:8px 16px; font-size:13px; }
table { width:100%; border-collapse:collapse; background:var(--surface); border-radius:12px; overflow:hidden; box-shadow:var(--shadow); }
th, td { padding:14px 16px; text-align:right; font-size:14px; border-bottom:1px solid var(--line); }
th { background:var(--parchment); color:var(--ink); }

.my-item { background:var(--surface); border-radius:12px; box-shadow:var(--shadow); padding:20px; display:flex; gap:16px; margin-bottom:16px; align-items:center; }
.my-item img { width:100px; height:80px; object-fit:cover; border-radius:8px; }
.my-item .info { flex:1; }
.my-item .notes { background:#FDF3DA; padding:10px 14px; border-radius:8px; font-size:13px; color:#7A5B2A; margin-top:8px; }
.edit-panel { background:var(--parchment); border-radius:10px; padding:16px; margin-top:14px; display:none; }

/* ============================================
   مكونات خاصة بمنصة عقار إكزت
   ============================================ */

/* شريط الإحصائيات في الهيرو */
.stats-row { display:flex; gap:16px; justify-content:center; margin-top:40px; flex-wrap:wrap; position:relative; z-index:2; }
.stat-box { background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.15); border-radius:14px; padding:20px 28px; text-align:center; min-width:160px; }
.stat-box b { display:block; font-size:28px; color:var(--brass); font-family:var(--font-display); }
.stat-box span { font-size:13px; color:#C7D4CE; }

/* مقارنة سيناريو الإلغاء مقابل التنازل */
.vs-compare { display:grid; grid-template-columns:1fr auto 1fr; gap:20px; align-items:center; margin:36px 0; }
.vs-card { background:var(--surface); border-radius:16px; padding:28px; box-shadow:var(--shadow); }
.vs-card.bad { border-top:4px solid var(--brick); }
.vs-card.good { border-top:4px solid var(--success); }
.vs-card h4 { font-size:16px; margin-bottom:16px; color:var(--muted); font-weight:600; }
.vs-card .big-number { font-size:32px; font-weight:700; color:var(--ink); font-family:var(--font-display); margin:10px 0; }
.vs-card .big-number.loss { color:var(--brick); }
.vs-card .big-number.gain { color:var(--success); }
.vs-card .sub { font-size:13px; color:var(--muted); }
.vs-divider { font-family:var(--font-display); font-weight:700; font-size:20px; color:var(--brass); background:var(--parchment); border-radius:50%; width:52px; height:52px; display:flex; align-items:center; justify-content:center; border:2px solid var(--brass); }
@media (max-width:800px){ .vs-compare{ grid-template-columns:1fr; } .vs-divider{ margin:0 auto; } }

/* جدول المقارنة (ريسيل عادي مقابل عقار إكزت) */
.compare-table { width:100%; border-collapse:separate; border-spacing:0 8px; }
.compare-table th { text-align:right; padding:10px 16px; font-size:13px; color:var(--muted); font-weight:600; }
.compare-table td { padding:16px; font-size:14px; }
.compare-table tr td:first-child { border-radius:10px 0 0 10px; }
.compare-table tr td:last-child { border-radius:0 10px 10px 0; }
.compare-table .col-old { background:#FBEDE6; }
.compare-table .col-new { background:#E7F3EC; font-weight:600; }
.compare-table .row-label { font-weight:700; color:var(--ink); background:transparent !important; }

/* خطوات "إزاي بنشتغل" */
.steps-timeline { display:grid; grid-template-columns:repeat(5, 1fr); gap:20px; margin:32px 0; }
.step-box { text-align:center; }
.step-box .num { width:48px; height:48px; border-radius:50%; background:var(--ink); color:var(--brass); display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:700; font-size:20px; margin:0 auto 14px; }
.step-box h4 { font-size:15px; margin-bottom:8px; }
.step-box p { font-size:13px; color:var(--muted); line-height:1.6; }
@media (max-width:900px){ .steps-timeline{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .steps-timeline{ grid-template-columns:1fr; } }

/* بطاقات مبادئ الخروج العادل */
.principle-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:18px; margin:28px 0; }
.principle-card { background:var(--surface); border-radius:14px; padding:22px; box-shadow:var(--shadow); text-align:center; }
.principle-card .ic { font-size:28px; margin-bottom:10px; }
.principle-card h4 { font-size:14px; margin-bottom:8px; }
.principle-card p { font-size:12px; color:var(--muted); line-height:1.6; }
@media (max-width:900px){ .principle-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){ .principle-grid{ grid-template-columns:1fr; } }

/* الحاسبة */
.calc-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-lg); padding:32px; }
.calc-result { margin-top:28px; }

/* بطاقة الفرصة (بدل بطاقة العقار العادية) */
.opp-card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow); padding:22px; transition:transform .2s, box-shadow .2s; }
.opp-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.opp-card .top-row { display:flex; justify-content:space-between; align-items:start; margin-bottom:14px; }
.opp-card .dev-tag { font-size:12px; color:var(--muted); background:var(--parchment); padding:4px 10px; border-radius:6px; }
.opp-price-row { display:flex; gap:20px; margin:16px 0; padding:14px; background:var(--parchment); border-radius:10px; }
.opp-price-row .col { flex:1; text-align:center; }
.opp-price-row .col b { display:block; font-size:17px; color:var(--ink); }
.opp-price-row .col span { font-size:11px; color:var(--muted); }
.savings-tag { background:var(--success); color:#fff; padding:6px 14px; border-radius:999px; font-size:12px; font-weight:700; display:inline-block; }

/* صفحات محتوى ثابت (قصتنا، الأسئلة الشائعة) */
.content-page { max-width:760px; margin:0 auto; }
.content-page h2 { font-size:28px; margin-bottom:16px; }
.content-page p { line-height:1.9; margin-bottom:16px; }
.faq-item { background:var(--surface); border-radius:12px; box-shadow:var(--shadow); padding:20px 24px; margin-bottom:14px; }
.faq-item h4 { font-size:16px; margin-bottom:8px; color:var(--ink-2); }
.faq-item p { font-size:14px; color:var(--text); margin:0; }

.silent-badge { background:var(--ink); color:#fff; font-size:11px; padding:4px 10px; border-radius:6px; display:inline-flex; align-items:center; gap:4px; }
