/* ═══════════════════════════════════════════════════════════════
   أحمد الشعراوي — الوضع الداكن · صانع الأبطال
   إصلاح تباين النصوص (يُحمَّل أخيراً)
   ═══════════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
  --brand-950: #020F14;
  --brand-900: #061820;
  --brand-800: #F5A524;
  --brand-700: #F7B84A;
  --brand-600: #5DCDBC;
  --brand-500: #A8E4D8;
  --brand-400: #C8F0E6;
  --brand-300: #E8FAF5;

  --gold-700: #FFE8B8;
  --gold-600: #F7B84A;
  --gold-500: #F5A524;
  --gold-400: #FCD89A;
  --gold-300: #FFF3D0;
  --gold-soft: rgba(245, 165, 36, 0.20);

  --text: #EAF4F6;
  --text-strong: #FFFFFF;
  --muted: #B4C8D0;
  --muted-strong: #D2E0E6;

  --page-bg: #061820;
  --page-bg-alt: #0A2832;
  --card-bg: #0D303C;
  --card: #0D303C;
  --card-bg-strong: #12404E;
  --card-soft: #0A2430;

  --surface-soft: rgba(232, 244, 242, 0.08);
  --surface-strong: rgba(232, 244, 242, 0.14);
  --surface-highlight: rgba(245, 165, 36, 0.16);

  --border: rgba(168, 228, 216, 0.18);
  --border-strong: rgba(245, 165, 36, 0.45);

  --insight: #5DCDBC;
  --insight-strong: #C8F0E6;
  --insight-soft: rgba(91, 205, 188, 0.18);

  --primary: #E8F4F2;
  --primary-strong: #FFFFFF;
  --primary-weak: rgba(245, 165, 36, 0.18);

  --field-bg: #041C24;
  --field-text: #FFFFFF;
  --field-border: rgba(168, 228, 216, 0.28);

  --hdr-bg: #0A2832;
  --hdr-text: #FFFFFF;
  --hdr-border: rgba(91, 205, 188, 0.30);

  --btn-solid-bg: linear-gradient(135deg, #0E5C68 0%, #147A84 100%);
  --btn-solid-text: #FFFFFF;
  --btn-gold-bg: linear-gradient(135deg, #E09212 0%, #F5A524 55%, #F7B84A 100%);
  --btn-gold-text: #0A3A45;

  color-scheme: dark;
}

/* Base */
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"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] span,
html[data-theme="dark"] label,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .label {
  color: inherit;
}

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"] .acc-companion h3,
html[data-theme="dark"] .lg-path__label,
html[data-theme="dark"] .lg-axes__list strong,
html[data-theme="dark"] .lg-stat__val {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .lg-section__en,
html[data-theme="dark"] .lg-section__sub,
html[data-theme="dark"] .lg-path__kicker,
html[data-theme="dark"] .lg-path__hint,
html[data-theme="dark"] .lg-feature__text,
html[data-theme="dark"] .lg-feature__num,
html[data-theme="dark"] .lg-grade__hint,
html[data-theme="dark"] .lg-stat__lbl,
html[data-theme="dark"] .lg-axes__list em,
html[data-theme="dark"] .lg-axes__n,
html[data-theme="dark"] .auth-head__sub,
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"] .muted {
  color: #C5D8E0 !important;
}

html[data-theme="dark"] .lg-brand__sub,
html[data-theme="dark"] .acc-brand__sub,
html[data-theme="dark"] .lg-cta__en,
html[data-theme="dark"] .acc-hero__kicker {
  color: #F5A524 !important;
}

