/* ================================
   المنصة التعليمية (دراسات + رياضيات)
   ملف CSS موحد لكل الصفحات
   ================================ */

:root {
  --brand: #b8862b; /* لون الدراسات (الذهبي/البني) */
  --brand-2: #0e4b6e; /* لون الرياضيات (الأزرق الداكن) */
  --brand-3: #1d7a5f;
  --bg: #f7f4ee;
  --bg-2: #ffffff;
  --text: #1b2230;
  --muted: #5d6675;
  --border: rgba(27, 34, 48, 0.12);
  --card-shadow: 0 18px 45px -25px rgba(14, 75, 110, 0.25);
  --radius: 18px;
  --nav-bg: rgba(255, 255, 255, 0.82);
  /* خلفية هيرو مدمجة للتعليم */
  --hero-overlay: linear-gradient(
    135deg,
    rgba(247, 244, 238, 0.94) 0%,
    rgba(247, 244, 238, 0.82) 100%
  );
}

[data-theme="dark"] {
  --brand: #e0b357;
  --brand-2: #64b5e6;
  --bg: #0b1120;
  --bg-2: #131c2e;
  --text: #eef2f8;
  --muted: #9fabbf;
  --border: rgba(238, 242, 248, 0.14);
  --card-shadow: 0 18px 45px -25px rgba(0, 0, 0, 0.9);
  --nav-bg: rgba(11, 17, 32, 0.85);
  --hero-overlay: linear-gradient(
    135deg,
    rgba(11, 17, 32, 0.95) 0%,
    rgba(11, 17, 32, 0.75) 100%
  );
}

* {
  scroll-behavior: smooth;
}

/* يوقف كل الـ transitions اثناء تحميل الصفحة */
.no-transition *,
.no-transition *::before,
.no-transition *::after {
  transition: none !important;
  animation-duration: 0.01ms !important;
}

body {
  font-family: "Cairo", "Tajawal", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition:
    background 0.35s ease,
    color 0.35s ease;
}
h1,
h2,
h3,
h4,
.display-title {
  font-weight: 800;
  letter-spacing: -0.3px;
}
a {
  text-decoration: none;
}
.text-muted-soft {
  color: var(--muted) !important;
}
.bg-surface {
  background: var(--bg-2) !important;
}
section {
  padding: 100px 0;
}

/* Utils */
.text-brand {
  color: var(--brand) !important;
}
.text-brand-2 {
  color: var(--brand-2) !important;
}

/* ============ Navbar ============ */
.site-nav {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition:
    padding 0.3s ease,
    box-shadow 0.3s ease;
  padding: 14px 0;
}
.site-nav.scrolled {
  padding: 6px 0;
  box-shadow: var(--card-shadow);
}
.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0; /* لا يتضغط أبداً */
  min-width: 46px; /* يضمن الحجم الأدنى */
}
.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.navbar-brand {
  color: var(--text) !important;
  font-weight: 800;
  min-width: 0; /* يسمح للـ flex item يتقلص */
  overflow: hidden;
}
.navbar-brand small {
  color: var(--muted);
  font-weight: 500;
  display: block;
  font-size: 0.72rem;
}
.site-nav .nav-link {
  color: var(--text) !important;
  font-weight: 600;
  margin-inline: 2px;
  padding: 8px 14px !important;
  border-radius: 999px;
  position: relative;
  transition: 0.25s;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  color: var(--brand-2) !important;
  background: color-mix(in oklab, var(--brand-2) 12%, transparent);
}
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: 0.3s;
}
.theme-toggle:hover {
  transform: rotate(25deg);
  border-color: var(--brand);
  color: var(--brand);
}

/* Buttons */
.btn-brand {
  background: linear-gradient(135deg, var(--brand), #d8a445);
  color: #16202e;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 9px 22px;
  transition: 0.3s;
}
.btn-brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px var(--brand);
  color: #16202e;
}
.btn-brand-2 {
  background: var(--brand-2);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 9px 22px;
  transition: 0.3s;
}
.btn-brand-2:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px var(--brand-2);
  color: #fff;
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  border-radius: 999px;
  padding: 9px 22px;
  background: transparent;
  transition: 0.3s;
}
.btn-ghost:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 160px 0 100px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  /* صورة تجمع بين الرياضيات والعلم بشكل عام */
  background-image:
    var(--hero-overlay),
    url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
}
.hero > .container {
  position: relative;
  z-index: 2;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: color-mix(in oklab, var(--brand) 22%, transparent);
  color: var(--text);
  border: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.3;
}
.hero .grad {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* تصميم صور المعلمين (الهيرو 3 أعمدة) */
.hero-instructor-img {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background-color: var(--bg-2);
  transition: transform 0.3s ease;
}
.hero-instructor-img:hover {
  transform: translateY(-10px);
}
.hero-instructor-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.border-brand {
  border: 4px solid var(--brand);
}
.border-brand-2 {
  border: 4px solid var(--brand-2);
}
.instructor-name-tag {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stat-pill {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.stat-pill .num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}
.stat-pill .lbl {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============ Sections Utilities ============ */
.section-head {
  max-width: 620px;
  margin: 0 auto 46px;
  text-align: center;
}
.section-tag {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============ Feature cards ============ */
.feature-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  height: 100%;
  transition: 0.35s;
  position: relative;
  overflow: hidden;
}
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow);
  border-color: var(--brand);
}
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
  background: color-mix(in oklab, var(--brand-2) 15%, transparent);
  color: var(--brand-2);
}
.feature-card p {
  color: var(--muted);
  margin: 0;
}

/* ============ Video ============ */
.video-wrap {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  aspect-ratio: 16/9;
  background: #000;
}
.video-wrap iframe,
.video-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-poster {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}
.play-btn {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #16202e;
  font-size: 1.6rem;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 60%, transparent);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 60%, transparent);
  }
  70% {
    box-shadow: 0 0 0 26px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ============ Pro Filter Panel ============ */
.pro-filter-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 30px;
  box-shadow: var(--card-shadow);
}
.pro-filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 24px;
  border-radius: 999px;
  font-weight: 700;
  transition: 0.3s;
  outline: none;
}
.pro-filter-btn:hover {
  border-color: var(--brand);
}
.pro-filter-btn.active {
  background: var(--brand);
  color: #16202e;
  border-color: var(--brand);
  box-shadow: 0 8px 16px -6px var(--brand);
}
.pro-filter-btn.subject-math.active {
  background: var(--brand-2);
  color: #fff;
  border-color: var(--brand-2);
  box-shadow: 0 8px 16px -6px var(--brand-2);
}

.pro-select-wrapper {
  position: relative;
}
.pro-select {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 20px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition: 0.3s;
}
.pro-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 15%, transparent);
  outline: none;
}
.select-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ============ Courses ============ */
.course-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: 0.35s;
}
.course-card.card-math {
  border-color: color-mix(in oklab, var(--brand-2) 30%, transparent);
}
.course-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow);
}
.course-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: 0.5s;
}
.course-card:hover .course-thumb img {
  transform: scale(1.08);
}

.course-tag {
  position: absolute;
  inset-inline-start: 12px;
  top: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: 999px;
}
.tag-social {
  background: var(--brand);
  color: #16202e;
}
.tag-math {
  background: var(--brand-2);
}

.course-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.course-meta {
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.course-price {
  font-weight: 800;
  font-size: 1.2rem;
}

.course-item {
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}
.course-item.hide-course {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  position: absolute;
}

/* أزرار الكورس — صف الأكشن */
.course-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
}
.course-actions .course-price {
  margin-inline-end: auto;
}
.btn-details {
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 700;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.82rem;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: 0.25s;
  white-space: nowrap;
}
.btn-details:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
  background: color-mix(in oklab, var(--brand-2) 8%, transparent);
}
.card-math .btn-details:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
}

/* ============ Testimonials ============ */
.testi-stage {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  min-height: 300px;
}
.testi-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 40px 34px;
  text-align: center;
  box-shadow: var(--card-shadow);
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(60px) scale(0.96);
  transition: 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
  pointer-events: none;
}
.testi-box.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  position: relative;
}
.testi-box.leave-left {
  opacity: 0;
  transform: translateX(-60px) scale(0.96);
}
.testi-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--brand);
  margin-bottom: 14px;
}
.testi-quote {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 2;
}
.testi-stars {
  color: var(--brand);
  letter-spacing: 3px;
}
.testi-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.testi-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  transition: 0.3s;
}
.testi-dots button.active {
  width: 30px;
  border-radius: 999px;
  background: var(--brand);
}
.testi-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  transition: 0.25s;
}
.testi-nav:hover {
  background: var(--brand-2);
  color: #fff;
}

/* ============ Contact ============ */
.contact-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--card-shadow);
}
.form-control,
.form-select {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 16px;
}
.form-control:focus,
.form-select:focus {
  background: transparent;
  color: var(--text);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 18%, transparent);
}
.form-control::placeholder {
  color: var(--muted);
}
.info-line {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.info-line i {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--brand) 18%, transparent);
  color: var(--brand);
}

/* ============ Footer ============ */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 56px 0 24px;
}
.site-footer a {
  color: var(--muted);
  display: block;
  padding: 5px 0;
  transition: 0.2s;
}
.site-footer a:hover {
  color: var(--brand);
}
.social-ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  color: var(--text);
  transition: 0.3s;
}
.social-ic:hover {
  background: var(--brand);
  color: #16202e;
  border-color: var(--brand);
}

