/* ═══════════════════════════════════════════════════════════════
   Chem Lab Pro — Platform / Home / Header / Footer
   ═══════════════════════════════════════════════════════════════ */

/* ——— Header ——— */
.chem-hdr {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--hdr-bg);
  color: var(--hdr-text);
  box-shadow: var(--shadow);
  transition: background .25s ease, color .2s ease;
}
.chem-hdr__strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  padding: 6px 12px;
  background: var(--hdr-strip-bg);
  font-family: var(--font-science);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--hdr-strip-text);
  border-bottom: 1px solid var(--hdr-border);
}
.chem-hdr__strip em {
  font-style: normal;
  color: var(--primary);
  font-weight: 700;
}
.chem-hdr__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding-block: 10px;
}
.chem-hdr__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--hdr-text);
  min-width: 0;
}
.chem-hdr__logo,
.chem-hdr__logoFallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
  background: #0B0614;
  display: grid;
  place-items: center;
  color: var(--primary);
  padding: 2px;
}
.chem-hdr__logoFallback svg { width: 24px; height: 24px; }
.chem-hdr__name {
  display: block;
  font-weight: 800;
  font-size: 1.12rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.chem-hdr__tag {
  display: block;
  font-size: 0.78rem;
  color: var(--hdr-muted);
  margin-top: 2px;
  font-weight: 600;
}
.chem-hdr__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.chem-hdr__theme {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}
.chem-hdr__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chem-hdr__link {
  color: var(--hdr-text);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background .2s ease, color .2s ease;
}
.chem-hdr__link:hover { background: var(--surface-soft); color: var(--primary); }
.chem-hdr__cta { padding: 10px 16px !important; font-size: 0.92rem !important; }
.chem-hdr__burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: transparent;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex: 0 0 auto;
}
.chem-hdr__burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}
.chem-hdr__drawer {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #12081F;
}
.chem-hdr__drawer.is-open { display: block; }
.chem-hdr__drawerBox {
  display: grid;
  gap: 10px;
  padding: 14px 16px 18px;
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}
@media (max-width: 820px) {
  .chem-hdr__inner {
    gap: 10px;
  }
  .chem-hdr__nav { display: none; }
  .chem-hdr__burger { display: flex; }
  .chem-hdr__brand {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    padding-inline-end: 6px;
  }
  .chem-hdr__text {
    min-width: 0;
    overflow: hidden;
  }
  .chem-hdr__name {
    max-width: min(42vw, 150px);
    display: block;
  }
  .chem-hdr__tag {
    display: none;
  }
  .chem-hdr__logo,
  .chem-hdr__logoFallback {
    width: 40px;
    height: 40px;
  }
  .chem-hdr__actions {
    gap: 8px;
    margin-inline-start: auto;
  }
  .chem-hdr__theme .theme-switch--pro,
  .chem-hdr .theme-switch--pro {
    --ts-w: 58px;
    --ts-h: 32px;
    --ts-pad: 2px;
    min-width: 58px;
    min-height: 32px;
  }
  .chem-hdr__theme .theme-switch__btn,
  .chem-hdr .theme-switch--pro .theme-switch__btn {
    min-height: 32px;
  }
  .chem-hdr__theme .theme-switch__knob-ico svg,
  .chem-hdr .theme-switch--pro .theme-switch__knob-ico svg {
    width: 15px;
    height: 15px;
  }
  .chem-hdr__strip { font-size: 0.65rem; gap: 8px; }
}
@media (max-width: 420px) {
  .chem-hdr__name {
    display: block;
    max-width: min(36vw, 120px);
    font-size: 0.95rem;
  }
  .chem-hdr__theme .theme-switch--pro,
  .chem-hdr .theme-switch--pro {
    --ts-w: 52px;
    --ts-h: 30px;
    min-width: 52px;
    min-height: 30px;
  }
}

