/* =========================================================================
   منصة المسار — نظام الألوان
   نظام أحادي اللون مبني على الزمرّد: الأخضر هو اللون الوحيد الحقيقي،
   والباقي رماديات محايدة باردة قليلاً حتى يبرز الأخضر ولا يزاحمه شيء.
   الألوان الدلالية (تحذير/خطأ/معلومة) مخفّضة التشبّع عمداً.
   ========================================================================= */

:root {
  /* --- سُلّم الأخضر --- */
  --green-50:  #ECFDF3;
  --green-100: #D1FADF;
  --green-200: #A6F4C5;
  --green-300: #5BE49B;
  --green-400: #26C97A;
  --green-500: #12A257;   /* الأساس */
  --green-600: #0D8347;
  --green-700: #0A6537;
  --green-800: #084C2A;
  --green-900: #05301B;

  --green: var(--green-500);
  --green-d: var(--green-600);
  --soft: var(--green-50);
  --deep: #06231A;        /* خلفية الأقسام الداكنة */

  /* --- رماديات محايدة --- */
  --bg: #F6F8F7;
  --card: #FFFFFF;
  --ink: #0E1513;
  --ink2: #3D4A45;
  --muted: #6E7C76;
  --line: #E2E7E4;
  --line2: #EFF2F0;
  --tint: #F0F4F2;

  /* --- ظلال متدرّجة الطبقات --- */
  --sh: 0 1px 2px rgba(8, 42, 30, .05), 0 1px 1px rgba(8, 42, 30, .03);
  --sh2: 0 2px 8px rgba(6, 35, 26, .05), 0 10px 24px rgba(6, 35, 26, .06);
  --sh3: 0 18px 44px rgba(8, 42, 30, .16);

  /* --- ألوان دلالية مخفّضة التشبّع --- */
  --amber: #8A5A08;
  --amber-s: #FBF3E3;
  --blue: #1E5296;
  --blue-s: #EAF1F9;
  --red: #9E2A2A;
  --red-s: #FAEDED;
  --danger: #B3261E;

  /* --- أقسام معكوسة --- */
  --inv-bg: #082B20;
  --inv-fg: #EEF4F1;
  --inv-tile: #0F3B2A;
  --logo-filter: none;

  /* --- أنصاف أقطار موحّدة --- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --header-h: 74px;
}

* { box-sizing: border-box; font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* يعلو على أي display في الأنماط السطرية */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1 { font-size: 36px; line-height: 1.24; font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 26px; line-height: 1.3; font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: 18px; line-height: 1.45; font-weight: 700; letter-spacing: -.01em; }
p { font-size: 15px; line-height: 1.85; }
button, input, select, textarea { font-size: 14px; line-height: 1.6; font-family: inherit; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-d); }
img, svg, .img-slot { max-width: 100%; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* ---------------------------------------------------------------- الحركات */
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes pulseDot { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes floaty { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

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

/* ------------------------------------------------- خانات الصور (image-slot) */
.img-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  overflow: hidden;
}
.img-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-slot.contain img { object-fit: contain; }
.img-slot.circle, .img-slot.circle img { border-radius: 50%; }

/* -------------------------------------------------------- حالات المرور (hover) */
.hov-lift { transition: transform .22s, box-shadow .22s; }
.hov-lift:hover { transform: translateY(-5px); box-shadow: var(--sh2); }
.hov-lift-sm { transition: transform .18s; }
.hov-lift-sm:hover { transform: translateY(-2px); }
.hov-ring { transition: box-shadow .18s, border-color .18s; }
.hov-ring:hover { box-shadow: var(--sh2); border-color: var(--green); }
.hov-green { transition: color .18s, background .18s; }
.hov-green:hover { color: var(--green); background: var(--tint); }
.hov-green-text { transition: color .18s; }
.hov-green-text:hover { color: var(--green); }
.hov-red:hover { color: var(--danger); background: var(--red-s); }
.hov-tint { transition: background .2s; }
.hov-tint:hover { background: var(--tint); }
.hov-soft { transition: background .18s; }
.hov-soft:hover { background: var(--soft); }
.hov-invert { transition: background .18s, color .18s; }
.hov-invert:hover { background: var(--green); color: #fff; }
.hov-border { transition: border-color .18s, color .18s; }
.hov-border:hover { border-color: var(--green); color: var(--green); }
.hov-underline { text-decoration-color: transparent; transition: text-decoration-color .18s; }
.hov-underline:hover { text-decoration: underline; text-decoration-color: var(--green-300); text-underline-offset: 4px; }

/* الشريط المتحرك — يتوقف عند المرور */

/* -------------------------------------------------------------- الترويسة */
.hdr-nav::-webkit-scrollbar { display: none; }
.hdr-nav { scrollbar-width: none; }
#hdr-burger { display: none; }

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

/* إبراز واضح لعنصر التركيز — مهم للوصولية */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------------------------------------ عناصر النماذج */
.fld {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.fld:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in oklab, var(--green) 18%, transparent); }
.fld.ltr { direction: ltr; text-align: left; }
.fld-label { font-size: 12.5px; font-weight: 600; margin-bottom: 5px; display: block; }
.fld-err { color: var(--red); font-size: 12.5px; margin-top: 5px; display: block; }
.fld.is-invalid { border-color: var(--red); }
select.fld { appearance: none; background-image: none; }
textarea.fld { min-height: 90px; resize: vertical; }

.btn {
  border: none;
  background: var(--green);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s, filter .18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); filter: none; }
.btn-danger { background: #DC2626; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- التنبيهات */
.toast-stack {
  position: fixed;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--card);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh2);
  animation: toastIn .28s both;
}
.toast.err { background: #B91C1C; color: #fff; }

.alert {
  border-radius: 11px;
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-ok { background: var(--soft); color: var(--green-d); border-color: var(--green); }
.alert-err { background: var(--red-s); color: var(--red); border-color: var(--red); }
.alert-info { background: var(--blue-s); color: var(--blue); border-color: var(--blue); }

/* -------------------------------------------------------------- التخطيطات */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.grid-auto { display: grid; gap: 18px; }

/* ================================ الاستجابة للأجهزة المحمولة (web app) ==== */

@media (max-width: 1080px) {
  .side-sticky { position: static !important; }
}

@media (max-width: 900px) {
  /* أي شبكة بعمودين تنهار إلى عمود واحد */
  .split-2 { grid-template-columns: 1fr !important; }
  .dash-shell { grid-template-columns: 1fr !important; }
  .dash-aside { position: static !important; margin-bottom: 18px; }
}

@media (max-width: 820px) {
  :root { --header-h: 62px; }
  #hdr-burger { display: flex !important; }
  header nav.hdr-nav { display: none !important; }
  header .hdr-bar { height: 62px !important; gap: 6px !important; padding-inline: 12px !important; }
  #hdr-auth { display: none !important; }

  h1 { font-size: 27px !important; }
  h2 { font-size: 21px !important; }
  .hero-h1 { font-size: 32px !important; line-height: 1.3 !important; }
  .hero-art { display: none !important; }

  .wrap { padding: 0 16px; }
  .sec-pad { padding-block: 36px !important; }

  footer > div:first-child { padding-top: 32px !important; gap: 0 !important; }
  footer > div:first-child > div { padding: 18px 0 !important; border-bottom: 1px solid var(--line2); }
  footer > div:last-child { flex-direction: column; align-items: flex-start; gap: 6px !important; text-align: right; }
}

@media (max-width: 720px) {
  /* البطاقات ذات الارتفاع الثابت تصبح مرنة على الجوال */
  .card-fixed { height: auto !important; }
  .filters-aside {
    position: static !important;
    margin-bottom: 16px;
  }
  .list-shell { grid-template-columns: 1fr !important; }
  .table-scroll { overflow-x: auto; }
  .table-scroll > * { min-width: 620px; }
  .stack-sm { flex-direction: column !important; align-items: stretch !important; }
  .stack-sm > * { width: 100%; }
}

@media (max-width: 560px) {
  .hide-xs { display: none !important; }
  /* حقل البحث في الواجهة: النص يُقصّ بدل أن يمرّ تحت الزر */
  #hero-q { font-size: 14px; }
  #hero-q::placeholder { font-size: 13px; }
  .btn { padding: 12px 18px; }
  .wrap { padding: 0 14px; }
  .price-row { flex-direction: column; align-items: flex-start !important; gap: 10px; }
}

/* شريط تنقّل سفلي للجوال — يجعل الموقع يتصرّف كتطبيق */
.mobile-tabs { display: none; }

@media (max-width: 820px) {
  .mobile-tabs {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 50;
    background: var(--card);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 14px rgba(0, 0, 0, .06);
  }
  .mobile-tabs a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 10px;
  }
  .mobile-tabs a.on { color: var(--green); background: var(--tint); }
  body { padding-bottom: 66px; }
}

/* الطباعة — للفواتير والشهادات */
@media print {
  header, footer, .mobile-tabs, .toast-stack, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
}

/* =========================================================================
   نمط الأقسام — مستوحى من المرجع المرسل:
   شارة صغيرة بنقطة، عنوان متوسّط، بطاقات بأيقونة مربّعة، وشريط أرقام عائم.
   ========================================================================= */

/* شارة القسم: ● عنوان صغير */
.pill-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
  background: var(--soft);
  border: 1px solid var(--green-100);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
  letter-spacing: .01em;
}
.pill-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
/* رأس قسم متوسّط */
.sec-head {
  max-width: 620px;
  margin: 0 auto 40px;
  text-align: center;
}
.sec-head h2 {
  font-size: 38px;
  line-height: 1.22;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -.028em;
  text-wrap: balance;
}
.sec-head p {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.85;
}
@media (max-width: 720px) { .sec-head h2 { font-size: 28px; } }