/* ============ Float Buttons & Progress ============ */
.float-btn {
  position: fixed;
  bottom: 26px;
  z-index: 1050;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.5);
  transition: 0.3s;
}
.to-top {
  inset-inline-end: 26px;
  background: var(--brand-2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}
.to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.whatsapp-btn {
  inset-inline-start: 26px;
  background: #25d366;
}
.float-btn:hover {
  transform: translateY(-5px) scale(1.06);
}
.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 2000;
}

/* ============================================================
   القمة - تحديثات الهيرو والعناصر الجديدة
   ============================================================ */

/* ---- Hero XL ---- */
.hero.hero-xl {
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* --- خلفية الهيرو الجديدة --- */
.hero.hero-xl::before {
  background-image:
    var(--hero-overlay),
    url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
}

/* --- الأشكال الهندسية --- */
.hero-geo-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.geo-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}
.geo-1 {
  width: 500px;
  height: 500px;
  background: var(--brand);
  top: -120px;
  right: -100px;
  animation: geoFloat 8s ease-in-out infinite;
}
.geo-2 {
  width: 400px;
  height: 400px;
  background: var(--brand-2);
  bottom: -80px;
  left: -80px;
  animation: geoFloat 10s ease-in-out infinite reverse;
}
.geo-3 {
  width: 250px;
  height: 250px;
  background: var(--brand-3);
  top: 40%;
  left: 45%;
  animation: geoFloat 12s ease-in-out infinite;
}
@keyframes geoFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(20px, -30px) scale(1.06);
  }
}
[data-theme="dark"] .geo-1,
[data-theme="dark"] .geo-2,
[data-theme="dark"] .geo-3 {
  opacity: 0.12;
}

/* زخرفة الرياضيات */
.hero-math-deco {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  color: var(--text);
}

/* =====================================================
   HERO FULLGRID — صور المدرسين بشكل مقطوع عصري
   ===================================================== */

/* الشبكة الرئيسية للهيرو */
.hero-fullgrid {
  display: grid;
  grid-template-columns: 380px 1fr 380px;
  min-height: 85vh;
  position: relative;
  z-index: 2;
  align-items: center;
  padding: 100px 0 60px;
  gap: 0;
}

/* --- حاوية الصورة — تحكم في الشكل الخارجي --- */
.hero-side {
  position: relative;
  display: flex;
  align-items: flex-end;
  /* الارتفاع الفعلي للصورة */
  height: 72vh;
  max-height: 620px;
  min-height: 400px;
}

/* الصورة اليمنى (دراسات): مائلة للداخل من الطرف الداخلي */
.hero-side--right {
  /* قطع بزاوية من الجانب الداخلي (اليسار بالنسبة لـ RTL) */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12% 100%);
  border-radius: 24px 0 0 24px;
  box-shadow:
    8px 0 40px -8px rgba(184, 134, 43, 0.25),
    inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

/* الصورة اليسرى (رياضيات): مائلة للداخل من الطرف الداخلي */
.hero-side--left {
  clip-path: polygon(0 0, 88% 0, 100% 100%, 0 100%);
  border-radius: 0 24px 24px 0;
  box-shadow:
    -8px 0 40px -8px rgba(14, 75, 110, 0.25),
    inset 1px 0 0 rgba(255, 255, 255, 0.08);
}

/* الصورة نفسها */
.hside-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  position: absolute;
  inset: 0;
  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.hero-side:hover .hside-img {
  transform: scale(1.05);
}

/* تدرج لوني فوق الصورة — فقط في أسفل الصورة لقراءة بيانات المدرس */
.hside-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hside-overlay--social,
.hside-overlay--math {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.1) 30%,
    transparent 48%
  );
}
[data-theme="dark"] .hside-overlay--social,
[data-theme="dark"] .hside-overlay--math {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.12) 32%,
    transparent 50%
  );
}

/* بطاقة بيانات المدرس في أسفل الصورة */
.hside-info {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 22px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hside-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.hside-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}
.hside-rating {
  color: #ffd700;
}
.hside-rating--math {
  color: #a8d8f0;
}

/* Tags فوق اسم المدرس */
.inst-subject-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 4px;
  width: fit-content;
  backdrop-filter: blur(8px);
}
.tag-social {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.tag-math-inst {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

/* --- العمود المركزي (النص) --- */
.hero-center-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 44px;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  margin-bottom: 18px;
}
.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  background: color-mix(in oklab, var(--brand) 14%, transparent);
  color: var(--brand);
  border: 1px solid color-mix(in oklab, var(--brand) 30%, transparent);
  animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--brand) 40%, transparent);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

.hero-headline {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.hero-platform-name {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.2em;
}
.hero-sub-headline {
  font-size: 0.7em;
  font-weight: 700;
  color: var(--text);
}
.hero-sub-headline em {
  font-style: normal;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.85;
  max-width: 480px;
  margin: 16px auto 0;
}

/* أزرار الهيرو */
.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.btn-hero-primary {
  background: linear-gradient(135deg, var(--brand), #d8a445);
  color: #16202e;
  font-weight: 800;
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
  box-shadow: 0 8px 28px -8px var(--brand);
}
.btn-hero-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -10px var(--brand);
  color: #16202e;
}
.btn-hero-ghost {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: 0.3s;
  backdrop-filter: blur(6px);
}
.btn-hero-ghost:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
  box-shadow: 0 8px 20px -8px var(--brand-2);
}
.play-icon-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-2);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

/* إحصائيات الهيرو */
.hero-stats-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 32px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 28px;
  box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}
.hstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}
.hstat-num {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}
.hstat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}
.hstat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

/* موجة الهيرو */
.hero-wave {
  position: relative;
  z-index: 2;
  margin-top: auto;
  line-height: 0;
}
.hero-wave svg {
  display: block;
  width: 100%;
  height: 90px;
}

/* ---- Responsive Hero Fullgrid ---- */
@media (max-width: 1280px) {
  .hero-fullgrid {
    grid-template-columns: 310px 1fr 310px;
  }
}
@media (max-width: 1024px) {
  .hero-fullgrid {
    grid-template-columns: 240px 1fr 240px;
  }
  .hero-center-col {
    padding: 20px 28px;
  }
  .hero-side {
    height: 62vh;
    max-height: 520px;
  }
  .hside-name {
    font-size: 1rem;
  }
}
@media (max-width: 768px) {
  .hero-fullgrid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    padding: 80px 0 0;
    min-height: auto;
  }
  /* النص فوق الصورتين */
  .hero-center-col {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 16px 20px 28px;
  }
  /* الصورتان جنباً لجنب في الأسفل */
  .hero-side--right {
    grid-column: 1;
    grid-row: 2;
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
    border-radius: 0;
    height: 280px;
    max-height: 280px;
  }
  .hero-side--left {
    grid-column: 2;
    grid-row: 2;
    clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
    border-radius: 0;
    height: 280px;
    max-height: 280px;
  }
  .hside-img {
    object-position: center 15%;
  }
  .hside-info {
    padding: 16px 14px 20px;
  }
  .hside-name {
    font-size: 0.92rem;
  }
}
@media (max-width: 480px) {
  .hero-side--right,
  .hero-side--left {
    height: 220px;
    max-height: 220px;
  }
  .hero-stats-strip {
    padding: 14px 10px;
  }
  .hstat {
    padding: 0 10px;
  }
  .hstat-num {
    font-size: 1.3rem;
  }
  .hstat-lbl {
    font-size: 0.68rem;
  }
  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-hero-primary,
  .btn-hero-ghost {
    justify-content: center;
  }
  .hside-name {
    font-size: 0.82rem;
  }
  .inst-subject-tag {
    font-size: 0.68rem;
  }
}

/* ---- Feature Cards Upgrade ---- */
.feature-card--accent-1 {
  border-top: 3px solid var(--brand);
}
.feature-card--accent-2 {
  border-top: 3px solid var(--brand-2);
}
.feature-icon--math {
  background: color-mix(in oklab, var(--brand-2) 15%, transparent) !important;
  color: var(--brand-2) !important;
}
.feature-badge-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--brand) 12%, transparent);
  color: var(--brand);
  margin-top: 12px;
  border: 1px solid color-mix(in oklab, var(--brand) 25%, transparent);
}
.feature-badge-tag--math {
  background: color-mix(in oklab, var(--brand-2) 12%, transparent);
  color: var(--brand-2);
  border-color: color-mix(in oklab, var(--brand-2) 25%, transparent);
}