/* ——— Atmosphere ——— */
.chem-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.55;
}
.chem-bg__hex { width: 100%; height: 100%; opacity: 0.4; }
.chem-bg__floats {
  position: absolute;
  inset: 0;
}
.chem-bg__floats span {
  position: absolute;
  font-family: var(--font-science);
  color: rgba(91, 44, 138, 0.18);
  font-weight: 600;
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  animation: chemFloat 18s ease-in-out infinite;
  animation-delay: calc(var(--i) * -1.1s);
}
.chem-bg__floats span:nth-child(odd) { left: 8%; top: calc(var(--i) * 6%); }
.chem-bg__floats span:nth-child(even) { right: 10%; top: calc(var(--i) * 5.5%); }
.chem-bg__mega {
  position: absolute;
  bottom: -40px;
  left: -20px;
  font-size: 18rem;
  opacity: 0.04;
  color: var(--chem-violet);
  line-height: 1;
}
@keyframes chemFloat {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-18px); opacity: 1; }
}
body.chem-lab > *:not(.chem-bg),
body.chemistry-pro > *:not(.chem-bg) {
  position: relative;
  z-index: 1;
}

/* ——— Hero ——— */
.chem-hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: center;
  background: var(--hero-bg);
  color: var(--hero-text);
  overflow: hidden;
  padding: 48px 0 64px;
  transition: background .25s ease, color .2s ease;
}
.chem-hero__bg { position: absolute; inset: 0; pointer-events: none; }
.chem-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
}
.chem-hero__glow--1 {
  width: 340px; height: 340px;
  background: #7B3FA8;
  top: -80px; right: -60px;
  animation: chemPulse 8s ease-in-out infinite;
}
.chem-hero__glow--2 {
  width: 280px; height: 280px;
  background: #5B2C8A;
  bottom: -60px; left: 10%;
  animation: chemPulse 10s ease-in-out infinite reverse;
}
@keyframes chemPulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.12); opacity: 0.55; }
}
.chem-hero__orbits {
  position: absolute;
  inset: 10% 5%;
  pointer-events: none;
}
.chem-hero__orbits i {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  inset: 0;
  animation: chemOrbit 24s linear infinite;
}
.chem-hero__orbits i:nth-child(2) { inset: 12%; animation-duration: 32s; animation-direction: reverse; }
.chem-hero__orbits i:nth-child(3) { inset: 24%; animation-duration: 40s; }
@keyframes chemOrbit { to { transform: rotate(360deg); } }
.chem-hero__mols {
  position: absolute;
  inset: 0;
  font-family: var(--font-science);
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.95rem;
}
.chem-hero__mols span {
  position: absolute;
}
.chem-hero__mols span:nth-child(1) { top: 18%; right: 12%; }
.chem-hero__mols span:nth-child(2) { top: 62%; right: 22%; }
.chem-hero__mols span:nth-child(3) { top: 28%; left: 8%; }
.chem-hero__mols span:nth-child(4) { bottom: 20%; left: 18%; }
.chem-hero__mols span:nth-child(5) { top: 12%; left: 40%; }