/* شريط الأرقام العائم بين الواجهة والقسم التالي */
.stat-bar {
  position: relative;
  z-index: 5;
  margin-top: -44px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh2);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  overflow: hidden;
}
.stat-bar > div {
  padding: 26px 20px;
  text-align: center;
  border-inline-start: 1px solid var(--line2);
}
.stat-bar > div:first-child { border-inline-start: none; }
.stat-bar .n {
  font-size: 30px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.2;
  direction: ltr;
  unicode-bidi: isolate;
}
.stat-bar .l { font-size: 13px; color: var(--muted); margin-top: 5px; }
@media (max-width: 720px) {
  .stat-bar { margin-top: -24px; }
  .stat-bar > div { padding: 18px 12px; }
  .stat-bar .n { font-size: 23px; }
}

/* أيقونة مربّعة صغيرة داخل البطاقات */
.icon-sq {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* بطاقة خدمة/ميزة */
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh2);
  border-color: var(--green-200);
}
.feature-card h3 { font-size: 16.5px; font-weight: 700; margin: 16px 0 7px; }
.feature-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.feature-card .more {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

/* شريحة صغيرة لعناصر القائمة (الحالات/التخصصات) */
.chip-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .18s, background .18s;
}
.chip-card:hover { border-color: var(--green); background: var(--soft); color: var(--ink); }
.chip-card::before { content: '✓'; color: var(--green); font-weight: 700; font-size: 13px; }

