/* ============================================================
   كاشف مستحق الحضانة — الهوية البصرية
   لوحة: أخضر قضائي عميق + رملي ذهبي + عاجي
   ============================================================ */

:root {
  --green-900: #0c3b2e;
  --green-700: #14533f;
  --green-100: #e3efe9;
  --gold: #c9a227;
  --gold-soft: #f3e9cf;
  --ivory: #f7f5ef;
  --ink: #1c2321;
  --line: #d8d2c2;
  --danger: #9c2b2b;
  --ok: #1f7a4d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(12, 59, 46, .08);
  --f-display: 'Reem Kufi', sans-serif;
  --f-body: 'IBM Plex Sans Arabic', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  background:
    radial-gradient(1200px 500px at 90% -10%, var(--green-100), transparent 60%),
    var(--ivory);
  color: var(--ink);
  line-height: 1.8;
}

/* ---------- الترويسة ---------- */
.site-header {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: #fff;
  padding: 28px clamp(16px, 5vw, 56px);
  border-bottom: 4px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 18px; }
.brand-seal {
  width: 58px; height: 58px; flex: none;
  display: grid; place-items: center;
  font-size: 28px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.brand-text h1 {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  margin: 0;
  letter-spacing: .5px;
}
.brand-text p { margin: 2px 0 0; opacity: .85; font-size: .95rem; }

/* ---------- التخطيط ---------- */
.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 28px;
  max-width: 1100px;
  margin: 32px auto 60px;
  padding: 0 clamp(14px, 4vw, 28px);
  align-items: start;
}

/* ---------- شريط الخطوات ---------- */
.stepper { position: sticky; top: 20px; }
.stepper ol { list-style: none; margin: 0; padding: 0; }
.stepper li {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 12px;
  color: #6a7268;
  font-size: .95rem;
}
.stepper li::before {
  content: '';
  position: absolute;
  right: 8px; top: 36px; bottom: -6px;
  width: 2px;
  background: var(--line);
}
.stepper li:last-child::before { display: none; }
.stepper .dot {
  width: 18px; height: 18px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  z-index: 1;
}
.stepper li.active { color: var(--green-900); font-weight: 600; }
.stepper li.active .dot { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.stepper li.done .dot { border-color: var(--green-700); background: var(--green-700); }
.stepper li.done { color: var(--green-700); }

/* ---------- اللوحة ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
  min-height: 420px;
}
.panel h2 {
  font-family: var(--f-display);
  color: var(--green-900);
  margin: 0 0 6px;
  font-size: 1.5rem;
}
.muted { color: #6a7268; }
.small { font-size: .85rem; }

.intro-list { padding-right: 20px; }
.intro-list li { margin-bottom: 4px; }

/* ---------- البطاقات ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
  background: #fffdf8;
}
.card h3 {
  font-family: var(--f-display);
  margin: 0 0 10px;
  color: var(--green-700);
  font-size: 1.1rem;
}
.card-head { display: flex; justify-content: space-between; align-items: center; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; }
input, select, textarea {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 1px; border-color: var(--gold); }

.age-pill {
  display: inline-block;
  margin: 12px 0 0;
  padding: 5px 14px;
  background: var(--green-100);
  border-radius: 999px;
  font-size: .9rem;
  color: var(--green-900);
}

/* ---------- الأسئلة ---------- */
.q-row {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.q-row:last-child { border-bottom: none; }
.q-row > span { flex: 1 1 280px; }

.tri { display: flex; gap: 8px; flex: none; }
.tri-btn {
  font: inherit;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: all .15s;
}
.tri-btn:hover { border-color: var(--green-700); }
.tri-btn.on {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
  font-weight: 600;
}

.def-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--green-900);
  font-weight: 700;
  cursor: pointer;
  font-size: .8rem;
  vertical-align: middle;
}

/* ---------- الملاحظات ---------- */
.note {
  background: var(--gold-soft);
  border-right: 4px solid var(--gold);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .92rem;
  margin: 12px 0 0;
}
.note.danger { background: #f9e8e8; border-color: var(--danger); color: var(--danger); }
.note.ok { background: #e7f4ec; border-color: var(--ok); color: var(--ok); }

/* ---------- الأزرار ---------- */
.btn {
  font: inherit;
  padding: 10px 26px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 600;
}
.btn-primary { background: var(--green-900); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-700); }
.btn-add { background: transparent; border: 1px dashed var(--green-700); color: var(--green-700); margin-top: 4px; }
.icon-btn {
  font: inherit; font-size: .8rem;
  background: transparent; border: 1px solid var(--line);
  border-radius: 8px; padding: 3px 10px; cursor: pointer; color: var(--danger);
}
.nav-row { display: flex; justify-content: space-between; margin-top: 26px; }

/* ---------- بطاقة النتيجة (محضر قضائي) ---------- */
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 22px 0;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--gold), var(--green-700)) border-box;
  border: 2px solid transparent;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.result-head {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px; margin-bottom: 14px;
}
.result-num { font-family: var(--f-display); color: var(--green-900); font-size: 1.05rem; }
.result-seal { color: var(--gold); font-size: 1.4rem; }