/* Links — لا تلوّن أزرار الذهب بلون ذهبي */
html[data-theme="dark"] a:not(.lg-btn):not(.acc-btn):not(.btn-submit):not(.ui-btn) {
  color: #F7B84A !important;
}
html[data-theme="dark"] a.lg-btn--gold,
html[data-theme="dark"] a.acc-btn--primary,
html[data-theme="dark"] .lg-btn--gold,
html[data-theme="dark"] .btn-submit,
html[data-theme="dark"] .acc-btn--primary {
  color: #0A3A45 !important;
  background: linear-gradient(135deg, #E09212 0%, #F5A524 55%, #F7B84A 100%) !important;
}
html[data-theme="dark"] a.lg-btn--solid,
html[data-theme="dark"] .lg-btn--solid {
  color: #FFFFFF !important;
}
html[data-theme="dark"] a.lg-btn--ghost,
html[data-theme="dark"] .lg-btn--ghost {
  color: #FFFFFF !important;
}
html[data-theme="dark"] a.lg-btn--outline,
html[data-theme="dark"] .lg-btn--outline {
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
}
html[data-theme="dark"] .lg-hdr .lg-btn--outline {
  color: #FFFFFF !important;
  border-color: rgba(168, 228, 216, 0.40) !important;
}

/* Header subjects */
html[data-theme="dark"] .lg-hdr {
  background: rgba(10, 40, 50, 0.94) !important;
  border-bottom-color: rgba(91, 205, 188, 0.30) !important;
}
html[data-theme="dark"] .lg-hdr__subjects span {
  background: rgba(91, 205, 188, 0.18) !important;
  color: #E8FAF5 !important;
  border: 1px solid rgba(91, 205, 188, 0.35) !important;
}
html[data-theme="dark"] .lg-hdr__subjects span:nth-child(2) {
  background: rgba(245, 165, 36, 0.22) !important;
  color: #FFE8B8 !important;
  border-color: rgba(245, 165, 36, 0.45) !important;
}
html[data-theme="dark"] .lg-hdr__subjects span:nth-child(3) {
  background: rgba(43, 184, 122, 0.20) !important;
  color: #B8F0D4 !important;
  border-color: rgba(43, 184, 122, 0.45) !important;
}
html[data-theme="dark"] .lg-hdr__subjects span:nth-child(4) {
  background: rgba(90, 150, 210, 0.20) !important;
  color: #C8E0F8 !important;
  border-color: rgba(90, 150, 210, 0.45) !important;
}

/* Sections / cards */
html[data-theme="dark"] .lg-path,
html[data-theme="dark"] .lg-path--feet,
html[data-theme="dark"] .lg-axes,
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-stats,
html[data-theme="dark"] .lg-guides,
html[data-theme="dark"] .lg-cta {
  background: var(--page-bg) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .lg-path__step,
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"] .auth-card,
html[data-theme="dark"] .auth-formPane,
html[data-theme="dark"] .acc-companion,
html[data-theme="dark"] .acc-stat,
html[data-theme="dark"] .acc-course,
html[data-theme="dark"] .acc-sidebar,
html[data-theme="dark"] .acc-topbar__bar,
html[data-theme="dark"] .acc-card {
  background: var(--card-bg-strong) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .lg-path__step.is-active {
  background: linear-gradient(180deg, rgba(245, 165, 36, 0.18), var(--card-bg-strong)) !important;
  border-color: #F5A524 !important;
}

html[data-theme="dark"] .lg-path__num {
  background: rgba(91, 205, 188, 0.18) !important;
  color: #C8F0E6 !important;
}
html[data-theme="dark"] .lg-path__step.is-active .lg-path__num {
  background: linear-gradient(135deg, #E09212, #F5A524) !important;
  color: #0A3A45 !important;
}

html[data-theme="dark"] .input,
html[data-theme="dark"] select.input,
html[data-theme="dark"] textarea.input {
  background: var(--field-bg) !important;
  color: #FFFFFF !important;
  border-color: var(--field-border) !important;
}

/* Account */
html[data-theme="dark"] .acc-hero {
  background:
    linear-gradient(135deg, rgba(10, 58, 69, 0.98), rgba(6, 24, 32, 0.98)) !important;
  color: #fff !important;
  border-color: transparent !important;
}
html[data-theme="dark"] .acc-hero h1,
html[data-theme="dark"] .acc-hero__sub,
html[data-theme="dark"] .acc-journey__label {
  color: #FFFFFF !important;
}
html[data-theme="dark"] .acc-hero__kicker,
html[data-theme="dark"] .acc-journey__num {
  color: #F5A524 !important;
}
html[data-theme="dark"] .acc-journey__hint {
  color: rgba(255, 255, 255, 0.72) !important;
}
html[data-theme="dark"] .acc-journey__step {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}
html[data-theme="dark"] .acc-sidebar {
  background: #12404E !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .acc-nav__item,
html[data-theme="dark"] .acc-nav__item:link,
html[data-theme="dark"] .acc-nav__item:visited,
html[data-theme="dark"] .acc-nav__lbl {
  color: #FFFFFF !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .acc-nav__ico,
html[data-theme="dark"] .acc-nav__ico svg {
  color: #A8E4D8 !important;
  stroke: currentColor !important;
}
html[data-theme="dark"] .acc-nav__item.is-active {
  color: #FFE8B8 !important;
  background: rgba(245, 165, 36, 0.18) !important;
}
html[data-theme="dark"] .acc-nav__item.is-active .acc-nav__lbl {
  color: #FFE8B8 !important;
}
html[data-theme="dark"] .acc-student,
html[data-theme="dark"] .acc-pill {
  color: #EAF4F6 !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(168, 228, 216, 0.22) !important;
}

/* Footer */
html[data-theme="dark"] .lg-footer {
  background: #020F14 !important;
  color: rgba(234, 244, 246, 0.88) !important;
}
html[data-theme="dark"] .lg-footer__slogan {
  background: rgba(245, 165, 36, 0.22) !important;
  color: #FFF3D0 !important;
  border-color: rgba(245, 165, 36, 0.45) !important;
}
html[data-theme="dark"] .lg-footer__tag,
html[data-theme="dark"] .lg-footer__copy,
html[data-theme="dark"] .lg-footer__dev {
  color: rgba(210, 224, 230, 0.85) !important;
}
html[data-theme="dark"] .lg-footer__nav a,
html[data-theme="dark"] .lg-footer__link,
html[data-theme="dark"] .lg-footer__phone {
  color: #F7B84A !important;
}
html[data-theme="dark"] .lg-footer__heading {
  color: #A8E4D8 !important;
}

html[data-theme="dark"] .phy-toast {
  background: var(--card-bg-strong) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
html[data-theme="dark"] .phy-toast__title {
  color: #FFFFFF !important;
}
html[data-theme="dark"] .phy-toast__msg {
  color: #C5D8E0 !important;
}