/* أقسام بخلفية نعناعية فاتحة تتناوب مع الأبيض */
.band-mint { background: var(--soft); border-block: 1px solid var(--line); }
.band-card { background: var(--card); border-block: 1px solid var(--line); }

/* شريط دعوة داكن قبل التذييل */
.cta-band {
  background: linear-gradient(135deg, #EDF3CF 0%, #E3EFE6 55%, #DEE9F7 100%);
  color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: var(--r-lg);
  padding: 48px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-min), 1fr));
  gap: 28px;
  align-items: center;
}
.cta-band h2 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 10px; color: var(--ink); line-height: 1.35; }
.cta-band p { margin: 0; font-size: 15.5px; color: var(--ink2); line-height: 1.85; }
@media (max-width: 720px) { .cta-band { padding: 32px 24px; } .cta-band h2 { font-size: 24px; } }

/* ── عنوان الواجهة: السطر الأخير بلون العلامة (كما في المرجع) ───────────── */
.hero-accent { color: var(--green-300); }

/* شريط الثقة أسفل أزرار الواجهة */
.trust-row { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.trust-avatars { display: flex; }
.trust-avatars span {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--deep); margin-inline-start: -9px;
  background: var(--green-400); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.trust-avatars span:first-child { margin-inline-start: 0; }
.trust-avatars img { width: 100%; height: 100%; object-fit: cover; }

/* وسوم صغيرة تحت أزرار الواجهة */
.hero-tag {
  font-size: 12.5px; color: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--r-pill); padding: 6px 14px;
}