.chem-hero__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
  width: min(1120px, calc(100% - 32px));
  max-width: 100%;
}
.chem-hero__enLine {
  font-family: var(--font-science);
  letter-spacing: 0.08em;
  color: var(--hero-accent);
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  animation: chemFadeUp .7s ease both;
}
.chem-hero__brand {
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--hero-text);
  animation: chemFadeUp .75s ease both .05s;
}
.chem-hero__teacher {
  margin: 0 0 14px;
  color: var(--hero-accent);
  font-weight: 700;
  animation: chemFadeUp .75s ease both .1s;
}
.chem-hero__desc {
  margin: 0 0 28px;
  max-width: 480px;
  color: var(--hero-muted);
  line-height: 1.8;
  font-size: 1.05rem;
  font-weight: 500;
  animation: chemFadeUp .75s ease both .15s;
}
.chem-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: chemFadeUp .8s ease both .2s;
}
@keyframes chemFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.chem-hero__photo {
  position: relative;
  min-height: 380px;
  border-radius: 0;
  overflow: hidden;
  animation: chemFadeUp .9s ease both .15s;
}
.chem-hero__photo img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
.chem-hero__photoFallback {
  min-height: 380px;
  display: grid;
  place-items: center;
  gap: 8px;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(91,44,138,.35));
  font-size: 4rem;
  color: #E9D5F5;
}
.chem-hero__photoFallback svg { width: 72px; height: 72px; }
.chem-hero__photoCap {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 16px 18px;
  background: linear-gradient(transparent, rgba(18, 8, 31, 0.88));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chem-hero__photoCapEn {
  font-family: var(--font-science);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9A8E0;
}
.chem-hero__photoCapAr { font-weight: 700; font-size: 1rem; }

@media (max-width: 900px) {
  .chem-hero { min-height: auto; padding: 24px 0 40px; }
  .chem-hero__stage {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .chem-hero__photo {
    order: -1;
  }
  .chem-hero__photo,
  .chem-hero__photo img,
  .chem-hero__photoFallback {
    min-height: min(52vw, 320px);
    width: 100%;
  }
  .chem-hero__copy {
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .chem-hero__desc {
    margin-inline: auto;
  }
  .chem-hero__actions {
    justify-content: center;
  }
  .chem-hero__brand { font-size: clamp(2rem, 9vw, 2.8rem); }
}

/* ——— Path ——— */
.chem-path {
  padding: 72px 0 40px;
  background: var(--section-bg);
}
.chem-path__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
}
.chem-path__step {
  flex: 1 1 140px;
  max-width: 200px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
  position: relative;
  color: var(--text);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.chem-path__step:hover,
.chem-path__step.is-active {
  transform: translateY(-4px);
  border-color: var(--chem-violet);
  box-shadow: 0 14px 32px var(--chem-glow);
}
.chem-path__sym {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--font-science);
  font-size: 0.75rem;
  color: var(--chem-violet-soft);
  opacity: 0.7;
}
.chem-path__num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}
.chem-path__label {
  display: block;
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.chem-path__hint {
  display: block;
  font-size: 0.92rem;
  color: var(--muted-strong);
  font-weight: 600;
}
.chem-path__sym {
  font-weight: 800;
  color: var(--primary);
  opacity: 1;
}
.chem-path__connector {
  align-self: center;
  font-family: var(--font-science);
  color: var(--chem-violet-soft);
  font-size: 1.2rem;
  padding: 0 2px;
}
@media (max-width: 700px) {
  .chem-path__connector { display: none; }
  .chem-path__step { max-width: none; flex-basis: calc(50% - 10px); }
}

/* ——— Stats ——— */
.chem-stats {
  padding: 24px 0 56px;
  background: var(--section-bg);
}
.chem-stats__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.chem-stat {
  background: linear-gradient(160deg, #2B1248, #1A0B2E);
  color: #fff;
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
}
.chem-stat__val {
  font-size: 1.9rem;
  font-weight: 800;
  font-family: var(--font-science);
}
.chem-stat__lbl {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}
@media (max-width: 700px) {
  .chem-stats__row { grid-template-columns: 1fr; }
}

/* ——— Axes ——— */
.chem-axes {
  padding: 56px 0;
  background: var(--section-alt-bg);
}
.chem-axes__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.chem-axes__list li {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  color: var(--text);
  transition: border-color .2s ease, transform .2s ease;
}
.chem-axes__list li:hover {
  border-color: var(--chem-violet);
  transform: translateY(-3px);
}
.chem-axes__el {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(145deg, #2B1248, #5B2C8A);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--font-science);
  position: relative;
  box-shadow: 0 4px 12px rgba(43, 18, 72, 0.25);
}
.chem-axes__el small {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #FFFFFF;
  opacity: 0.95;
}
.chem-axes__el strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1;
}
.chem-axes__list b {
  display: block;
  color: var(--text-strong);
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.chem-axes__list em {
  font-style: normal;
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}
@media (max-width: 900px) {
  .chem-axes__list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .chem-axes__list { grid-template-columns: 1fr; }
}

/* ——— Features ——— */
.chem-features {
  padding: 64px 0;
  background: var(--section-bg);
}
.chem-features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}
.chem-feature {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  color: var(--text);
  transition: transform .25s ease, box-shadow .25s ease;
}
.chem-feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.chem-feature__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  min-height: 48px;
}
.chem-feature__z {
  font-family: var(--font-science);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
}
.chem-feature__sym {
  position: absolute;
  font-size: 3.2rem;
  font-family: var(--font-science);
  font-weight: 800;
  color: rgba(91, 44, 138, 0.18);
  left: 12px;
  bottom: 8px;
  line-height: 1;
  pointer-events: none;
}
.chem-feature__ico {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.chem-feature__mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #2B1248;
  color: #fff;
  display: grid;
  place-items: center;
}
.chem-feature__mark svg { width: 22px; height: 22px; }
.chem-feature__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-strong);
}
.chem-feature__text {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.75;
  font-size: 0.98rem;
  font-weight: 600;
}