/* ---- Dual Subject Banner ---- */
.dual-subject-banner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.dsb-col {
  padding: 36px 32px;
}
.dsb-social {
  border-left: none;
  background: color-mix(in oklab, var(--brand) 5%, var(--bg-2));
}
.dsb-math {
  background: color-mix(in oklab, var(--brand-2) 5%, var(--bg-2));
  border-right: none;
}
.dsb-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--brand) 15%, transparent);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 12px;
}
.dsb-icon--math {
  background: color-mix(in oklab, var(--brand-2) 15%, transparent);
  color: var(--brand-2);
}
.dsb-col h5 {
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}
.dsb-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dsb-col ul li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}
.dsb-social ul li i {
  color: var(--brand);
}
.dsb-math ul li i {
  color: var(--brand-2);
}
.dsb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 28px;
  gap: 12px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  border-right: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.dsb-logo-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px -6px var(--brand-2);
}
@media (max-width: 768px) {
  .dual-subject-banner {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .dsb-center {
    border: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    flex-direction: row;
    justify-content: center;
    gap: 14px;
  }
  .dsb-col {
    padding: 24px 20px;
  }
}

/* ---- Testimonials upgrade: min-height fix ---- */
.testi-stage {
  min-height: 320px;
}

/* ================================================================
   REDESIGN V2 — نافبار وهيرو جديد بالكامل
   ================================================================ */

/* ---- إعادة تعريف متغيرات جديدة ---- */
:root {
  --nav-split-left: rgba(184, 134, 43, 0.08);
  --nav-split-right: rgba(14, 75, 110, 0.08);
  --hero-dark: #08101e;
  --exam-line: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] {
  --nav-split-left: rgba(224, 179, 87, 0.1);
  --nav-split-right: rgba(100, 181, 230, 0.1);
}

/* ================================================================
   NAVBAR V2 — شريط مزدوج الهوية
   ================================================================ */

/* إخفاء الـ navbar القديم تماماً وإعادة بنائه */
.site-nav {
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}

/* الحاوية الداخلية الجديدة للنافبار */
.site-nav > .container {
  position: relative;
}

/* خلفية النافبار المزدوجة */
.site-nav::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to left, rgba(14, 75, 110, 0.07) 0%, transparent 50%),
    linear-gradient(to right, rgba(184, 134, 43, 0.07) 0%, transparent 50%),
    var(--bg-2);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: -1;
  transition: box-shadow 0.3s ease;
}
.site-nav.scrolled::after {
  box-shadow: 0 4px 32px -8px rgba(0, 0, 0, 0.18);
}

/* الـ padding الصحيح */
.site-nav .container {
  padding-top: 10px;
  padding-bottom: 10px;
}
.site-nav.scrolled .container {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* شعار جديد — مزدوج اللون مع فاصل */
.navbar-brand {
  gap: 0 !important;
  color: var(--text) !important;
}

.brand-badge {
  background: linear-gradient(
    135deg,
    var(--brand) 0%,
    #d8a445 49%,
    var(--brand-2) 51%,
    #1a6b98 100%
  ) !important;
  box-shadow:
    0 4px 16px -4px rgba(184, 134, 43, 0.4),
    0 4px 16px -4px rgba(14, 75, 110, 0.3);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-width: 46px;
}
.brand-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
}

.navbar-brand-text {
  display: flex;
  flex-direction: column;
  margin-right: 10px;
}
.brand-title-split {
  font-size: 1.05rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0;
  line-height: 1;
}
.brand-social-part {
  color: var(--brand);
}
.brand-sep {
  color: var(--border);
  font-weight: 300;
  margin: 0 5px;
}
.brand-math-part {
  color: var(--brand-2);
}
.brand-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Nav links — pill style جديد */
.site-nav .nav-link {
  font-size: 0.9rem !important;
  padding: 7px 16px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

/* لون active مختلف بحسب الموضع في القائمة */
.site-nav .nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.25s;
}
.site-nav .nav-link:hover::before,
.site-nav .nav-link.active::before {
  opacity: 1;
}
/* الرابط الأول والثالث والخامس — لون الدراسات */
.site-nav .nav-item:nth-child(odd) .nav-link::before {
  background: color-mix(in oklab, var(--brand) 14%, transparent);
}
.site-nav .nav-item:nth-child(odd) .nav-link:hover,
.site-nav .nav-item:nth-child(odd) .nav-link.active {
  color: var(--brand) !important;
}
/* الرابط الثاني والرابع والسادس — لون الرياضيات */
.site-nav .nav-item:nth-child(even) .nav-link::before {
  background: color-mix(in oklab, var(--brand-2) 14%, transparent);
}
.site-nav .nav-item:nth-child(even) .nav-link:hover,
.site-nav .nav-item:nth-child(even) .nav-link.active {
  color: var(--brand-2) !important;
}
/* تأكد أن الخلفية من ::before تظهر */
.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  background: transparent !important;
}

/* خط تحتي للـ active */
.site-nav .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}

/* فاصل بصري بين الروابط والأزرار */
.site-nav .navbar-nav {
  position: relative;
}
.site-nav .navbar-nav::before,
.site-nav .navbar-nav::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  width: 1px;
  background: var(--border);
}
.site-nav .navbar-nav::before {
  right: -16px;
}
.site-nav .navbar-nav::after {
  left: -16px;
}

/* زر الوضع الليلي الجديد */
.theme-toggle {
  background: color-mix(in oklab, var(--brand) 8%, transparent) !important;
  border-color: color-mix(in oklab, var(--brand) 25%, transparent) !important;
}
[data-theme="dark"] .theme-toggle {
  background: color-mix(in oklab, var(--brand-2) 12%, transparent) !important;
  border-color: color-mix(in oklab, var(--brand-2) 30%, transparent) !important;
}

/* ================================================================
   HERO V2 — قسم الامتحان المزدوج
   ================================================================ */

/* إعادة بناء الهيرو من الصفر */
.hero.hero-xl {
  min-height: 100vh;
  padding: 0;
  background: none;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

/* طبقة الخلفية — فاتحة في الوضع الفاتح */
.hero.hero-xl::before {
  background-image:
    linear-gradient(
      160deg,
      rgba(247, 244, 238, 0.96) 0%,
      rgba(247, 244, 238, 0.92) 100%
    ),
    url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
}
[data-theme="dark"] .hero.hero-xl::before {
  background-image:
    linear-gradient(
      160deg,
      rgba(8, 16, 30, 0.97) 0%,
      rgba(8, 16, 30, 0.93) 100%
    ),
    url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=1600&q=80");
}

/* الأشكال الهندسية المحسّنة — فقط في الجانبين */
.geo-1 {
  top: -150px;
  right: -80px;
  opacity: 0.22 !important;
  animation-duration: 9s !important;
}
.geo-2 {
  bottom: -100px;
  left: -80px;
  opacity: 0.18 !important;
}
.geo-3 {
  width: 180px;
  height: 180px;
  top: 55%;
  left: 48%;
  opacity: 0.08 !important;
}

/* خط الفصل الوسطي — شعار بصري للمنصة المزدوجة */
.hero-divider-line {
  position: absolute;
  top: 80px;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(27, 34, 48, 0.12) 25%,
    rgba(27, 34, 48, 0.18) 50%,
    rgba(27, 34, 48, 0.12) 75%,
    transparent
  );
  z-index: 2;
  pointer-events: none;
}
[data-theme="dark"] .hero-divider-line {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.1) 75%,
    transparent
  );
}
.hero-divider-line::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow:
    0 0 0 4px color-mix(in oklab, var(--brand) 20%, transparent),
    0 0 0 8px color-mix(in oklab, var(--brand-2) 10%, transparent);
}

/* إعادة بناء شبكة الهيرو الكاملة */
.hero-fullgrid {
  display: grid;
  grid-template-columns: 1fr 520px 1fr;
  min-height: 90vh;
  position: relative;
  z-index: 2;
  align-items: center;
  padding: 110px 0 40px;
  gap: 0;
}

/* صور المدرسين — تصميم جديد كلياً */
.hero-side {
  height: 80vh;
  max-height: 700px;
  min-height: 420px;
  position: relative;
}

/* الصورة اليمنى (دراسات) — بدون clip-path، بدلاً منه تدرج جانبي */
.hero-side--right {
  clip-path: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.hero-side--left {
  clip-path: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* الصور نفسها — بدون تأثير hover */
.hside-img {
  object-fit: cover;
  object-position: top center;
  filter: none;
  transition: none !important;
}
.hero-side:hover .hside-img {
  filter: none;
  transform: none !important;
}

/* تدرج الصورة اليمنى (دراسات) — وضع فاتح بدون تأثير تبييض من المنتصف */
.hero-side--right .hside-overlay--social {
  background:
    linear-gradient(
      to top,
      rgba(184, 134, 43, 0.88) 0%,
      rgba(184, 134, 43, 0.18) 42%,
      transparent 62%
    ),
    linear-gradient(
      to left,
      transparent 0%,
      rgba(247, 244, 238, 0.18) 65%,
      rgba(247, 244, 238, 0.38) 100%
    ) !important;
}

/* تدرج الصورة اليسرى (رياضيات) — وضع فاتح بدون تأثير تبييض من المنتصف */
.hside-overlay--math {
  background:
    linear-gradient(
      to top,
      rgba(14, 75, 110, 0.88) 0%,
      rgba(14, 75, 110, 0.18) 42%,
      transparent 62%
    ),
    linear-gradient(
      to right,
      transparent 0%,
      rgba(247, 244, 238, 0.18) 65%,
      rgba(247, 244, 238, 0.38) 100%
    ) !important;
}

/* dark mode — نرجع للتدرج الداكن */
[data-theme="dark"] .hero-side--right .hside-overlay--social {
  background:
    linear-gradient(
      to top,
      rgba(184, 134, 43, 0.88) 0%,
      rgba(184, 134, 43, 0.2) 35%,
      transparent 60%
    ),
    linear-gradient(
      to left,
      transparent 0%,
      rgba(8, 16, 30, 0.6) 75%,
      rgba(8, 16, 30, 0.95) 100%
    ) !important;
}
[data-theme="dark"] .hside-overlay--math {
  background:
    linear-gradient(
      to top,
      rgba(14, 75, 110, 0.88) 0%,
      rgba(14, 75, 110, 0.2) 35%,
      transparent 60%
    ),
    linear-gradient(
      to right,
      transparent 0%,
      rgba(8, 16, 30, 0.6) 75%,
      rgba(8, 16, 30, 0.95) 100%
    ) !important;
}

/* بطاقة المدرس — عصرية وبيضاء */
.hside-info {
  padding: 24px 28px 32px !important;
}
.hside-name {
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.3px;
  margin-bottom: 6px !important;
}

/* تاج رقمي فوق كل صورة */
.hero-side-rank {
  position: absolute;
  top: 28px;
  z-index: 3;
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
  opacity: 0.08;
  color: #000;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .hero-side-rank {
  color: #fff;
  opacity: 0.06;
}
.hero-side--right .hero-side-rank {
  right: 24px;
}
.hero-side--left .hero-side-rank {
  left: 24px;
}

/* شريط رفيع ملون في أعلى كل صورة */
.hero-side--right::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--brand), transparent);
  z-index: 4;
}
.hero-side--left::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to left, var(--brand-2), transparent);
  z-index: 4;
}