/* بطاقة عائمة بيضاء فوق صورة الواجهة */
.float-card {
  position: absolute; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh3); padding: 12px 15px; z-index: 3;
}

/* بطاقات داكنة داخل القسم الأسود */
.dark-card {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-md); padding: 22px;
}
.dark-card h3 { font-size: 15.5px; font-weight: 700; color: #fff; margin: 14px 0 7px; }
.dark-card p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .6); line-height: 1.8; }
.dark-card .icon-sq { background: rgba(255, 255, 255, .1); color: var(--green-300); }

/* قائمة مزايا بعلامات صح */
.check-list { display: flex; flex-direction: column; gap: 11px; margin: 20px 0 26px; }
.check-list div { display: flex; gap: 10px; font-size: 14.5px; color: var(--ink2); line-height: 1.7; }
.check-list div::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }

/* بطاقة رأي */
.quote-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px;
}
.quote-card .stars { color: #E0A83C; font-size: 14px; letter-spacing: 2px; margin-bottom: 12px; }
.quote-card p { margin: 0 0 18px; font-size: 14.5px; color: var(--ink2); line-height: 1.85; }

/* أكورديون الأسئلة */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 20px 4px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; text-align: right; font-size: 15.5px; font-weight: 600; color: var(--ink);
}
.faq-a { margin: 0; padding: 0 4px 20px; font-size: 14.5px; color: var(--muted); line-height: 1.9; }