/* ——— Grades ——— */
.chem-grades {
  padding: 64px 0;
  background: var(--section-alt-bg);
}
.chem-grades__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.chem-grade {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.chem-grade:hover {
  transform: translateY(-5px);
  border-color: var(--chem-violet);
  box-shadow: 0 18px 40px var(--chem-glow);
}
/* شارة صغيرة خارج منطقة القص */
.chem-grade__z {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-family: var(--font-science);
  font-size: 0.8rem;
  font-weight: 800;
  color: #FFFFFF;
  background: rgba(20, 8, 34, 0.78);
  padding: 4px 10px;
  border-radius: 999px;
}
/* إخفاء الرمز الكبير فوق الصورة حتى تظهر كاملة */
.chem-grade__symBg {
  display: none !important;
}
.chem-grade__media {
  min-height: 220px;
  height: auto;
  aspect-ratio: 4 / 3;
  background: var(--page-bg-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chem-grade__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  display: block;
  background: var(--page-bg);
}
.chem-grade__mediaEmpty {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-family: var(--font-science);
  font-weight: 800;
  color: #FFFFFF;
  background: linear-gradient(145deg, #2B1248, #5B2C8A);
}
.chem-grade__body { padding: 18px 20px 20px; }
.chem-grade__name {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-strong);
}
.chem-grade__hint {
  margin: 0 0 12px;
  color: var(--muted-strong);
  font-size: 0.95rem;
  font-weight: 600;
}
.chem-grade__cta {
  color: var(--primary);
  font-weight: 800;
  font-size: 0.98rem;
}

.chem-grades-marquee {
  overflow: hidden;
  width: 100%;
  margin-top: 8px;
  padding: 8px 0 4px;
  direction: ltr;
}
.chem-grades-marquee__track {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  animation: chemGradesMarquee 48s linear infinite;
  will-change: transform;
}
.chem-grades-marquee__group {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 18px;
  padding-right: 18px;
}
.chem-grades-marquee:hover .chem-grades-marquee__track {
  animation-play-state: paused;
}
@keyframes chemGradesMarquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
a.chem-grade {
  flex: 0 0 280px;
  width: 280px;
  max-width: 280px;
}
.chem-grade-page {
  padding: 28px 0 72px;
  background: var(--section-alt-bg);
  min-height: 60vh;
}
.chem-grade-page__bar {
  margin-bottom: 18px;
}
.chem-grade-courses__empty {
  margin: 0;
  color: var(--muted-strong);
  font-weight: 700;
}
.chem-grade-courses__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.chem-home-course {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
a.chem-home-course:hover {
  transform: translateY(-4px);
  border-color: var(--chem-violet);
  box-shadow: 0 16px 32px var(--chem-glow);
}
.chem-home-course__media {
  aspect-ratio: 16 / 10;
  background: var(--page-bg-alt);
  overflow: hidden;
}
.chem-home-course__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chem-home-course__fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  background: linear-gradient(145deg, #2B1248, #5B2C8A);
  color: #fff;
}
.chem-home-course__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}
.chem-home-course__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-strong);
}
.chem-home-course__lock {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 700;
}
.chem-home-course__go {
  color: var(--primary);
  font-weight: 800;
}
@media (max-width: 900px) {
  a.chem-grade {
    flex: 0 0 min(78vw, 280px);
    width: min(78vw, 280px);
    max-width: min(78vw, 280px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chem-grades-marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .chem-grades-marquee__track {
    animation: none;
  }
}

/* ——— CTA ——— */
.chem-cta {
  padding: 40px 0 80px;
  background: var(--section-bg);
}
.chem-cta__box {
  background: linear-gradient(135deg, #1A0B2E 0%, #5B2C8A 100%);
  color: #fff;
  border-radius: 24px;
  padding: 48px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.chem-cta__kicker {
  font-family: var(--font-science);
  color: rgba(233, 213, 245, 0.75);
  margin: 0 0 12px;
  letter-spacing: 0.06em;
}
.chem-cta__title {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
}
.chem-cta__sub {
  margin: 0 auto 24px;
  max-width: 480px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
}
.chem-cta .chem-btn--solid {
  background: #FFFFFF !important;
  color: #1A0B2E !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18) !important;
  border: 0 !important;
  font-weight: 800 !important;
}
.chem-cta .chem-btn--solid:hover {
  background: #F3ECF9 !important;
  color: #140822 !important;
}

/* ——— Footer (base) ——— */
.chem-ft {
  margin-top: 48px;
  position: relative;
  overflow: hidden;
}
.chem-ft__topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  padding: 10px 16px;
  font-family: var(--font-science);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.chem-ft__topbar em {
  font-style: normal;
  font-weight: 700;
}
.chem-ft__inner {
  padding: 0 0 22px;
}
.chem-ft__main {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr 1.1fr;
  gap: 28px 32px;
  padding: 36px 0 28px;
}
.chem-ft__brand {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.chem-ft__logoWrap {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  text-decoration: none;
}
.chem-ft__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.chem-ft__platform {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.3;
}
.chem-ft__subject {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
}
.chem-ft__tag {
  margin: 0;
  line-height: 1.7;
  font-size: 0.95rem;
  font-weight: 600;
  max-width: 280px;
}
.chem-ft__heading {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  position: relative;
  padding-bottom: 10px;
}
.chem-ft__heading::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 3px;
  border-radius: 99px;
  background: var(--primary);
}
.chem-ft__nav,
.chem-ft__social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.chem-ft__nav a,
.chem-ft__socialLink,
.chem-ft__phone {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color .2s ease, transform .2s ease, background .2s ease;
}
.chem-ft__nav a:hover,
.chem-ft__socialLink:hover,
.chem-ft__phone:hover {
  transform: translateX(-3px);
}
.chem-ft__socialLink,
.chem-ft__phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.chem-ft__socialIco {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.chem-ft__socialIco img,
.chem-ft__socialIco svg {
  width: 18px;
  height: 18px;
}
.chem-ft__phoneIco {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.chem-ft__phones { display: grid; gap: 10px; }
.chem-ft__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  font-size: 0.9rem;
  font-weight: 600;
}
.chem-ft__rights,
.chem-ft__dev { margin: 0; }
@media (max-width: 960px) {
  .chem-ft__main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .chem-ft__main { grid-template-columns: 1fr; gap: 22px; }
  .chem-ft__brand { flex-direction: row; }
}

/* Auth page shared polish when chem theme on */
body.chem-lab .auth-page,
body.chemistry-pro .auth-page {
  padding: 36px 0 64px;
}

/* Lab décor (ambient) */
.chem-lab-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  color: rgba(91, 44, 138, 0.12);
  overflow: hidden;
}
.chem-lab-decor__flask--l {
  position: absolute;
  width: 72px;
  bottom: 12%;
  right: 4%;
  opacity: 0.7;
}
.chem-lab-decor__tube--r {
  position: absolute;
  width: 40px;
  top: 22%;
  left: 3%;
  opacity: 0.55;
}
.student-perf-lite .chem-lab-decor,
.android-native-app .chem-lab-decor { display: none !important; }

/* Floating WhatsApp button — يسار الصفحة، ثابت مع التمرير */
.home-wa-fab {
  position: fixed !important;
  inset: unset !important;
  top: auto !important;
  right: auto !important;
  left: max(18px, env(safe-area-inset-left, 0px)) !important;
  bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 2147483000;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #25D366;
  border: 4px solid #25D366;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7), 0 12px 28px rgba(15, 23, 42, 0.28);
  overflow: visible;
  transition: transform 0.2s ease;
  animation: home-wa-blink 1.25s ease-in-out infinite;
}
.home-wa-fab::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: home-wa-ring 1.25s ease-out infinite;
  pointer-events: none;
}
.home-wa-fab img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.home-wa-fab:hover,
.home-wa-fab:focus-visible {
  transform: translateY(-3px) scale(1.04);
  animation-play-state: paused;
}
@keyframes home-wa-blink {
  0%, 100% {
    background: #25D366;
    border-color: #25D366;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.75), 0 10px 24px rgba(15, 23, 42, 0.22);
    filter: brightness(1);
  }
  50% {
    background: #128C7E;
    border-color: #6ce59a;
    box-shadow: 0 0 18px 8px rgba(37, 211, 102, 0.55), 0 10px 24px rgba(15, 23, 42, 0.22);
    filter: brightness(1.25);
  }
}
@keyframes home-wa-ring {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-wa-fab,
  .home-wa-fab::after {
    animation: none;
  }
}
@media (max-width: 560px) {
  .home-wa-fab {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
    width: 80px;
    height: 80px;
  }
}