/* العمود المركزي الجديد */
.hero-center-col {
  padding: 20px 40px !important;
  position: relative;
}

/* عنوان الهيرو — يتبع الثيم */
.hero-headline {
  color: var(--text) !important;
  font-size: clamp(2.6rem, 4vw, 4rem) !important;
}
.hero-platform-name {
  font-size: 1.15em !important;
}
.hero-sub-headline {
  color: var(--text) !important;
}
.hero-desc {
  color: var(--muted) !important;
}

/* badge — يتبع الثيم */
.pulse-badge {
  background: color-mix(in oklab, var(--brand) 14%, transparent) !important;
  color: var(--brand) !important;
  border-color: color-mix(in oklab, var(--brand) 30%, transparent) !important;
}

/* شريط الإحصائيات — يتبع الثيم */
.hero-stats-strip {
  background: var(--bg-2) !important;
  border-color: var(--border) !important;
  backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow) !important;
}
.hstat-lbl {
  color: var(--muted) !important;
}
.hstat-divider {
  background: var(--border) !important;
}

/* زر الهيرو الثاني — يتبع الثيم */
.btn-hero-ghost {
  background: var(--bg-2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  backdrop-filter: blur(8px);
}
.btn-hero-ghost:hover {
  background: color-mix(in oklab, var(--brand-2) 10%, var(--bg-2)) !important;
  border-color: var(--brand-2) !important;
  color: var(--brand-2) !important;
}

/* dark mode overrides للهيرو */
[data-theme="dark"] .hero-headline {
  color: #fff !important;
}
[data-theme="dark"] .hero-sub-headline {
  color: rgba(255, 255, 255, 0.85) !important;
}
[data-theme="dark"] .hero-desc {
  color: rgba(255, 255, 255, 0.65) !important;
}
[data-theme="dark"] .pulse-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-theme="dark"] .hero-stats-strip {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .hstat-lbl {
  color: rgba(255, 255, 255, 0.55) !important;
}
[data-theme="dark"] .hstat-divider {
  background: rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .btn-hero-ghost {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}
[data-theme="dark"] .btn-hero-ghost:hover {
  background: rgba(14, 75, 110, 0.3) !important;
  border-color: var(--brand-2) !important;
  color: #fff !important;
}

/* موجة الهيرو — محسّنة */
.hero-wave svg path {
  fill: var(--bg) !important;
}

/* ---- عنصر الرياضيات الزخرفي — مُحسَّن ---- */
.hero-math-deco {
  opacity: 0.9;
  mix-blend-mode: overlay;
}
.hero-math-deco text {
  font-family: "Georgia", serif;
  opacity: 1;
}

/* ---- نقطة ضوء خلف العنوان — فاتحة في light mode ---- */
.hero-center-col::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(184, 134, 43, 0.1) 0%,
    rgba(14, 75, 110, 0.06) 50%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

/* ---- Responsive V2 ---- */
@media (max-width: 1280px) {
  .hero-fullgrid {
    grid-template-columns: 1fr 460px 1fr;
  }
}

@media (max-width: 1024px) {
  .hero-fullgrid {
    grid-template-columns: 1fr 380px 1fr;
  }
  .hero-center-col {
    padding: 20px 24px !important;
  }
  .hero-divider-line {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-fullgrid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    padding: 90px 0 0;
    min-height: auto;
  }
  .hero-center-col {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .hero-side--right {
    grid-column: 1;
    grid-row: 2;
    height: 260px;
    max-height: 260px;
  }
  .hero-side--left {
    grid-column: 2;
    grid-row: 2;
    height: 260px;
    max-height: 260px;
  }
  .hero-side--right .hside-overlay--social {
    background:
      linear-gradient(to top, rgba(184, 134, 43, 0.88) 0%, transparent 55%),
      linear-gradient(to left, transparent 0%, rgba(247, 244, 238, 0.12) 100%) !important;
  }
  .hside-overlay--math {
    background:
      linear-gradient(to top, rgba(14, 75, 110, 0.88) 0%, transparent 55%),
      linear-gradient(to right, transparent 0%, rgba(247, 244, 238, 0.12) 100%) !important;
  }
  [data-theme="dark"] .hero-side--right .hside-overlay--social {
    background:
      linear-gradient(to top, rgba(184, 134, 43, 0.88) 0%, transparent 55%),
      linear-gradient(to left, transparent 0%, rgba(8, 16, 30, 0.4) 100%) !important;
  }
  [data-theme="dark"] .hside-overlay--math {
    background:
      linear-gradient(to top, rgba(14, 75, 110, 0.88) 0%, transparent 55%),
      linear-gradient(to right, transparent 0%, rgba(8, 16, 30, 0.4) 100%) !important;
  }
  .hero-side-rank {
    display: none;
  }
  .hero-side--right::after,
  .hero-side--left::after {
    height: 3px;
  }
}

@media (max-width: 480px) {
  .hero-side--right,
  .hero-side--left {
    height: 210px;
    max-height: 210px;
  }
  .hero-stats-strip {
    padding: 14px 10px !important;
  }
  .hstat {
    padding: 0 12px !important;
  }
  .hstat-num {
    font-size: 1.35rem !important;
  }
  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-hero-primary,
  .btn-hero-ghost {
    justify-content: center;
  }
}

/* ---- مؤشر الرقم اللحظي في أعلى كل صورة (عداد متحرك صغير) ---- */
.hside-live-badge {
  position: absolute;
  top: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.hero-side--right .hside-live-badge {
  left: 16px;
  border-color: rgba(184, 134, 43, 0.4);
}
.hero-side--left .hside-live-badge {
  right: 16px;
  border-color: rgba(14, 75, 110, 0.4);
}
.hside-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: livePulse 1.8s ease-in-out infinite;
}
.hero-side--right .hside-live-dot {
  background: var(--brand);
}
.hero-side--left .hside-live-dot {
  background: #64b5e6;
}
@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.6);
  }
}

/* ================================================================
   GALLERY PAGE — ألبوم الصور
   ================================================================ */

/* ---- Page Hero (header الصفحات الداخلية) ---- */
.page-hero {
  padding: 140px 0 60px;
  background: linear-gradient(
    to bottom,
    color-mix(in oklab, var(--brand) 6%, var(--bg)) 0%,
    var(--bg) 100%
  );
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 60% 80% at 80% 50%,
      color-mix(in oklab, var(--brand) 8%, transparent) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 50% 70% at 20% 60%,
      color-mix(in oklab, var(--brand-2) 6%, transparent) 0%,
      transparent 70%
    );
  pointer-events: none;
}
.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  margin: 10px 0 12px;
  color: var(--text);
}
.page-hero .breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
}
.page-hero .breadcrumb-item a {
  color: var(--brand);
  font-weight: 600;
}
.page-hero .breadcrumb-item.active {
  color: var(--muted);
}
.page-hero .breadcrumb-item + .breadcrumb-item::before {
  color: var(--muted);
  content: "‹";
}

/* ---- شريط الفلاتر ---- */
.filter-chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.25s;
  outline: none;
}
.filter-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.filter-chip.active {
  background: linear-gradient(135deg, var(--brand), #d8a445);
  color: #16202e;
  border-color: transparent;
  box-shadow: 0 6px 18px -6px var(--brand);
}

/* ---- شبكة الصور ---- */
.gallery-cell {
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}
.gallery-cell.hide-cell {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  position: absolute !important;
  display: none !important;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: block;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.gallery-item:hover img {
  transform: scale(1.07);
}

/* الكابشن */
.gallery-cap {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 36px 18px 18px;
  background: linear-gradient(
    to top,
    rgba(8, 16, 30, 0.82) 0%,
    transparent 100%
  );
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  transform: translateY(6px);
  opacity: 0;
  transition: 0.35s;
}
.gallery-item:hover .gallery-cap {
  transform: translateY(0);
  opacity: 1;
}

/* أيقونة تكبير */
.gallery-item::after {
  content: "\F52A"; /* bi-zoom-in */
  font-family: "bootstrap-icons";
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  opacity: 0;
  transform: scale(0.7);
  transition: 0.3s;
}
.gallery-item:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 10, 20, 0.94);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
#lbImg {
  max-width: 90vw;
  max-height: 84vh;
  border-radius: 16px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8);
  object-fit: contain;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1),
    opacity 0.25s;
  display: block;
}
.lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.25s;
  backdrop-filter: blur(8px);
}
.lb-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}
.lb-close {
  top: 20px;
  left: 20px;
}
.lb-prev {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-prev:hover {
  transform: translateY(-50%) scale(1.08);
}
.lb-next {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}
.lb-next:hover {
  transform: translateY(-50%) scale(1.08);
}

/* عداد الصورة */
.lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px 14px;
  border-radius: 999px;
}

/* ---- تصميم الـ gallery section ---- */
#galleryGrid .row,
section #galleryGrid {
  position: relative;
}

/* ================================================================
   COURSE DETAILS PAGE
   ================================================================ */