.result-meta { display: flex; flex-wrap: wrap; gap: 26px; margin: 0 0 14px; }
.result-meta dt { font-size: .8rem; color: #6a7268; }
.result-meta dd { margin: 0; font-weight: 600; }

.result-winner {
  background: var(--green-100);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 12px;
}
.result-winner span { font-size: .85rem; color: var(--green-700); }
.result-winner strong { font-family: var(--f-display); font-size: 1.3rem; color: var(--green-900); }

.result-card h4 { margin: 16px 0 6px; color: var(--green-900); }
.x-list { padding-right: 20px; margin: 0; }
.x-list li { margin-bottom: 4px; }
.x-list.warn li { color: #7a5a00; }

.convince { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 6px; }
.objection { margin-top: 10px; }

.summary { background: var(--green-100); }

/* ---------- تنبيه المحامي ---------- */
.lawyer-banner {
  position: fixed;
  bottom: 18px; right: 18px; left: 18px;
  max-width: 560px;
  margin-inline-start: auto;
  background: var(--green-900);
  color: #fff;
  padding: 14px 44px 14px 18px;
  border-radius: 12px;
  border-right: 5px solid var(--gold);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  z-index: 50;
  font-size: .92rem;
}
.lawyer-banner button {
  position: absolute; top: 8px; left: 10px;
  background: none; border: none; color: #fff;
  font-size: 1.2rem; cursor: pointer;
}

/* ---------- النوافذ والتوست ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(12, 59, 46, .45);
  display: grid; place-items: center;
  z-index: 60; padding: 18px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  max-width: 520px;
  padding: 24px 26px;
  box-shadow: var(--shadow);
}
.modal-box h3 { font-family: var(--f-display); color: var(--green-900); margin-top: 0; }

.toast {
  position: fixed;
  bottom: 24px; right: 50%;
  transform: translateX(50%) translateY(20px);
  background: var(--danger);
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  opacity: 0;
  transition: all .25s;
  z-index: 70;
  font-size: .92rem;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

.hidden { display: none !important; }

/* ---------- التذييل ---------- */
.site-footer {
  text-align: center;
  color: #6a7268;
  font-size: .85rem;
  padding: 20px;
  border-top: 1px solid var(--line);
}

/* ---------- الجوال ---------- */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .stepper { position: static; overflow-x: auto; }
  .stepper ol { display: flex; gap: 4px; }
  .stepper li { flex-direction: column; gap: 4px; font-size: .72rem; padding: 0 6px; text-align: center; }
  .stepper li::before { display: none; }
  .q-row > span { flex-basis: 100%; }
}

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

/* ============================================================
   إضافات النسخة الثانية: عداد، واتساب، تحليل AI، استئناف
   ============================================================ */

/* عداد المستخدمين في الترويسة */
.site-header { position: relative; }
.visitor-counter {
  position: absolute;
  top: 50%; left: clamp(16px, 5vw, 56px);
  transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 7px 16px;
  color: #fff;
  backdrop-filter: blur(4px);
}
.visitor-counter .vc-num { font-family: var(--f-display); font-size: 1.15rem; color: var(--gold); font-weight: 700; }
.visitor-counter .vc-label { font-size: .8rem; opacity: .85; }
.visitor-counter .vc-icon { font-size: 1rem; }

/* زر واتساب عائم ثابت */
.wa-fab {
  position: fixed;
  bottom: 22px; left: 22px;
  display: flex; align-items: center; gap: 9px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--f-body);
  box-shadow: 0 8px 24px rgba(37,211,102,.4);
  z-index: 55;
  transition: transform .18s, box-shadow .18s;
}
.wa-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(37,211,102,.55); }
.wa-fab svg { flex: none; }

/* زر واتساب داخل تنبيه المحامي */
.banner-wa {
  display: inline-block;
  margin-inline-start: 10px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .88rem;
}

/* زر وقسم التحليل بالذكاء الاصطناعي */
.analyze-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn-analyze:disabled { opacity: .5; cursor: not-allowed; }
.analyze-hint { font-size: .8rem; color: #6a7268; }
.analyze-out { margin-top: 14px; }
.ai-loading {
  padding: 14px; text-align: center; color: var(--green-700);
  border: 1px dashed var(--green-700); border-radius: 10px; background: var(--green-100);
}
.ai-card {
  border: 1px solid var(--gold);
  border-radius: 12px;
  overflow: hidden;
  background: #fffdf6;
}
.ai-card-head {
  background: var(--gold-soft);
  padding: 10px 16px;
  font-family: var(--f-display);
  color: var(--green-900);
  border-bottom: 1px solid var(--gold);
}
.ai-card-body { padding: 14px 18px; line-height: 1.9; }
.ai-wa { margin: 0 18px 16px; }

/* خدمة الاستئناف */
.appeal-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--green-100), #fff);
}
.appeal-head {
  font-family: var(--f-display);
  color: var(--green-900);
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.appeal-box p { margin: 4px 0 12px; font-size: .92rem; }
.btn-appeal {
  display: inline-block;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 700;
}
.btn-appeal:hover { background: #1eb955; }

@media (max-width: 760px) {
  .visitor-counter { position: static; transform: none; margin-top: 14px; justify-content: center; }
  .wa-fab span { display: none; }
  .wa-fab { padding: 14px; }
}

/* ============================================================
   كتلة المجتمع: فيديو التصويت + تيك توك + الشكاوى
   ============================================================ */
.community {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 2px dashed var(--line);
}
.vote-card {
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--gold-soft), #fff);
}
.vote-head {
  font-family: var(--f-display);
  color: var(--green-900);
  font-size: 1.08rem;
  margin-bottom: 4px;
}
.vote-video {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 12px auto 0;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 9 / 16;
}
.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.community-links .btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-tiktok {
  background: #000;
  color: #fff;
  border: 1px solid #000;
}
.btn-tiktok:hover { background: #111; }
.btn-feedback {
  background: #fff;
  color: var(--green-900);
  border: 1px solid var(--green-700);
}
.btn-feedback:hover { background: var(--green-100); }

@media (max-width: 760px) {
  .community-links .btn { flex: 1 1 100%; justify-content: center; }
}
