/* ==========================================================================
   كاشف — نظام التصميم الأساسي
   الألوان والخطوط مستنبطة حرفياً من هوية erticaz.com
   ========================================================================== */

:root {
  /* لوحة إرتكاز */
  --brand:        #5d4d9e;
  --brand-deep:   #312265;
  --brand-accent: #7a3fd1;
  --brand-soft:   #f3f0fb;
  --brand-softer: #faf8ff;
  --whatsapp:     #25d366;
  --whatsapp-dark:#128c7e;

  /* دلالات */
  --danger:  #d92d20;
  --warning: #b95c05;
  --success: #067647;
  --info:    #175cd3;

  /* أسطح ونصوص */
  --bg:            #f7f6fb;
  --surface:       #ffffff;
  --surface-2:     #fbfafe;
  --border:        #e4e1ef;
  --border-strong: #cfc9e4;
  --text:          #1c1a2e;
  --text-muted:    #5f5b78;
  --text-faint:    #6b6784;

  /* قياسات */
  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow:    0 1px 2px rgba(49, 34, 101, .06), 0 8px 24px rgba(49, 34, 101, .06);
  --shadow-lg: 0 4px 12px rgba(49, 34, 101, .08), 0 24px 48px rgba(49, 34, 101, .10);
  --maxw:      1120px;

  --font-head: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Tajawal', 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'SFMono-Regular', ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --brand:        #9b8ad6;
    --brand-deep:   #b9a9ee;
    --brand-accent: #a97bec;
    --brand-soft:   #241d3d;
    --brand-softer: #1d1830;
    --bg:            #14111f;
    --surface:       #1c182b;
    --surface-2:     #221d34;
    --border:        #322b48;
    --border-strong: #453b63;
    --text:          #eeecf6;
    --text-muted:    #b3aecb;
    --text-faint:    #6b6784;
    --danger:  #f97066;
    --warning: #fdb022;
    --success: #47cd89;
    --info:    #84adff;
    --shadow:    0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, .35), 0 24px 48px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.3; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.85rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.12rem; }
p  { margin: 0 0 1em; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* رابط التخطي: مخفي حتى يصله التركيز بلوحة المفاتيح. */
a.sr-only:focus {
  position: fixed; inset-block-start: 12px; inset-inline-start: 12px;
  width: auto; height: auto; margin: 0; padding: 10px 18px; clip: auto;
  z-index: 100; background: var(--brand-deep); color: #fff;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}

/* حلقة تركيز موحّدة وواضحة على كل عنصر تفاعلي. */
:is(a, button, input, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- الرأس ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; }

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-deep));
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 800;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-size: 1.06rem; }
.logo-sub  { font-size: .68rem; font-weight: 500; color: var(--text-faint); letter-spacing: .02em; }

.site-nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.site-nav a {
  color: var(--text-muted); font-size: .9rem; font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
}
.site-nav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

.lang-switch { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 168px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.lang-menu[data-open='true'] { display: block; }
.lang-menu a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); font-size: .9rem; }
.lang-menu a:hover { background: var(--brand-soft); text-decoration: none; }
.lang-menu a[aria-current='true'] { color: var(--brand); font-weight: 700; background: var(--brand-soft); }

/* ---------- البطل ---------- */
.hero { padding: 52px 0 26px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand-deep);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 999px; padding: 6px 15px; font-size: .82rem; font-weight: 600; margin-bottom: 18px;
}
.hero-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: none; }
.hero h1 { max-width: 20ch; margin-inline: auto; }
.hero p  { max-width: 62ch; margin-inline: auto; color: var(--text-muted); font-size: 1.05rem; }

.counter-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.counter {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 18px; min-width: 128px; box-shadow: var(--shadow);
}
.counter-value { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: var(--brand-deep); line-height: 1.2; }
.counter-label { font-size: .76rem; color: var(--text-faint); }
.counter[hidden] { display: none; }
.counter-row[hidden] { display: none; }

/* ---------- الأقسام المحتوائية ---------- */
.section { padding: 44px 0; }
.section-narrow { max-width: 800px; margin-inline: auto; }
.section h2 { margin-bottom: .6em; }
.section p { color: var(--text-muted); }

.prose-block + .prose-block { margin-top: 34px; }

.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 15px 18px; font-family: var(--font-head);
  font-weight: 600; font-size: 1rem; list-style: none; display: flex;
  align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--brand); font-size: 1.3rem; font-weight: 700; flex: none; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--brand-softer); }
.faq-answer { padding: 0 18px 16px; color: var(--text-muted); font-size: .95rem; }

/* ---------- نداء التواصل ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-accent));
  border-radius: var(--radius-lg); padding: 32px; color: #fff; text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; margin-bottom: .35em; }
.cta-band p  { color: rgba(255, 255, 255, .88); max-width: 60ch; margin-inline: auto; }
.cta-services { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 22px; }
.cta-services span {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; padding: 5px 14px; font-size: .84rem;
}
.btn-whatsapp {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--whatsapp); color: #062d18; font-weight: 700; font-family: var(--font-head);
  padding: 13px 26px; border-radius: 999px; font-size: 1rem; border: none; cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(37, 211, 102, .34); transition: transform .15s ease, box-shadow .15s ease;
}
.btn-whatsapp svg { width: 21px; height: 21px; fill: currentColor; flex: none; }
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(37, 211, 102, .42); text-decoration: none; color: #062d18; }
.cta-phone { display: block; margin-top: 12px; color: rgba(255, 255, 255, .9); font-size: .88rem; }
.cta-phone a { color: #fff; font-weight: 700; }

.wa-float {
  position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 80;
  width: 56px; height: 56px; border-radius: 50%; background: var(--whatsapp);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(37, 211, 102, .45);
  transition: transform .18s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- عن إرتكاز ---------- */
.about-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow); text-align: center;
}
.about-card img { height: 46px; width: auto; margin-bottom: 14px; }
.about-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--brand);
  color: var(--brand); background: transparent; padding: 10px 20px; border-radius: 999px;
  font-weight: 600; font-family: var(--font-head); cursor: pointer; font-size: .93rem;
}
.btn-outline:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* ---------- التذييل ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 26px 0; margin-top: 44px; font-size: .87rem; color: var(--text-muted);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-langs a { color: var(--text-muted); }

@media (max-width: 860px) {
  .site-nav a[data-optional] { display: none; }
  .hero { padding-top: 34px; }
}
@media (max-width: 560px) {
  .logo-sub { display: none; }
  .cta-band { padding: 24px 18px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