/* ---- page-hero: meta row ---- */
.page-hero .course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.page-hero .course-meta i {
  margin-left: 5px;
  color: var(--brand);
}
.tag-social-cd {
  color: var(--brand) !important;
}
.tag-math-cd {
  color: var(--brand-2) !important;
}

/* ---- step badge ---- */
.step-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #d8a445);
  color: #16202e;
  font-weight: 900;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* ---- بطاقات طرق الدفع ---- */
.pay-method {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: 0.25s;
  height: 100%;
  user-select: none;
}
.pay-method:hover {
  border-color: var(--brand);
  background: color-mix(in oklab, var(--brand) 5%, var(--bg));
}
.pay-method.active {
  border-color: var(--brand);
  background: color-mix(in oklab, var(--brand) 10%, var(--bg-2));
  box-shadow: 0 6px 20px -8px var(--brand);
}
.pay-method.active .pm-icon {
  background: linear-gradient(135deg, var(--brand), #d8a445);
  color: #16202e;
}
.pm-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--brand) 12%, transparent);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin: 0 auto;
  transition: 0.25s;
}

/* ---- رقم الدفع مع زر النسخ ---- */
.pay-number {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 1.1rem;
  direction: ltr;
  letter-spacing: 0.5px;
}
.pay-number span {
  flex: 1;
  word-break: break-all;
}

/* ---- بطاقة ملخص الطلب ---- */
.summary-card {
  position: sticky;
  top: 88px;
}
.summary-card ul li {
  font-size: 0.88rem;
}

/* ---- file input ---- */
input[type="file"].form-control {
  padding: 10px 14px;
}
input[type="file"].form-control::-webkit-file-upload-button {
  background: linear-gradient(135deg, var(--brand), #d8a445);
  color: #16202e;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  margin-left: 10px;
  transition: 0.2s;
}
input[type="file"].form-control::file-selector-button {
  background: linear-gradient(135deg, var(--brand), #d8a445);
  color: #16202e;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-family: "Cairo", sans-serif;
  cursor: pointer;
  margin-left: 10px;
  transition: 0.2s;
}

/* ---- form checkbox ---- */
.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}
.form-check-input:focus {
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 18%, transparent);
  border-color: var(--brand);
}

/* ---- was-validated ---- */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: #dc3545;
}
.was-validated .form-control:valid,
.was-validated .form-select:valid {
  border-color: var(--brand-3);
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .summary-card {
    position: static;
    margin-top: 0;
  }
}

/* ================================================================
   IMPROVEMENTS PATCH v2 — نظيف ومصحح
   ================================================================ */

/* ---- 1. تقليل الـ gaps بين السكاشن ---- */
section {
  padding: 72px 0 !important;
}
#features {
  padding: 64px 0 !important;
}
#promo {
  padding: 64px 0 !important;
}
#courses {
  padding: 64px 0 !important;
}
#testimonials {
  padding: 64px 0 !important;
}
#contact {
  padding: 64px 0 !important;
}
.section-head {
  margin-bottom: 36px !important;
}

/* ---- 2. تحسين ألوان — بدون تعريف --bg أو --bg-2 لأنها dark-mode sensitive ---- */
:root {
  --brand: #c49a2e;
  --brand-2: #1565a8;
  --brand-3: #148a6a;
  --card-shadow: 0 12px 36px -18px rgba(20, 70, 110, 0.22);
  /* --bg و --bg-2 محذوفان عمداً — موجودان بالأسفل مع dark override */
}
/* dark mode — نعيد تعريف كل المتغيرات بشكل صريح */
[data-theme="dark"] {
  --brand: #ddb84a;
  --brand-2: #4da3e0;
  --brand-3: #2aad84;
  --bg: #0b1120;
  --bg-2: #131c2e;
  --text: #eef2f8;
  --muted: #9fabbf;
  --border: rgba(238, 242, 248, 0.14);
  --card-shadow: 0 18px 45px -25px rgba(0, 0, 0, 0.9);
  --nav-bg: rgba(11, 17, 32, 0.85);
}

/* ---- 3. الصور في الهيرو — نرجع لتصميم V2 الأصلي (بدون clip-path) مع تحسين الإطار ---- */
/* إعادة تعيين clip-path للـ none كما كان في V2 */
.hero-side--right {
  clip-path: none !important;
  border-radius: 20px 0 0 20px !important; /* حواف ناعمة على الجانب الخارجي فقط */
  overflow: hidden !important;
  box-shadow: 4px 0 32px -8px rgba(184, 134, 43, 0.18) !important;
}
.hero-side--left {
  clip-path: none !important;
  border-radius: 0 20px 20px 0 !important; /* حواف ناعمة على الجانب الخارجي فقط */
  overflow: hidden !important;
  box-shadow: -4px 0 32px -8px rgba(14, 75, 110, 0.18) !important;
}
/* في الموبايل نزيل الـ border-radius لأن الصورتين جنب بعض */
@media (max-width: 768px) {
  .hero-side--right,
  .hero-side--left {
    border-radius: 0 !important;
    height: 250px !important;
    max-height: 250px !important;
  }
}
@media (max-width: 480px) {
  .hero-side--right,
  .hero-side--left {
    height: 200px !important;
    max-height: 200px !important;
  }
}

/* ---- 4. النافبار في الموبايل — المشكلة الرئيسية ---- */
/* 
   المشكلة: .site-nav له background:transparent !important + ::after بـ z-index:-1
   في الموبايل الـ #mainNav (collapse) بينزل خارج الـ nav فيبان فوق خلفية شفافة.
   الحل: نضيف خلفية صريحة للـ #mainNav في الموبايل.
*/
@media (max-width: 991px) {
  /* الـ navbar نفسه يحتاج خلفية في الموبايل */
  .site-nav {
    background: var(--bg-2) !important;
    border-bottom: 1px solid var(--border) !important;
  }
  /* بعد scroll */
  .site-nav.scrolled {
    box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.18) !important;
  }
  /* الـ ::after مش محتاجه في الموبايل — نخليه شفاف */
  .site-nav::after {
    display: none !important;
  }

  /* القائمة المنسدلة */
  #mainNav {
    background: var(--bg-2) !important;
    border-top: 1px solid var(--border);
    border-radius: 0 0 20px 20px;
    padding: 14px 8px 18px;
    margin: 0 -12px -0px; /* يتمدد لحافة الـ container */
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.16);
    position: relative;
    z-index: 1;
  }

  /* روابط القائمة */
  .site-nav .navbar-nav {
    flex-direction: column !important;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
  }
  /* إزالة الخطوط الزخرفية جانبي القائمة */
  .site-nav .navbar-nav::before,
  .site-nav .navbar-nav::after {
    display: none !important;
  }
  .site-nav .nav-link {
    padding: 10px 16px !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    width: 100%;
  }

  /* زر الـ toggler — واضح على الخلفية */
  .navbar-toggler {
    padding: 6px 10px !important;
    border-radius: 10px !important;
    background: color-mix(in oklab, var(--brand) 10%, transparent) !important;
    border: 1px solid color-mix(in oklab, var(--brand) 28%, transparent) !important;
  }
  .navbar-toggler i {
    font-size: 1.55rem;
    color: var(--text);
    display: block;
    line-height: 1;
  }

  /* أزرار تسجيل الدخول */
  #mainNav .d-flex {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding-top: 4px;
  }
  #mainNav .btn-ghost,
  #mainNav .btn-brand {
    flex: 1;
    min-width: 110px;
    text-align: center;
    justify-content: center;
  }
  /* زر الثيم */
  #mainNav .theme-toggle {
    width: 40px;
    height: 40px;
  }
}

/* ---- 5. بوكسات آراء الطلاب — ارتفاع ثابت ---- */
.testi-stage {
  min-height: 360px !important;
  position: relative;
}
.testi-box {
  min-height: 340px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}
.testi-quote {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem !important;
  line-height: 1.9 !important;
}
@media (max-width: 576px) {
  .testi-stage {
    min-height: 430px !important;
  }
  .testi-box {
    min-height: 410px !important;
    padding: 32px 20px !important;
  }
}

/* ---- 6. تحسينات ألوان إضافية ---- */
.section-tag {
  color: var(--brand) !important;
  letter-spacing: 1.5px;
  font-size: 0.78rem;
  font-weight: 800;
}
.feature-card:hover {
  border-color: var(--brand) !important;
  box-shadow: 0 16px 40px -16px rgba(196, 154, 46, 0.28) !important;
}
.feature-card.feature-card--accent-2:hover {
  border-color: var(--brand-2) !important;
  box-shadow: 0 16px 40px -16px rgba(21, 101, 168, 0.28) !important;
}
.course-card:hover {
  box-shadow: 0 20px 44px -16px rgba(20, 70, 110, 0.24) !important;
}
.btn-ghost {
  font-size: 0.88rem;
}
.btn-brand {
  font-size: 0.88rem;
}
.site-nav .nav-link.active::after {
  bottom: 3px;
  width: 20px;
  height: 3px;
  border-radius: 3px;
  opacity: 0.9;
}

/* ===== Auth Pages Styles ===== */
.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 16px 60px;
  position: relative;
  overflow: hidden;
}

/* خلفية هندسية خفيفة */
.auth-geo-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.auth-geo-bg::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in oklab, var(--brand) 12%, transparent) 0%,
    transparent 70%
  );
  top: -100px;
  right: -120px;
}
.auth-geo-bg::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in oklab, var(--brand-2) 10%, transparent) 0%,
    transparent 70%
  );
  bottom: -80px;
  left: -100px;
}

