/* ═══════════════════════════════════════════════════════════════
   تاتا تاتا — تحسين الوضع الداكن (تباين النصوص والمساحات)
   يُحمَّل أخيراً ليتفوق على التعارضات
   ═══════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
  /* إصلاح منحدر الهوية: درجات فاتحة للاستخدام النصّي */
  --brand-800: #E8E1D2;
  --brand-700: #D8BC7A;
  --brand-600: #C6A35A;
  --brand-500: #EBD9A8;

  --text: #F0EBE3;
  --text-strong: #FFFCF6;
  --muted: #B8C4D0;
  --muted-strong: #D4DCE4;

  --page-bg: #0B1524;
  --page-bg-alt: #12253C;
  --card-bg: #152A44;
  --card: #152A44;
  --card-bg-strong: #1B3452;
  --card-soft: #101F33;

  --field-bg: #0F1E32;
  --field-text: #FFFCF6;
  --field-border: rgba(232, 225, 210, 0.22);

  --border: rgba(232, 225, 210, 0.14);
  --border-strong: rgba(216, 188, 122, 0.42);

  --insight: #D8BC7A;
  --insight-strong: #EBD9A8;
  --insight-soft: rgba(216, 188, 122, 0.16);

  --primary: #F0EBE3;
  --primary-strong: #FFFCF6;
  --primary-weak: rgba(216, 188, 122, 0.18);

  --hdr-bg: #12253C;
  --hdr-text: #FFFCF6;
  --hdr-border: rgba(216, 188, 122, 0.32);

  --btn-solid-bg: linear-gradient(135deg, #1B3452 0%, #274A70 100%);
  --btn-solid-text: #FFFCF6;
  --btn-gold-bg: linear-gradient(135deg, #B8923E 0%, #D4B15E 55%, #E6C97A 100%);
  --btn-gold-text: #0B1524;

  color-scheme: dark;
}

/* Base body & typography */
html[data-theme="dark"] body,
html[data-theme="dark"] body.legend-platform,
html[data-theme="dark"] body.student-no-header {
  color: var(--text) !important;
  background-color: var(--page-bg) !important;
}

html[data-theme="dark"] body.legend-platform h1,
html[data-theme="dark"] body.legend-platform h2,
html[data-theme="dark"] body.legend-platform h3,
html[data-theme="dark"] body.legend-platform h4,
html[data-theme="dark"] body.student-no-header h1,
html[data-theme="dark"] body.student-no-header h2,
html[data-theme="dark"] body.student-no-header h3,
html[data-theme="dark"] .lg-hero__brand,
html[data-theme="dark"] .lg-section__title,
html[data-theme="dark"] .lg-path__title,
html[data-theme="dark"] .lg-guide__name,
html[data-theme="dark"] .lg-feature__title,
html[data-theme="dark"] .lg-grade__name,
html[data-theme="dark"] .lg-cta__title,
html[data-theme="dark"] .lg-footer__name,
html[data-theme="dark"] .auth-head__title,
html[data-theme="dark"] .acc-hero h1,
html[data-theme="dark"] .acc-card__head h2,
html[data-theme="dark"] .acc-course__title,
html[data-theme="dark"] .acc-brand__name,
html[data-theme="dark"] .lg-brand__name,
html[data-theme="dark"] .mp-pathItem__title {
  color: #FFFCF6 !important;
}

html[data-theme="dark"] body.legend-platform p,
html[data-theme="dark"] body.legend-platform li,
html[data-theme="dark"] body.legend-platform label,
html[data-theme="dark"] body.legend-platform td,
html[data-theme="dark"] body.legend-platform th,
html[data-theme="dark"] body.student-no-header p,
html[data-theme="dark"] body.student-no-header li,
html[data-theme="dark"] body.student-no-header label,
html[data-theme="dark"] .lg-hero__desc,
html[data-theme="dark"] .lg-hero__teacher,
html[data-theme="dark"] .lg-section__sub,
html[data-theme="dark"] .lg-feature__text,
html[data-theme="dark"] .lg-guide__quote,
html[data-theme="dark"] .lg-guide__role,
html[data-theme="dark"] .lg-path__hint,
html[data-theme="dark"] .lg-cta__sub,
html[data-theme="dark"] .auth-head__sub,
html[data-theme="dark"] .auth-foot,
html[data-theme="dark"] .acc-hero__sub,
html[data-theme="dark"] .acc-companion p,
html[data-theme="dark"] .acc-stat__lbl,
html[data-theme="dark"] .mp-pathItem__meta,
html[data-theme="dark"] .muted {
  color: #C8D2DC !important;
}

html[data-theme="dark"] .lg-hero__enLine,
html[data-theme="dark"] .lg-section__en,
html[data-theme="dark"] .lg-path__kicker,
html[data-theme="dark"] .lg-cta__en,
html[data-theme="dark"] .lg-guide__step,
html[data-theme="dark"] .lg-guide__en,
html[data-theme="dark"] .acc-hero__kicker,
html[data-theme="dark"] .acc-brand__sub,
html[data-theme="dark"] .lg-brand__sub,
html[data-theme="dark"] .lg-feature__num,
html[data-theme="dark"] .lg-path__label,
html[data-theme="dark"] .acc-journey__label,
html[data-theme="dark"] .acc-journey__num,
html[data-theme="dark"] .acc-companion h3,
html[data-theme="dark"] .mp-pathItem__status {
  color: #E6C97A !important;
}

/* Links */
html[data-theme="dark"] body.legend-platform a:not(.lg-btn):not(.acc-btn):not(.acc-btnx):not(.btn):not(.btn-submit) {
  color: #E6C97A !important;
}
html[data-theme="dark"] body.legend-platform a:not(.lg-btn):not(.acc-btn):hover {
  color: #F5E8C8 !important;
}

/* Header */
html[data-theme="dark"] .lg-hdr {
  background: rgba(18, 37, 60, 0.94) !important;
  border-bottom-color: rgba(216, 188, 122, 0.35) !important;
}
html[data-theme="dark"] .lg-hdr__tagAr { color: #FFFCF6 !important; }
html[data-theme="dark"] .lg-btn--ghost,
html[data-theme="dark"] .lg-btn--outline {
  color: #FFFCF6 !important;
  border-color: rgba(232, 225, 210, 0.28) !important;
}
html[data-theme="dark"] .lg-btn--ghost:hover,
html[data-theme="dark"] .lg-btn--outline:hover {
  background: rgba(216, 188, 122, 0.12) !important;
  border-color: #D8BC7A !important;
  color: #FFFCF6 !important;
}
html[data-theme="dark"] .lg-burger {
  background: #1B3452 !important;
  border-color: rgba(216, 188, 122, 0.35) !important;
}
html[data-theme="dark"] .lg-burger span { background: #FFFCF6 !important; }
html[data-theme="dark"] .lg-drawer {
  background: #152A44 !important;
  border-top-color: rgba(216, 188, 122, 0.25) !important;
}

/* Hero */
html[data-theme="dark"] .lg-hero {
  background:
    linear-gradient(180deg, rgba(11, 21, 36, 0.98), rgba(18, 37, 60, 0.98)),
    #0B1524 !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .lg-hero__copy { color: #F0EBE3 !important; }
html[data-theme="dark"] .lg-hero__skills span {
  color: #E6C97A !important;
  border-color: rgba(216, 188, 122, 0.45) !important;
  background: rgba(216, 188, 122, 0.08) !important;
}
html[data-theme="dark"] .lg-hero__photoCapEn { color: #E6C97A !important; }
html[data-theme="dark"] .lg-hero__photoCapAr { color: #FFFCF6 !important; }

/* Path / guides / axes / features */
html[data-theme="dark"] .lg-path,
html[data-theme="dark"] .lg-path--feet {
  background: #12253C !important;
  border-color: rgba(216, 188, 122, 0.28) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .lg-guides,
html[data-theme="dark"] .lg-section,
html[data-theme="dark"] .lg-section--features,
html[data-theme="dark"] .lg-section--grades,
html[data-theme="dark"] .lg-axes,
html[data-theme="dark"] .lg-stats,
html[data-theme="dark"] .lg-cta {
  background: #0B1524 !important;
}
html[data-theme="dark"] .lg-guide,
html[data-theme="dark"] .lg-feature,
html[data-theme="dark"] .lg-grade,
html[data-theme="dark"] .lg-stat,
html[data-theme="dark"] .lg-axes__list li,
html[data-theme="dark"] .lg-cta__box {
  background: #1B3452 !important;
  border-color: rgba(216, 188, 122, 0.28) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .lg-cta__box {
  background: linear-gradient(160deg, rgba(27, 52, 82, 0.95), rgba(18, 37, 60, 0.98)) !important;
}
html[data-theme="dark"] .lg-grade__hint,
html[data-theme="dark"] .lg-stat__lbl,
html[data-theme="dark"] .lg-axes__list em {
  color: #B8C4D0 !important;
}
html[data-theme="dark"] .lg-grade__badge {
  background: #12253C !important;
  color: #E6C97A !important;
  border-color: rgba(216, 188, 122, 0.4) !important;
}
html[data-theme="dark"] .lg-grade__cta {
  background: rgba(216, 188, 122, 0.16) !important;
  color: #E6C97A !important;
}
html[data-theme="dark"] .lg-strip {
  background: #12253C !important;
  color: #E6C97A !important;
}

/* Auth */
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .auth-formPane {
  background: #1B3452 !important;
  border-color: rgba(216, 188, 122, 0.28) !important;
}
html[data-theme="dark"] .auth-imgPane,
html[data-theme="dark"] .auth-imgPane--register {
  background: #12253C !important;
}
html[data-theme="dark"] .label { color: #FFFCF6 !important; }
html[data-theme="dark"] .input,
html[data-theme="dark"] select.input,
html[data-theme="dark"] textarea.input {
  background: #0F1E32 !important;
  color: #FFFCF6 !important;
  border-color: rgba(232, 225, 210, 0.22) !important;
}
html[data-theme="dark"] .input::placeholder { color: #8FA3B4 !important; }
html[data-theme="dark"] .input:focus {
  border-color: #D8BC7A !important;
  box-shadow: 0 0 0 3px rgba(216, 188, 122, 0.18) !important;
}
html[data-theme="dark"] .auth-link { color: #E6C97A !important; }
html[data-theme="dark"] .auth-imgFallback { color: #C8D2DC !important; }
html[data-theme="dark"] .auth-imgFallback__hero {
  color: #E6C97A !important;
  border-color: rgba(216, 188, 122, 0.4) !important;
  background: #12253C !important;
}

/* Account shell */
html[data-theme="dark"] .acc-topbar__bar {
  background: #1B3452 !important;
  border-color: rgba(216, 188, 122, 0.3) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .acc-sidebar {
  background: #152A44 !important;
  border-color: rgba(216, 188, 122, 0.3) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .acc-nav__item {
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .acc-nav__lbl { color: inherit !important; }
html[data-theme="dark"] .acc-nav__item:hover {
  background: rgba(216, 188, 122, 0.12) !important;
  color: #FFFCF6 !important;
}
html[data-theme="dark"] .acc-nav__item.is-active {
  background: rgba(216, 188, 122, 0.16) !important;
  color: #E6C97A !important;
  box-shadow: inset 3px 0 0 #D8BC7A !important;
}
html[data-theme="dark"] .acc-nav__ico,
html[data-theme="dark"] .acc-nav__item.is-active .acc-nav__ico {
  color: #E6C97A !important;
}
html[data-theme="dark"] .acc-nav__soon { color: #8FA3B4 !important; }

html[data-theme="dark"] body:has(#accSideNavToggle:checked) .acc-sidebar,
html[data-theme="dark"] .acc-sidebar.is-open {
  background: #152A44 !important;
  border-color: rgba(216, 188, 122, 0.35) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] body:has(#accSideNavToggle:checked) .acc-sidebar .acc-nav__item,
html[data-theme="dark"] .acc-sidebar.is-open .acc-nav__item {
  color: #F0EBE3 !important;
}
html[data-theme="dark"] body:has(#accSideNavToggle:checked) .acc-sidebar .acc-nav__lbl,
html[data-theme="dark"] .acc-sidebar.is-open .acc-nav__lbl {
  color: #F0EBE3 !important;
}

html[data-theme="dark"] .acc-hero {
  background: linear-gradient(135deg, #1B3452, #152A44) !important;
  border-color: rgba(216, 188, 122, 0.3) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .acc-journey__step,
html[data-theme="dark"] .acc-companion,
html[data-theme="dark"] .acc-stat,
html[data-theme="dark"] .acc-course,
html[data-theme="dark"] .acc-card,
html[data-theme="dark"] .acc-lecture,
html[data-theme="dark"] .mp-pathItem {
  background: #1B3452 !important;
  border-color: rgba(216, 188, 122, 0.22) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .acc-journey__step:hover,
html[data-theme="dark"] .mp-pathItem:hover {
  background: rgba(216, 188, 122, 0.10) !important;
  border-color: rgba(216, 188, 122, 0.4) !important;
}
html[data-theme="dark"] .acc-journey__hint,
html[data-theme="dark"] .acc-course__grade,
html[data-theme="dark"] .acc-lecture__row {
  color: #B8C4D0 !important;
}
html[data-theme="dark"] .acc-student,
html[data-theme="dark"] .acc-pill {
  background: #12253C !important;
  border-color: rgba(216, 188, 122, 0.25) !important;
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .acc-bell,
html[data-theme="dark"] .acc-burger {
  background: #12253C !important;
  border-color: rgba(216, 188, 122, 0.3) !important;
  color: #E6C97A !important;
}
html[data-theme="dark"] .acc-burger span { background: #E6C97A !important; }

/* Forms inside account */
html[data-theme="dark"] .acc-card input,
html[data-theme="dark"] .acc-card select,
html[data-theme="dark"] .acc-card textarea,
html[data-theme="dark"] .field .input,
html[data-theme="dark"] input.input,
html[data-theme="dark"] select.input,
html[data-theme="dark"] textarea.input {
  background: #0F1E32 !important;
  color: #FFFCF6 !important;
  border-color: rgba(232, 225, 210, 0.22) !important;
}

/* Alerts / toasts */
html[data-theme="dark"] .phy-toast {
  background: #1B3452 !important;
  border-color: rgba(216, 188, 122, 0.28) !important;
}
html[data-theme="dark"] .phy-toast__title { color: #FFFCF6 !important; }
html[data-theme="dark"] .phy-toast__msg,
html[data-theme="dark"] .phy-toast__list { color: #C8D2DC !important; }

/* Course / lecture detail */
html[data-theme="dark"] .acc-courseHero,
html[data-theme="dark"] .acc-lectureInfo,
html[data-theme="dark"] .acc-item,
html[data-theme="dark"] .buy-pill,
html[data-theme="dark"] .pill {
  color: #F0EBE3 !important;
}
html[data-theme="dark"] .buy-pill,
html[data-theme="dark"] .pill {
  background: rgba(216, 188, 122, 0.12) !important;
  border-color: rgba(216, 188, 122, 0.3) !important;
}

/* Strong numbers / stats values */
html[data-theme="dark"] .lg-stat__val,
html[data-theme="dark"] .acc-stat__val {
  color: #FFFCF6 !important;
}

/* Footer stays deep; ensure text readable */
html[data-theme="dark"] .lg-footer {
  background: #060C14 !important;
  color: rgba(240, 235, 227, 0.82) !important;
}
html[data-theme="dark"] .lg-footer__nav a,
html[data-theme="dark"] .lg-footer__link,
html[data-theme="dark"] .lg-footer__phone {
  color: rgba(240, 235, 227, 0.88) !important;
}
html[data-theme="dark"] .lg-footer__heading { color: #E6C97A !important; }
html[data-theme="dark"] .lg-footer__tag,
html[data-theme="dark"] .lg-footer__copy,
html[data-theme="dark"] .lg-footer__dev {
  color: rgba(200, 210, 220, 0.7) !important;
}

/* ═══ إصلاح ظهور الخطوات والبصمات في الداكن ═══ */
html[data-theme="dark"] .lg-hdr__top {
  background: linear-gradient(90deg, #0A1628, #1B3A5C 50%, #0A1628) !important;
}
html[data-theme="dark"] .lg-hdr__tagAr,
html[data-theme="dark"] .lg-hdr__topInner,
html[data-theme="dark"] .lg-hdr__top span {
  color: #FFFCF6 !important;
  opacity: 1 !important;
  font-weight: 700 !important;
}

/* البصمات: كانت رمادي غامق فاختفت */
html[data-theme="dark"] .lg-path__foot,
html[data-theme="dark"] .lg-path__feetIco,
html[data-theme="dark"] .lg-brand__feet,
html[data-theme="dark"] .lg-feature__mark img,
html[data-theme="dark"] .acc-journey__foot {
  opacity: 1 !important;
}
html[data-theme="dark"] .lg-path__foot img,
html[data-theme="dark"] .lg-path__feetIco,
html[data-theme="dark"] .lg-brand__feet,
html[data-theme="dark"] .lg-feature__mark img,
html[data-theme="dark"] .acc-journey__foot img {
  filter: brightness(0) saturate(100%) invert(82%) sepia(28%) saturate(700%) hue-rotate(5deg) brightness(1.15) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .lg-path__step {
  opacity: 1 !important;
}
html[data-theme="dark"] .lg-path__label {
  color: #FFFCF6 !important;
  font-weight: 800 !important;
}
html[data-theme="dark"] .lg-path__hint {
  color: #D4DCE4 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .lg-path__num {
  background: #274A70 !important;
  color: #FFF8E8 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .lg-path__step.is-active .lg-path__num {
  background: #E6C97A !important;
  color: #0B1524 !important;
}
html[data-theme="dark"] .lg-path__connector {
  background: linear-gradient(90deg, transparent, #E6C97A, transparent) !important;
  opacity: .85 !important;
  height: 3px !important;
}

html[data-theme="dark"] .lg-guide__step {
  color: #E6C97A !important;
  font-weight: 800 !important;
  opacity: 1 !important;
  font-size: 13px !important;
}

/* زر الذهب: نص غامق واضح */
html[data-theme="dark"] .lg-btn--gold,
html[data-theme="dark"] .btn-submit,
.lg-btn--gold {
  color: #0B1524 !important;
}
html[data-theme="dark"] .lg-btn--gold { color: #0B1524 !important; }

/* لا تلوّن كل الـ span بلون باهت */
html[data-theme="dark"] body.legend-platform .lg-path__step span,
html[data-theme="dark"] body.legend-platform .lg-hdr__tagAr,
html[data-theme="dark"] body.legend-platform .lg-btn,
html[data-theme="dark"] body.legend-platform .lg-btn span {
  color: inherit;
}