/* تذييل داكن */
footer.dark-footer { background: var(--deep); border-top: none; color: var(--inv-fg); }
footer.dark-footer a { color: rgba(255, 255, 255, .62); }
footer.dark-footer a:hover { color: var(--green-300); }
footer.dark-footer .f-title { color: #fff; font-weight: 600; }
footer.dark-footer .f-muted { color: rgba(255, 255, 255, .55); }
footer.dark-footer .f-line { border-color: rgba(255, 255, 255, .12) !important; }
footer.dark-footer svg { color: #fff !important; }

/* ── شريط إعلان علوي (مشترك بين المرجعين) ───────────────────────────────── */
.announce {
  background: var(--green-50);
  border-bottom: 1px solid var(--green-100);
  font-size: 12.5px;
  color: var(--ink2);
  text-align: center;
  padding: 9px 16px;
}
.announce a { font-weight: 700; }
.announce b { color: var(--ink); font-weight: 700; }

/* ── تبويبات التنقّل الدائرية: العنصر النشط بكبسولة خضراء ────────────────── */
.hdr-nav a {
  border-radius: var(--r-pill);
  padding: 9px 15px !important;
  transition: background .18s, color .18s;
}
.hdr-nav a[aria-current="page"] { background: var(--green-100); color: var(--green-700) !important; }
.hdr-nav a:hover { background: var(--tint); }
.hdr-nav a > span:last-child { display: none; }   /* الشريط السفلي لم يعد مطلوباً */

/* ── الأزرار بشكل كبسولة كما في المرجعين ─────────────────────────────────── */
.btn { border-radius: var(--r-pill); padding: 12px 26px; font-weight: 700; }
.btn-ghost { border-radius: var(--r-pill); }

/* ── بطاقة رقم عائمة فوق صورة (مشتركة بين المرجعين) ──────────────────────── */
.stat-float {
  position: absolute;
  bottom: 18px;
  inset-inline-start: -16px;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--sh3);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 3;
}
.stat-float .big { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1; direction: ltr; unicode-bidi: isolate; }
.stat-float .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* =========================================================================
   طبقة الهوية الثالثة — «تعليم باستيل»
   خلفية تدرّج ناعم، أزرار كبسولة ليمونية بنص داكن، بطاقات بيضاء بزوايا كبيرة.
   تُطبَّق فوق النظام الأساسي بإعادة تعريف الرموز فقط، فتنتشر على كل الصفحات.
   ========================================================================= */
:root {
  --acc:    #D9E85F;   /* الليموني — تعبئة الأزرار */
  --acc-d:  #CBDC46;
  --acc-fg: #1B2610;   /* النص فوق الليموني */
  --acc-2:  #C6D6F2;   /* الأزرق الباستيلي الثانوي */

  --ink:  #1C2A22;
  --ink2: #43524A;
  --muted:#74837B;
  --line: #E6EBE6;
  --line2:#F1F4F0;
  --tint: #F4F7F1;
  --bg:   #F4F7F4;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --sh:  0 1px 2px rgba(28,42,34,.04);
  --sh2: 0 1px 3px rgba(28,42,34,.04), 0 12px 32px rgba(28,42,34,.055);
  --sh3: 0 20px 52px rgba(28,42,34,.12);
}

/* خلفية التدرّج الباستيلي الممتدّة خلف الصفحة كلها */
body {
  background:
    radial-gradient(120% 80% at 0% 0%,   #E6EDFA 0%, transparent 58%),
    radial-gradient(110% 75% at 100% 8%, #EEF5D9 0%, transparent 55%),
    radial-gradient(120% 90% at 50% 100%,#EAF4EC 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
/* الأزرار: كبسولة ليمونية بنص داكن */
.btn,
button.btn,
a.btn {
  background: var(--acc);
  color: var(--acc-fg);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-weight: 700;
  box-shadow: none;
}
.btn:hover { background: var(--acc-d); color: var(--acc-fg); }

.btn-ghost,
a.btn-ghost,
button.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.btn-ghost:hover { background: var(--tint); border-color: var(--muted); }

/* البطاقات: بيضاء، زوايا كبيرة، ظلّ خفيف جداً بلا حدود صارخة */
.card, .feature-card, .chip-card, .band-card, .quote-card, .float-card, .stat-float {
  border-radius: var(--r-lg);
  border: 1px solid var(--line2);
  box-shadow: var(--sh2);
}

/* الشارة الليمونية فوق الصور — كما في بطاقات المرجع */
.pill-label { background: var(--acc); color: var(--acc-fg); border: none; }
.pill-label::before { background: var(--acc-fg); }

/* الهيدر: زرّ البدء ليموني، والتبويب النشط كبسولة ليمونية باهتة */
.hdr-nav a[aria-current="page"] { background: #EDF3CF; color: var(--acc-fg) !important; }
.announce { background: #EDF3CF; border-bottom-color: #E1EAB6; }

/* شبكة المرجع: بطاقات بيضاء تتخلّلها بطاقات صورة كاملة */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.edu-card {
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh2);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 230px;
}
.edu-card.is-photo {
  padding: 0;
  overflow: hidden;
  position: relative;
  border: none;
}
.edu-card.is-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edu-card .foot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.edu-card .foot .btn { padding: 9px 18px; font-size: 13px; }

/* بطاقات المسار المرقّم بعد تحويلها إلى خلفية فاتحة */
.dark-card {
  background: var(--tint);
  border: 1px solid var(--line2);
  color: var(--ink);
  border-radius: var(--r-lg);
}
.dark-card h3 { color: var(--ink); }
.dark-card p  { color: var(--ink2); }
.dark-card .num { background: var(--acc); color: var(--acc-fg); }

/* الواجهة على الشاشات الصغيرة */
@media (max-width: 720px) {
  .hero-h1 { font-size: 34px !important; }
  .hero-art .float-card { display: none; }
}

/* تقوية التدرّج الباستيلي */
body {
  background:
    radial-gradient(90% 62% at 0% 0%,    #DDE7F8 0%, transparent 62%),
    radial-gradient(85% 58% at 100% 4%,  #E9F3C8 0%, transparent 60%),
    radial-gradient(100% 70% at 50% 96%, #E2F0E4 0%, transparent 64%),
    #F7FAF6;
  background-attachment: fixed;
}
/* الهيدر شفاف فوق التدرّج بدل الأبيض الصلب */
.hdr { background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid rgba(28,42,34,.06); }

/* =========================================================================
   مقاسات الكروت — مصدر واحد لكل الموقع
   الارتفاع والصورة يُضبطان من هنا فقط، فتتساوى كل الصفوف على كل الصفحات.
   ========================================================================= */
:root {
  --card-h: 476px;        /* ارتفاع كرت الدورة/الفعالية */
  --card-media: 176px;    /* ارتفاع صورة الكرت */
  --card-media-tall: 208px;
  --card-min: 288px;      /* أصغر عرض للعمود قبل النزول لسطر جديد */
}

.card-fixed {
  height: var(--card-h);
  border-radius: var(--r-lg);
  box-shadow: var(--sh2);
}
.card-media       { height: var(--card-media); }
.card-media-tall  { height: var(--card-media-tall); }

/* توحيد أعمدة كل الشبكات على نفس الحدّ الأدنى */
.grid-cards,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
  gap: 20px;
  align-items: stretch;
}
.grid-cards > *, .card-grid > * { min-width: 0; }

/* كرت الوظيفة: ارتفاع موحّد أيضاً حتى تستوي الصفوف */
.job-card { min-height: 212px; border-radius: var(--r-lg); }

@media (max-width: 1100px) { :root { --card-h: 470px; } }
@media (max-width: 720px) {
  :root { --card-h: 462px; --card-media: 168px; --card-media-tall: 196px; --card-min: 260px; }
}
@media (max-width: 460px) {
  :root { --card-h: auto; --card-min: 100%; }
  .card-fixed { height: auto; min-height: 380px; }
}

/* لا يُقصّ أي كرت: المحتوى يُوزَّع والزرّ يبقى ملتصقاً بالأسفل دائماً */
.card-fixed > div:last-child { min-height: 0; }
.card-fixed .price-row { flex-shrink: 0; }

/* صفّ التصنيفات: سطر واحد متمركز، كل شريحة بعرض محتواها */
.chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip-row .chip-card {
  flex: 0 0 auto; width: auto; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-pill);
}
.chip-row .chip-card > span:first-child { flex: 0 0 auto; }
@media (max-width: 560px) { .chip-row .chip-card { padding: 10px 16px; font-size: 13.5px; } }

/* =========================================================================
   شارة التقييم وزرّ المفضلة على الكروت
   ========================================================================= */
.card-rating {
  position: absolute;
  top: 16px;
  inset-inline-start: 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  box-shadow: var(--sh2);
  direction: ltr;
  unicode-bidi: isolate;
}
.card-rating > span { color: #E0A83C; font-size: 12.5px; line-height: 1; }
.card-rating > i    { font-style: normal; color: var(--muted); font-weight: 500; font-size: 11px; }

.card-fav {
  position: absolute;
  top: 62px;
  inset-inline-start: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--muted);
  box-shadow: var(--sh2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .18s, transform .18s;
  z-index: 2;
}
.card-fav svg { fill: none; }
.card-fav:hover { color: var(--danger); transform: scale(1.08); }
.card-fav[aria-pressed="true"] { color: var(--danger); }
.card-fav[aria-pressed="true"] svg { fill: currentColor; }
.card-fav[disabled] { opacity: .55; cursor: default; }

/* =========================================================================
   اختيار الدور في نموذج التسجيل — بطاقات لا أزرار راديو عارية
   ========================================================================= */
.role-picker {
  display: grid;
  /* ثلاثة أعمدة متساوية دائماً — auto-fit كان يعطي 2+1 مائلاً */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 560px) {
  .role-picker { grid-template-columns: 1fr; }
}
.role-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-height: 96px;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 12px;
  cursor: pointer;
  background: var(--card);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
@media (max-width: 560px) {
  .role-opt { min-height: 0; text-align: start; padding: 13px 15px; }
}
.role-opt:hover { border-color: var(--green-300); }
.role-opt input {
  /* مخفي بصرياً لكنه يبقى قابلاً للتركيز بلوحة المفاتيح وللقارئات الشاشية */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.role-opt:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--green) 26%, transparent);
}
.role-opt .role-name { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.role-opt .role-desc { font-size: 11.5px; color: var(--muted); line-height: 1.6; text-wrap: balance; }

.role-opt.is-on {
  border-color: var(--green);
  background: var(--soft);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--green) 14%, transparent);
}
.role-opt.is-on .role-name { color: var(--green-700); }

/* يعمل حتى قبل تحميل الـ JS */
.role-opt:has(input:checked) {
  border-color: var(--green);
  background: var(--soft);
}

.notice-pending {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--amber-s);
  border: 1px solid color-mix(in oklab, var(--amber) 24%, transparent);
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--amber);
}

/* تقييم داخل سطر النصّ (كروت المدرّبين) */
.rating-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  direction: ltr;
  unicode-bidi: isolate;
}
.rating-inline > span { color: #E0A83C; line-height: 1; }
.rating-inline > i    { font-style: normal; color: var(--muted); font-weight: 500; font-size: 11px; }

/* شارة التقييم أسفل صورة الدورة — بعيدة عن شارة النوع وزرّ المفضلة */
.card-rating.is-bottom {
  top: auto;
  bottom: 14px;
  inset-inline-start: 14px;
}

/* شبكة حقول الفاتورة */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
@media (max-width: 520px) { .field-grid { grid-template-columns: 1fr; } }

/* حاوية نموذج Stripe المدمج */
#stripe-mount { min-height: 320px; }


/* صفّ المدرّبين على الصفحة الرئيسية — خمس بطاقات ثابتة */
.teacher-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1160px) { .teacher-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
                             .teacher-row > *:nth-child(5) { display: none; } }
@media (max-width: 940px)  { .teacher-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
                             .teacher-row > *:nth-child(4) { display: none; } }
@media (max-width: 700px)  { .teacher-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
                             .teacher-row > *:nth-child(3) { display: none; } }
@media (max-width: 440px)  { .teacher-row { grid-template-columns: 1fr; }
                             .teacher-row > *:nth-child(2) { display: none; } }

/* تلميح أسفل الحقل */
.fld-hint { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 5px; }

/* رقم صغير في بطاقة جانبية */
.stat-mini {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line2);
  font-size: 13.5px;
}
.stat-mini:last-of-type { border-bottom: none; }
.stat-mini b { font-size: 16px; font-weight: 800; color: var(--ink); direction: ltr; unicode-bidi: isolate; }
.stat-mini span { color: var(--muted); }

/* =========================================================================
   شريط الفلاتر في لوحة الإدارة
   ========================================================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--sh);
}
.filter-bar .f-item { display: flex; flex-direction: column; gap: 5px; min-width: 148px; }
.filter-bar .f-grow { flex: 1 1 220px; min-width: 200px; }
.filter-bar .fld-label { margin: 0; font-size: 11.5px; color: var(--ink2); font-weight: 600; }
.filter-bar .fld { margin: 0; }
.filter-bar .f-actions { flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
.filter-bar .f-actions .btn { padding: 11px 20px; font-size: 13.5px; white-space: nowrap; }
@media (max-width: 620px) {
  .filter-bar { padding: 14px; }
  .filter-bar .f-item, .filter-bar .f-grow { flex: 1 1 100%; min-width: 0; }
  .filter-bar .f-actions { flex-wrap: wrap; }
}