.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 48px 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--card-shadow);
  position: relative;
  z-index: 1;
  animation: cardSlideUp 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), #d8a445);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 28px -10px var(--brand);
}
.auth-brand-icon i {
  font-size: 1.8rem;
  color: #16202e;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}
.auth-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* حقول الفورم */
.auth-field-group {
  margin-bottom: 18px;
}
.auth-field-group label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}
.auth-field-group label i {
  color: var(--brand);
  margin-left: 5px;
}

.input-wrapper {
  position: relative;
}
.input-wrapper .form-control {
  padding-right: 44px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding-top: 13px;
  padding-bottom: 13px;
  transition: 0.25s;
}
.input-wrapper .form-control:focus {
  border-color: var(--brand);
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 15%, transparent);
}
.input-wrapper .form-control::placeholder {
  color: var(--muted);
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.25s;
}
.input-wrapper:focus-within .input-icon {
  color: var(--brand);
}

/* زر إظهار/إخفاء كلمة السر */
.toggle-pass {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  pointer-events: all;
  z-index: 2;
}
.toggle-pass:hover {
  color: var(--brand);
}

/* خط فاصل */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* رابط "إنشاء حساب" */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-switch a {
  color: var(--brand-2);
  font-weight: 700;
  transition: 0.2s;
}
.auth-switch a:hover {
  color: var(--brand);
}

/* رسالة النجاح/الخطأ */
.auth-msg {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
  margin-bottom: 16px;
}
.auth-msg.show {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-msg.success {
  background: color-mix(in oklab, var(--brand-3) 12%, transparent);
  color: var(--brand-3);
  border: 1px solid color-mix(in oklab, var(--brand-3) 30%, transparent);
}
.auth-msg.error {
  background: color-mix(in oklab, #e53e3e 10%, transparent);
  color: #c53030;
  border: 1px solid color-mix(in oklab, #e53e3e 28%, transparent);
}

/* شريط التقدم */
.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 9999;
  width: 0%;
  transition: width 0.1s;
}

/* تكيّف الموبايل */
@media (max-width: 576px) {
  .auth-card {
    padding: 32px 20px;
    border-radius: 20px;
  }
  .auth-title {
    font-size: 1.4rem;
  }
}

/* ===== Auth + Register Styles ===== */
.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 16px 60px;
  position: relative;
  overflow: hidden;
}

.auth-geo-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.auth-geo-bg::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in oklab, var(--brand) 10%, transparent) 0%,
    transparent 70%
  );
  top: -120px;
  right: -140px;
}
.auth-geo-bg::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in oklab, var(--brand-2) 9%, transparent) 0%,
    transparent 70%
  );
  bottom: -80px;
  left: -100px;
}

.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 48px 40px;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--card-shadow);
  position: relative;
  z-index: 1;
  animation: cardSlideUp 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-2), #1a8fd1);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 28px -10px var(--brand-2);
}
.auth-brand-icon i {
  font-size: 1.8rem;
  color: #fff;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}
.auth-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* شريط خطوات التسجيل */
.reg-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.reg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.reg-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(-50% - 0px);
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.reg-step.done:not(:last-child)::after,
.reg-step.active:not(:last-child)::after {
  background: var(--brand-2);
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
  transition: 0.3s;
}
.reg-step.active .step-circle {
  border-color: var(--brand-2);
  background: var(--brand-2);
  color: #fff;
  box-shadow: 0 6px 16px -6px var(--brand-2);
}
.reg-step.done .step-circle {
  border-color: var(--brand-3);
  background: var(--brand-3);
  color: #fff;
}
.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  transition: 0.3s;
  white-space: nowrap;
}
.reg-step.active .step-label {
  color: var(--brand-2);
}
.reg-step.done .step-label {
  color: var(--brand-3);
}
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 40px;
  transition: background 0.4s;
  margin-bottom: 22px;
}
.step-connector.done {
  background: var(--brand-2);
}

/* حقول الفورم */
.auth-field-group {
  margin-bottom: 18px;
}
.auth-field-group label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}
.auth-field-group label i {
  color: var(--brand-2);
  margin-left: 5px;
}

.input-wrapper {
  position: relative;
}
.input-wrapper .form-control,
.input-wrapper .form-select {
  padding-right: 44px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 14px;
  padding-top: 13px;
  padding-bottom: 13px;
  transition: 0.25s;
}
.input-wrapper .form-select {
  padding-right: 44px;
}
.input-wrapper .form-control:focus,
.input-wrapper .form-select:focus {
  border-color: var(--brand-2);
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand-2) 15%, transparent);
}
.input-wrapper .form-control::placeholder {
  color: var(--muted);
}
.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.25s;
}
.input-wrapper:focus-within .input-icon {
  color: var(--brand-2);
}

.toggle-pass {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  z-index: 2;
}
.toggle-pass:hover {
  color: var(--brand-2);
}

/* مقياس قوة كلمة المرور */
.pass-strength-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.psb-seg {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.35s;
}
.psb-seg.weak {
  background: #e53e3e;
}
.psb-seg.fair {
  background: #dd8b27;
}
.psb-seg.good {
  background: #3182ce;
}
.psb-seg.strong {
  background: var(--brand-3);
}
.pass-strength-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 600;
}

/* بانلات الخطوات */
.reg-panel {
  display: none;
}
.reg-panel.active {
  display: block;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* أزرار التنقل */
.reg-nav-btns {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.btn-prev {
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 24px;
  background: transparent;
  transition: 0.3s;
  flex: 1;
}
.btn-prev:hover {
  border-color: var(--brand-2);
  color: var(--brand-2);
}
.btn-next,
.btn-submit-reg {
  background: linear-gradient(135deg, var(--brand-2), #1a8fd1);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  transition: 0.3s;
  flex: 2;
}
.btn-next:hover,
.btn-submit-reg:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px var(--brand-2);
  color: #fff;
}

/* تلميح حقل الواتساب */
.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* رسائل */
.auth-msg {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
  margin-bottom: 16px;
}
.auth-msg.show {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-msg.success {
  background: color-mix(in oklab, var(--brand-3) 12%, transparent);
  color: var(--brand-3);
  border: 1px solid color-mix(in oklab, var(--brand-3) 30%, transparent);
}
.auth-msg.error {
  background: color-mix(in oklab, #e53e3e 10%, transparent);
  color: #c53030;
  border: 1px solid color-mix(in oklab, #e53e3e 28%, transparent);
}

/* شريط التقدم */
.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 9999;
  width: 0%;
  transition: width 0.1s;
}

/* رابط الدخول */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-switch a {
  color: var(--brand);
  font-weight: 700;
  transition: 0.2s;
}
.auth-switch a:hover {
  color: var(--brand-2);
}

/* موبايل */
@media (max-width: 576px) {
  .auth-card {
    padding: 28px 16px;
    border-radius: 20px;
  }
  .auth-title {
    font-size: 1.35rem;
  }
  .step-label {
    font-size: 0.65rem;
  }
  .step-connector {
    min-width: 24px;
  }
}

/* ================================================================
   MOBILE NAVBAR FIX — FINAL
    الـ media queries في الآخر عشان تكون آخر حاجة في الـ cascade
   ================================================================ */
@media (max-width: 991px) {
  /* اللوجو — حجم ثابت لا يتغير مهما حصل */
  .site-nav .brand-badge,
  .navbar .brand-badge {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
  }
  .site-nav .brand-badge img,
  .navbar .brand-badge img {
    width: 38px !important;
    height: 38px !important;
  }

  /* البراند يتقلص ولا يطغى على التوجلر */
  .site-nav .navbar-brand {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 60px) !important;
    overflow: hidden;
  }
  .site-nav .navbar-brand-text {
    min-width: 0;
    overflow: hidden;
  }
  .site-nav .brand-title-split {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .site-nav .brand-tagline {
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
  }

  .site-nav .navbar-toggler {
    flex-shrink: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .site-nav #mainNav {
    margin: 0 !important;
    width: 100% !important;
    border-radius: 0 0 16px 16px;
  }
}

@media (max-width: 380px) {
  .site-nav .brand-badge,
  .navbar .brand-badge {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }
  .site-nav .brand-badge img,
  .navbar .brand-badge img {
    width: 32px !important;
    height: 32px !important;
  }
  .site-nav .brand-tagline {
    display: none !important;
  }
  .site-nav .brand-title-split {
    font-size: 0.8rem;
  }
}

/* ================================================================
   تعديلات: أيقونتا المعلمَين + قائمة واتساب المنسدلة
   ================================================================ */

/* ---- أيقونتا المعلمَين (pills) في العمود المركزي للهيرو ---- */
.hero-instructors-pills {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
  margin-bottom: 4px;
}

.instructor-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 8px;
  border-radius: 14px;
  text-decoration: none;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
  min-width: 190px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.12);
}
.instructor-pill:hover {
  transform: translateY(-3px);
  text-decoration: none;
}
.instructor-pill--social {
  border-color: color-mix(in oklab, var(--brand) 35%, transparent);
}
.instructor-pill--social:hover {
  box-shadow: 0 8px 24px -8px rgba(184, 134, 43, 0.35);
  border-color: var(--brand);
}
.instructor-pill--math {
  border-color: color-mix(in oklab, var(--brand-2) 35%, transparent);
}
.instructor-pill--math:hover {
  box-shadow: 0 8px 24px -8px rgba(14, 75, 110, 0.35);
  border-color: var(--brand-2);
}

/* صورة المعلم داخل الـ pill — دائرية مقطوعة */
.inst-pill-avatar {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}
.instructor-pill--social .inst-pill-avatar {
  border: 2px solid var(--brand);
}
.instructor-pill--math .inst-pill-avatar {
  border: 2px solid var(--brand-2);
}
.inst-pill-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  filter: brightness(1.05) saturate(1.1);
}

/* نصوص الـ pill */
.inst-pill-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inst-pill-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.2;
}
.inst-pill-sub {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.instructor-pill--social .inst-pill-sub {
  color: var(--brand);
}
.instructor-pill--math .inst-pill-sub {
  color: var(--brand-2);
}

/* dark mode للـ pills */
[data-theme="dark"] .instructor-pill {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .instructor-pill--social {
  border-color: color-mix(in oklab, var(--brand) 40%, transparent);
}
[data-theme="dark"] .instructor-pill--math {
  border-color: color-mix(in oklab, var(--brand-2) 40%, transparent);
}

/* responsive */
@media (max-width: 480px) {
  .hero-instructors-pills {
    gap: 8px;
  }
  .instructor-pill {
    min-width: 160px;
    padding: 7px 12px 7px 7px;
  }
  .inst-pill-avatar {
    width: 38px;
    height: 38px;
  }
  .inst-pill-name {
    font-size: 0.75rem;
  }
  .inst-pill-sub {
    font-size: 0.66rem;
  }
}

/* ---- قائمة واتساب المنسدلة ---- */
.wa-float-wrap {
  position: fixed;
  bottom: 26px;
  inset-inline-start: 26px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

/* الزر الرئيسي يرث نفس ستايل float-btn */
.wa-float-wrap .whatsapp-btn {
  position: static; /* يتبع الـ flex بدل fixed */
  inset-inline-start: unset;
  bottom: unset;
}

/* القائمة المنسدلة */
.wa-dropdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom left;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}
.wa-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* كل خيار في القائمة */
.wa-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  min-width: 200px;
  white-space: nowrap;
}
.wa-option:hover {
  transform: translateX(4px);
  text-decoration: none;
}

/* أيقونة الواتساب داخل كل خيار */
.wa-option-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  color: #fff;
}
.wa-option--social .wa-option-icon {
  background: var(--brand);
}
.wa-option--math .wa-option-icon {
  background: var(--brand-2);
}

/* نصوص الخيار */
.wa-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wa-option-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
}
.wa-option-subject {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.wa-option--social:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 24px -6px rgba(184, 134, 43, 0.3);
}
.wa-option--math:hover {
  border-color: var(--brand-2);
  box-shadow: 0 8px 24px -6px rgba(14, 75, 110, 0.3);
}

/* dark mode للقائمة */
[data-theme="dark"] .wa-option {
  background: #1a253a;
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .wa-option-label {
  color: #eef2f8;
}
[data-theme="dark"] .wa-option-subject {
  color: #9fabbf;
}


/* hero الكورس */
      .cd-hero {
        padding: 120px 0 0;
        position: relative;
        overflow: hidden;
        background: var(--bg);
      }
      .cd-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(160deg, var(--bg) 55%, transparent 100%);
        z-index: 1;
      }
      .cd-hero-bg {
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
        opacity: 0.12;
        filter: blur(2px);
        transition: opacity 0.4s;
      }
      [data-theme="dark"] .cd-hero-bg {
        opacity: 0.07;
      }
      .cd-hero > .container {
        position: relative;
        z-index: 2;
      }

      /* شريط breadcrumb */
      .cd-breadcrumb {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--muted);
        margin-bottom: 24px;
        flex-wrap: wrap;
      }
      .cd-breadcrumb a {
        color: var(--muted);
        transition: color 0.2s;
      }
      .cd-breadcrumb a:hover {
        color: var(--brand);
      }
      .cd-breadcrumb .sep {
        opacity: 0.5;
      }
      .cd-breadcrumb .current {
        color: var(--text);
      }

      /* شارة المادة */
      .cd-subject-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 0.78rem;
        font-weight: 800;
        padding: 5px 14px;
        border-radius: 999px;
        margin-bottom: 14px;
        letter-spacing: 0.5px;
      }
      .cd-badge--social {
        background: color-mix(in oklab, var(--brand) 14%, transparent);
        color: var(--brand);
        border: 1px solid color-mix(in oklab, var(--brand) 30%, transparent);
      }
      .cd-badge--math {
        background: color-mix(in oklab, var(--brand-2) 14%, transparent);
        color: var(--brand-2);
        border: 1px solid color-mix(in oklab, var(--brand-2) 30%, transparent);
      }

      /* عنوان الكورس */
      .cd-title {
        font-size: clamp(1.6rem, 3vw, 2.4rem);
        font-weight: 900;
        line-height: 1.3;
        color: var(--text);
        margin-bottom: 12px;
      }
      .cd-desc {
        font-size: 1rem;
        color: var(--muted);
        line-height: 1.9;
        max-width: 680px;
        margin-bottom: 24px;
      }

      /* شريط الميتا */
      .cd-meta-row {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        margin-bottom: 32px;
      }
      .cd-meta-item {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text);
      }
      .cd-meta-item i {
        font-size: 1rem;
        color: var(--muted);
      }

      /* تقييم النجوم */
      .cd-stars {
        color: #f5a623;
        letter-spacing: 2px;
        font-size: 0.9rem;
      }
      .cd-rating-count {
        color: var(--muted);
        font-weight: 600;
        font-size: 0.8rem;
      }

      /* صورة الكورس في الهيرو */
      .cd-hero-thumb {
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.3);
        aspect-ratio: 16/10;
        position: relative;
      }
      .cd-hero-thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
      }
      .cd-play-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        display: grid;
        place-items: center;
        cursor: pointer;
        transition: background 0.3s;
      }
      .cd-play-overlay:hover {
        background: rgba(0, 0, 0, 0.5);
      }
      .cd-play-btn {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        border: none;
        display: grid;
        place-items: center;
        font-size: 1.6rem;
        color: var(--brand);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
        transition: transform 0.25s;
      }
      .cd-play-overlay:hover .cd-play-btn {
        transform: scale(1.1);
      }

      /* ======= بطاقة الاشتراك (sticky) ======= */
      .cd-enroll-card {
        background: var(--bg-2);
        border: 1.5px solid var(--border);
        border-radius: 24px;
        padding: 28px;
        box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.18);
        position: sticky;
        top: 90px;
      }
      .cd-price-wrap {
        display: flex;
        align-items: baseline;
        gap: 10px;
        margin-bottom: 6px;
      }
      .cd-price-now {
        font-size: 2rem;
        font-weight: 900;
        color: var(--brand);
      }
      .cd-price-now--math {
        color: var(--brand-2);
      }
      .cd-price-old {
        font-size: 1rem;
        color: var(--muted);
        text-decoration: line-through;
        font-weight: 600;
      }
      .cd-discount-badge {
        background: #e53e3e;
        color: #fff;
        font-size: 0.72rem;
        font-weight: 800;
        padding: 3px 9px;
        border-radius: 999px;
      }
      .cd-price-note {
        font-size: 0.78rem;
        color: var(--muted);
        margin-bottom: 18px;
      }
      .cd-enroll-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px;
        border-radius: 14px;
        font-size: 1rem;
        font-weight: 800;
        border: none;
        cursor: pointer;
        transition: 0.3s;
        text-decoration: none;
        margin-bottom: 10px;
      }
      .cd-enroll-btn--primary {
        background: linear-gradient(135deg, var(--brand), #d8a445);
        color: #16202e;
        box-shadow: 0 8px 24px -8px var(--brand);
      }
      .cd-enroll-btn--primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 32px -10px var(--brand);
        color: #16202e;
      }
      .cd-enroll-btn--primary--math {
        background: linear-gradient(135deg, var(--brand-2), #1a8fd1);
        color: #fff;
        box-shadow: 0 8px 24px -8px var(--brand-2);
      }
      .cd-enroll-btn--primary--math:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 32px -10px var(--brand-2);
        color: #fff;
      }
      .cd-enroll-btn--ghost {
        background: transparent;
        border: 1.5px solid var(--border);
        color: var(--text);
        font-size: 0.9rem;
      }
      .cd-enroll-btn--ghost:hover {
        border-color: var(--brand);
        color: var(--brand);
      }
      .cd-guarantee {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 0.78rem;
        color: var(--muted);
        font-weight: 600;
        justify-content: center;
        margin-top: 14px;
      }
      .cd-guarantee i {
        color: #1d7a5f;
        font-size: 1rem;
      }

      /* ميزات الكورس داخل البطاقة */
      .cd-card-features {
        border-top: 1px solid var(--border);
        margin-top: 18px;
        padding-top: 18px;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .cd-card-feat {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.83rem;
        font-weight: 700;
        color: var(--text);
      }
      .cd-card-feat i {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        background: color-mix(in oklab, var(--brand) 12%, transparent);
        color: var(--brand);
        display: grid;
        place-items: center;
        font-size: 0.8rem;
        flex-shrink: 0;
      }
      .cd-card-feat--math i {
        background: color-mix(in oklab, var(--brand-2) 12%, transparent);
        color: var(--brand-2);
      }

      /* ======= الأقسام السفلية ======= */
      .cd-body {
        padding: 60px 0 80px;
      }

      /* التبويبات */
      .cd-tabs {
        display: flex;
        gap: 4px;
        border-bottom: 2px solid var(--border);
        margin-bottom: 36px;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 0;
      }
      .cd-tabs::-webkit-scrollbar {
        display: none;
      }
      .cd-tab {
        padding: 10px 20px;
        font-size: 0.88rem;
        font-weight: 800;
        color: var(--muted);
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        white-space: nowrap;
        transition: 0.2s;
        margin-bottom: -2px;
      }
      .cd-tab:hover {
        color: var(--text);
      }
      .cd-tab.active {
        color: var(--brand);
        border-bottom-color: var(--brand);
      }
      .cd-tab.active--math {
        color: var(--brand-2);
        border-bottom-color: var(--brand-2);
      }
      .cd-panel {
        display: none;
      }
      .cd-panel.active {
        display: block;
      }

      /* ما ستتعلمه */
      .cd-learn-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
        margin-bottom: 0;
      }
      .cd-learn-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 14px 16px;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text);
        line-height: 1.5;
      }
      .cd-learn-item i {
        color: #1d7a5f;
        font-size: 1rem;
        flex-shrink: 0;
        margin-top: 1px;
      }

      /* محتوى الكورس (accordion) */
      .cd-curriculum {
      }
      .cd-week {
        border: 1px solid var(--border);
        border-radius: 14px;
        overflow: hidden;
        margin-bottom: 10px;
      }
      .cd-week-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        background: var(--bg);
        cursor: pointer;
        gap: 10px;
        transition: background 0.2s;
        border: none;
        width: 100%;
        text-align: right;
      }
      .cd-week-header:hover {
        background: color-mix(in oklab, var(--brand) 5%, var(--bg));
      }
      .cd-week-title {
        font-size: 0.9rem;
        font-weight: 800;
        color: var(--text);
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .cd-week-num {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        background: color-mix(in oklab, var(--brand) 14%, transparent);
        color: var(--brand);
        display: grid;
        place-items: center;
        font-size: 0.75rem;
        font-weight: 900;
        flex-shrink: 0;
      }
      .cd-week-num--math {
        background: color-mix(in oklab, var(--brand-2) 14%, transparent);
        color: var(--brand-2);
      }
      .cd-week-meta {
        font-size: 0.76rem;
        color: var(--muted);
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 14px;
        flex-shrink: 0;
      }
      .cd-week-chevron {
        color: var(--muted);
        transition: transform 0.3s;
        font-size: 0.85rem;
        flex-shrink: 0;
      }
      .cd-week.open .cd-week-chevron {
        transform: rotate(180deg);
      }
      .cd-week-body {
        display: none;
        border-top: 1px solid var(--border);
        background: var(--bg-2);
      }
      .cd-week.open .cd-week-body {
        display: block;
      }
      .cd-lesson {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px;
        border-bottom: 1px solid var(--border);
        font-size: 0.83rem;
        font-weight: 600;
        color: var(--text);
      }
      .cd-lesson:last-child {
        border-bottom: none;
      }
      .cd-lesson-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        display: grid;
        place-items: center;
        font-size: 0.8rem;
        flex-shrink: 0;
      }
      .cd-lesson-icon--video {
        background: color-mix(in oklab, var(--brand-2) 12%, transparent);
        color: var(--brand-2);
      }
      .cd-lesson-icon--quiz {
        background: color-mix(in oklab, #1d7a5f 12%, transparent);
        color: #1d7a5f;
      }
      .cd-lesson-icon--pdf {
        background: color-mix(in oklab, #e53e3e 10%, transparent);
        color: #e53e3e;
      }
      .cd-lesson-dur {
        margin-right: auto;
        font-size: 0.76rem;
        color: var(--muted);
        font-weight: 600;
      }
      .cd-lesson-free {
        font-size: 0.7rem;
        font-weight: 800;
        padding: 2px 8px;
        border-radius: 999px;
        background: color-mix(in oklab, #1d7a5f 12%, transparent);
        color: #1d7a5f;
        border: 1px solid color-mix(in oklab, #1d7a5f 25%, transparent);
      }

      /* بطاقة المدرس */
      .cd-instructor-card {
        display: flex;
        gap: 20px;
        align-items: flex-start;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 24px;
      }
      .cd-instructor-avatar {
        width: 90px;
        height: 90px;
        border-radius: 16px;
        overflow: hidden;
        flex-shrink: 0;
        border: 2px solid var(--brand);
      }
      .cd-instructor-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
        display: block;
      }
      .cd-instructor-name {
        font-size: 1.1rem;
        font-weight: 900;
        margin-bottom: 4px;
      }
      .cd-instructor-role {
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--brand);
        margin-bottom: 10px;
      }
      .cd-instructor-stats {
        display: flex;
        gap: 18px;
        flex-wrap: wrap;
        margin-bottom: 12px;
      }
      .cd-instructor-stat {
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--muted);
        display: flex;
        align-items: center;
        gap: 5px;
      }
      .cd-instructor-stat i {
        color: var(--brand);
      }
      .cd-instructor-bio {
        font-size: 0.85rem;
        color: var(--muted);
        line-height: 1.85;
        margin: 0;
      }

      /* التقييمات */
      .cd-rating-summary {
        display: flex;
        gap: 28px;
        align-items: center;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 20px;
        padding: 24px;
        margin-bottom: 24px;
      }
      .cd-big-rating {
        text-align: center;
        flex-shrink: 0;
      }
      .cd-big-num {
        font-size: 3.2rem;
        font-weight: 900;
        color: var(--brand);
        line-height: 1;
      }
      .cd-big-stars {
        font-size: 1.1rem;
        color: #f5a623;
      }
      .cd-big-total {
        font-size: 0.78rem;
        color: var(--muted);
        font-weight: 600;
      }
      .cd-rating-bars {
        flex: 1;
      }
      .cd-bar-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 6px;
        font-size: 0.78rem;
        color: var(--muted);
        font-weight: 600;
      }
      .cd-bar-track {
        flex: 1;
        height: 7px;
        background: var(--border);
        border-radius: 999px;
        overflow: hidden;
      }
      .cd-bar-fill {
        height: 100%;
        border-radius: 999px;
        background: #f5a623;
        transition: width 0.8s ease;
      }
      .cd-bar-pct {
        width: 30px;
        text-align: left;
      }

      /* بطاقة تقييم */
      .cd-review-card {
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 14px;
      }
      .cd-review-head {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 10px;
      }
      .cd-review-avatar {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--brand), var(--brand-2));
        color: #fff;
        display: grid;
        place-items: center;
        font-size: 1rem;
        font-weight: 800;
        flex-shrink: 0;
      }
      .cd-review-name {
        font-size: 0.88rem;
        font-weight: 800;
      }
      .cd-review-date {
        font-size: 0.74rem;
        color: var(--muted);
        font-weight: 600;
      }
      .cd-review-text {
        font-size: 0.85rem;
        color: var(--muted);
        line-height: 1.85;
        margin: 0;
      }

      /* متطلبات */
      .cd-req-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .cd-req-list li {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: 0.88rem;
        font-weight: 600;
        color: var(--text);
        line-height: 1.6;
      }
      .cd-req-list li::before {
        content: "•";
        color: var(--brand);
        font-size: 1.2rem;
        line-height: 1.2;
        flex-shrink: 0;
      }

      /* section headings */
      .cd-section-title {
        font-size: 1.15rem;
        font-weight: 900;
        color: var(--text);
        margin-bottom: 20px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--border);
      }

      /* كورسات مشابهة */
      .cd-related-card {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        background: var(--bg-2);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 14px;
        transition: 0.3s;
        text-decoration: none;
      }
      .cd-related-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--card-shadow);
        border-color: var(--brand);
        text-decoration: none;
      }
      .cd-related-thumb {
        width: 80px;
        height: 60px;
        border-radius: 10px;
        overflow: hidden;
        flex-shrink: 0;
      }
      .cd-related-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
      .cd-related-title {
        font-size: 0.83rem;
        font-weight: 800;
        color: var(--text);
        margin-bottom: 4px;
        line-height: 1.4;
      }
      .cd-related-price {
        font-size: 0.88rem;
        font-weight: 900;
      }

      /* wave bottom of hero */
      .cd-hero-wave {
        position: relative;
        z-index: 2;
        line-height: 0;
        margin-top: 40px;
      }

      /* spinner */
      .cd-loading {
        min-height: 60vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        color: var(--muted);
      }
      .cd-spinner {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: 4px solid var(--border);
        border-top-color: var(--brand);
        animation: spin 0.8s linear infinite;
      }
      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }

      /* responsive fixes */
      @media (max-width: 768px) {
        .cd-hero {
          padding-top: 90px;
        }
        .cd-enroll-card {
          position: static;
          margin-top: 32px;
        }
        .cd-rating-summary {
          flex-direction: column;
        }
        .cd-instructor-card {
          flex-direction: column;
        }
        .cd-instructor-avatar {
          width: 70px;
          height: 70px;
        }
      }

/* ============ Footer Social Icons with Popup ============ */
.footer-social-row {
  display: flex;
  justify-content: center;
  padding: 32px 0 8px;
}

.footer-social-icons {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.footer-social-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-social-btn {
  cursor: pointer;
  background: none;
  border: 1px solid var(--border);
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

/* Popup (appears above the icon) */
.footer-social-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.95);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 1100;
  min-width: 210px;
}

.footer-social-popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Reuse wa-option styles — just tweak hover translation direction for footer */
.footer-social-popup .wa-option:hover {
  transform: translateY(-2px);
}

/* Small arrow pointing down toward the icon */
.footer-social-popup::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 7px 0;
  border-style: solid;
  border-color: var(--border) transparent transparent;
}

.footer-social-wrap.active .footer-social-btn {
  background: var(--brand);
  color: #16202e;
  border-color: var(--brand);
}
