/* ==========================================================================
   الشيمي في الرياضيات — نظام التصميم الأساسي
   ألوان الهوية: كحلي الشعار + وردي الشعار، خلفية ورق رسم بياني
   ========================================================================== */

:root {
  --shm-navy-950: #0a1824;
  --shm-navy-900: #0f2233;
  --shm-navy-800: #16324a;
  --shm-navy-700: #1f4361;
  --shm-navy-600: #2a5679;
  --shm-navy-500: #3d6e96;
  --shm-navy-300: #9db8cf;
  --shm-navy-100: #e3ecf4;
  --shm-navy-50: #f1f5f9;
  --shm-rose-700: #9c3349;
  --shm-rose-600: #b8435a;
  --shm-rose-500: #cf5670;
  --shm-rose-300: #eba2b2;
  --shm-rose-100: #fbe8ed;
  --shm-amber-600: #c7861c;
  --shm-amber-500: #e3a33a;
  --shm-amber-100: #fcf1dc;
  --shm-mint-600: #178a66;
  --shm-mint-100: #dcf3ea;
  --shm-red-600: #c2413b;

  --bg: #f5f3ee;
  --bg-grid: rgba(22, 50, 74, .055);
  --bg-grid-strong: rgba(22, 50, 74, .1);
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --surface-3: #eef2f6;
  --line: #e3e1d9;
  --line-strong: #cfd2cf;
  --ink: #13293b;
  --ink-soft: #3f5466;
  --ink-mute: #6b7c8b;
  --primary: var(--shm-navy-800);
  --primary-hover: var(--shm-navy-700);
  --on-primary: #ffffff;
  --accent: var(--shm-rose-600);
  --accent-hover: var(--shm-rose-700);
  --accent-soft: var(--shm-rose-100);
  --on-accent: #ffffff;
  --ring: 0 0 0 3px rgba(184, 67, 90, .28);

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-1: 0 1px 2px rgba(15, 34, 51, .06), 0 1px 1px rgba(15, 34, 51, .04);
  --shadow-2: 0 12px 32px -14px rgba(15, 34, 51, .22);
  --shadow-3: 0 32px 64px -24px rgba(15, 34, 51, .34);

  --font-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Reem Kufi', 'IBM Plex Sans Arabic', sans-serif;
  --font-math: 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif;
  --container: 1200px;
  --hdr-h: 76px;

  /* أسماء توافقية تستخدمها السكربتات والأنماط المضمّنة */
  --page-bg: var(--bg);
  --page-bg-alt: var(--surface-2);
  --card-bg: var(--surface);
  --card-bg-strong: var(--surface);
  --card-soft: var(--surface-2);
  --surface-soft: var(--surface-2);
  --surface-strong: var(--surface-3);
  --surface-highlight: #edf2f7;
  --text: var(--ink);
  --text-strong: var(--ink);
  --muted: var(--ink-mute);
  --muted-strong: var(--ink-soft);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --brand-border: rgba(22, 50, 74, .22);
  --brand: var(--primary);
  --brand-400: var(--shm-navy-500);
  --brand-500: var(--shm-navy-600);
  --brand-600: var(--shm-navy-700);
  --brand-700: var(--shm-navy-800);
  --brand-900: var(--shm-navy-950);
  --primary-strong: var(--shm-navy-900);
  --btn-solid-bg: var(--primary);
  --btn-solid-text: #ffffff;
  --btn-success-bg: var(--shm-mint-600);
  --btn-success-text: #ffffff;
  --success: var(--shm-mint-600);
  --success-soft-bg: var(--shm-mint-100);
  --success-soft-border: #a9dcc8;
  --danger: var(--shm-red-600);
  --danger-soft-bg: #fbe7e5;
  --danger-soft-border: #f0b9b4;
  --warning: #9a620a;
  --warning-soft-bg: var(--shm-amber-100);
  --warning-soft-border: #f0d29b;
  --gold-500: var(--shm-amber-500);
  --gold-border: #ecc985;
  --shadow-soft: var(--shadow-1);
  --shadow: var(--shadow-2);
  --shadow-strong: var(--shadow-3);
  --radius-lg-compat: var(--radius-lg);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b1722;
  --bg-grid: rgba(157, 184, 207, .05);
  --bg-grid-strong: rgba(157, 184, 207, .09);
  --surface: #112231;
  --surface-2: #0e1d2a;
  --surface-3: #18304a;
  --line: #203649;
  --line-strong: #2d4a64;
  --ink: #e8eef5;
  --ink-soft: #b9c8d6;
  --ink-mute: #8ba1b5;
  --primary: #3d6e96;
  --primary-hover: #4b80ab;
  --accent: #df6680;
  --accent-hover: #ea7f96;
  --accent-soft: rgba(223, 102, 128, .14);
  --surface-highlight: #18304a;
  --brand-border: rgba(157, 184, 207, .25);
  --brand-400: #9db8cf;
  --brand-500: #8fb1cd;
  --brand-600: #a9c5dd;
  --brand-700: #cfe0ee;
  --success: #3cc495;
  --success-soft-bg: rgba(23, 138, 102, .18);
  --success-soft-border: rgba(60, 196, 149, .35);
  --danger: #f07a73;
  --danger-soft-bg: rgba(194, 65, 59, .18);
  --danger-soft-border: rgba(240, 122, 115, .35);
  --warning: #f0bf6a;
  --warning-soft-bg: rgba(227, 163, 58, .14);
  --warning-soft-border: rgba(240, 191, 106, .32);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, .55);
  --shadow-3: 0 34px 70px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease !important;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.shm-site {
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
}
img, svg, video, canvas, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.35; margin: 0; color: var(--ink); font-weight: 600; }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.container { width: min(var(--container), 100% - 40px); margin-inline: auto; }
.shm-math { font-family: var(--font-math); font-style: italic; letter-spacing: .01em; direction: ltr; unicode-bidi: isolate; }
.shm-ico { flex: none; display: inline-block; vertical-align: middle; }
.shm-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Scrollbar ---------- */
html { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--shm-navy-300); }

/* ---------- Logo handling ---------- */
.platform-logo__img { display: block; object-fit: contain; }
.platform-logo__img--dark { display: none !important; }
html[data-theme="dark"] .platform-logo__img--light { display: none !important; }
html[data-theme="dark"] .platform-logo__img--dark { display: block !important; }
/* بلاطة بيضاء دائماً تعرض الشعار الأصلي */
html .shm-logoTile .platform-logo__img--light,
html[data-theme="dark"] .shm-logoTile .platform-logo__img--light { display: block !important; }
html .shm-logoTile .platform-logo__img--dark,
html[data-theme="dark"] .shm-logoTile .platform-logo__img--dark { display: none !important; }
/* فوق الخلفيات الكحلية دائماً الشعار الفاتح */
.shm-onDark .platform-logo__img--light { display: none !important; }
.shm-onDark .platform-logo__img--dark { display: block !important; }
.shm-onDark .shm-logoTile .platform-logo__img--light { display: block !important; }
.shm-onDark .shm-logoTile .platform-logo__img--dark { display: none !important; }

.shm-logoTile {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  padding: 5px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(22, 50, 74, .1);
  box-shadow: 0 6px 16px -8px rgba(15, 34, 51, .35);
}
.shm-logoTile img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Buttons ---------- */
.shm-btn {
  --b-bg: var(--surface);
  --b-fg: var(--ink);
  --b-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid var(--b-bd);
  background: var(--b-bg);
  color: var(--b-fg);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.shm-btn:hover { transform: translateY(-1px); }
.shm-btn:active { transform: translateY(0); }
.shm-btn--primary { --b-bg: var(--primary); --b-fg: #fff; --b-bd: var(--primary); box-shadow: 0 10px 22px -12px rgba(22, 50, 74, .7); }
.shm-btn--primary:hover { --b-bg: var(--primary-hover); --b-bd: var(--primary-hover); }
.shm-btn--accent { --b-bg: var(--accent); --b-fg: #fff; --b-bd: var(--accent); box-shadow: 0 10px 22px -12px rgba(184, 67, 90, .8); }
.shm-btn--accent:hover { --b-bg: var(--accent-hover); --b-bd: var(--accent-hover); }
.shm-btn--ghost { --b-bg: transparent; --b-bd: var(--line-strong); }
.shm-btn--ghost:hover { --b-bd: var(--ink); }
.shm-btn--light { --b-bg: rgba(255, 255, 255, .08); --b-fg: #fff; --b-bd: rgba(255, 255, 255, .28); }
.shm-btn--light:hover { --b-bg: rgba(255, 255, 255, .16); --b-bd: rgba(255, 255, 255, .5); }
.shm-btn--lg { min-height: 54px; padding: 0 26px; font-size: 16.5px; border-radius: 14px; }
.shm-btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.shm-btn--block { width: 100%; }
.shm-btn[disabled], .shm-btn.is-disabled { opacity: .55; pointer-events: none; }

/* ---------- Theme switch (segmented) ---------- */
.shm-theme {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  flex: none;
}
.shm-theme__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-mute);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.shm-theme__btn svg { width: 17px; height: 17px; }
.shm-theme__btn:hover { color: var(--ink); }
.shm-theme__btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }
html[data-theme="dark"] .shm-theme__btn.is-active { background: var(--shm-navy-700); color: #fff; }
.shm-theme--onDark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); }
.shm-theme--onDark .shm-theme__btn { color: rgba(255, 255, 255, .6); }
.shm-theme--onDark .shm-theme__btn:hover { color: #fff; }
.shm-theme--onDark .shm-theme__btn.is-active { background: #fff; color: var(--shm-navy-800); }

/* ---------- Public header ---------- */
.shm-hdr {
  position: sticky;
  top: 0;
  z-index: 900;
  padding: 14px 0 0;
}
.shm-hdr__island {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--hdr-h);
  padding: 10px 12px 10px 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.shm-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.shm-brand__text { display: grid; line-height: 1.25; min-width: 0; }
.shm-brand__name { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink); white-space: nowrap; }
.shm-brand__tag { font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.shm-hdr__actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.shm-hdr__actions .shm-btn.is-current { box-shadow: var(--ring); }
.shm-hdr--static { position: relative; z-index: 70; padding-bottom: 14px; }
.shm-hdr__chip {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 260px;
  padding: 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 700;
  color: var(--ink); background: var(--surface-2, var(--bg)); border: 1px solid var(--line);
}
.shm-hdr__chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shm-hdr__chip .shm-ico { flex: none; color: var(--accent); }
@media (max-width: 760px) {
  .shm-hdr__chip { display: none; }
}

.shm-hdr__menu { display: flex; align-items: center; gap: 10px; }
.shm-hdr__burger {
  display: none;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.shm-hdr__burger:hover { border-color: var(--ink); }
.shm-hdr__burger[aria-expanded="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.shm-hdr__burgerLines { position: relative; display: block; width: 20px; height: 14px; }
.shm-hdr__burgerLines i {
  position: absolute;
  inset-inline-end: 0;
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease, width .25s ease, top .25s ease;
}
.shm-hdr__burgerLines i:nth-child(1) { top: 0; }
.shm-hdr__burgerLines i:nth-child(2) { top: 6px; width: 70%; }
.shm-hdr__burgerLines i:nth-child(3) { top: 12px; }
.shm-hdr__burger[aria-expanded="true"] .shm-hdr__burgerLines i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.shm-hdr__burger[aria-expanded="true"] .shm-hdr__burgerLines i:nth-child(2) { opacity: 0; width: 0; }
.shm-hdr__burger[aria-expanded="true"] .shm-hdr__burgerLines i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .shm-hdr__island { position: relative; }
  .shm-hdr__actions { gap: 8px; }
  .shm-hdr__burger { display: grid; }
  .shm-hdr__menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline: 0;
    z-index: 5;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    transform-origin: top center;
  }
  .shm-hdr__menu.is-open { display: flex; animation: shmMenuIn .22s cubic-bezier(.2, .8, .2, 1) both; }
  .shm-hdr__menu .shm-btn {
    --b-bg: transparent;
    --b-bd: transparent;
    --b-fg: var(--ink);
    width: 100%;
    min-height: 54px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 10px;
    border-radius: 13px;
    font-size: 16px;
    box-shadow: none;
  }
  .shm-hdr__menu .shm-btn:hover { transform: none; --b-bg: var(--surface-2); }
  .shm-hdr__menu .shm-btn svg {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 9px;
    border-radius: 11px;
    background: var(--surface-3);
    color: var(--accent);
  }
  .shm-hdr__menu .shm-btn::after {
    content: '';
    width: 8px;
    height: 8px;
    margin-inline-start: auto;
    margin-inline-end: 6px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .45;
  }
  .shm-hdr__menu .shm-btn.is-current { box-shadow: none; --b-bg: var(--accent-soft); --b-fg: var(--accent); }
  .shm-hdr__menu .shm-btn--accent,
  .shm-hdr__menu .shm-btn--primary { --b-bg: var(--accent); --b-fg: #fff; order: 5; margin-top: 4px; }
  .shm-hdr__menu .shm-btn--primary { --b-bg: var(--primary); }
  .shm-hdr__menu .shm-btn--accent:hover { --b-bg: var(--accent-hover); }
  .shm-hdr__menu .shm-btn--primary:hover { --b-bg: var(--primary-hover); }
  .shm-hdr__menu .shm-btn--accent svg,
  .shm-hdr__menu .shm-btn--primary svg { background: rgba(255, 255, 255, .16); color: #fff; }
  .shm-hdr__menu .shm-btn--accent.is-current,
  .shm-hdr__menu .shm-btn--primary.is-current { --b-fg: #fff; }
  .shm-hdr__menu .shm-btn--accent.is-current { --b-bg: var(--accent); }
  .shm-hdr__menu .shm-btn--primary.is-current { --b-bg: var(--primary); }
  .shm-hdr__menu a[href$="logout.php"] { order: 9; margin-top: 4px; border-top: 1px dashed var(--line); border-radius: 0 0 13px 13px; --b-fg: var(--danger); }
  .shm-hdr__menu a[href$="logout.php"] svg { background: var(--danger-soft-bg); color: var(--danger); }
}
@keyframes shmMenuIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .shm-hdr { padding-top: 8px; }
  .shm-hdr > .container { width: calc(100% - 20px); }
  .shm-hdr__island { gap: 8px; padding: 8px 10px; border-radius: 16px; min-height: 62px; }
  .shm-hdr .shm-brand { gap: 8px; flex: 1 1 auto; }
  .shm-hdr .shm-brand__text { overflow: hidden; }
  .shm-hdr .shm-logoTile { width: 42px; height: 42px; border-radius: 12px; padding: 4px; }
  .shm-brand__name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .shm-brand__tag { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
  .shm-hdr__actions { gap: 6px; flex: none; }
  .shm-hdr__burger { width: 40px; height: 40px; border-radius: 11px; }
  .shm-hdr .shm-theme { padding: 2px; border-radius: 11px; }
  .shm-hdr .shm-theme__btn { width: 32px; height: 32px; }
  .shm-hdr .shm-theme:has(.is-active) .shm-theme__btn.is-active { display: none; }
}
@media (max-width: 380px) {
  .shm-brand__tag { display: none; }
  .shm-brand__name { font-size: 15px; }
  .shm-hdr .shm-logoTile { width: 38px; height: 38px; }
}

/* ---------- Section heading (shared) ---------- */
.shm-sec { padding: 96px 0; position: relative; }
.shm-sec--tight { padding: 64px 0; }
.shm-sec__head { display: grid; gap: 14px; max-width: 720px; margin-bottom: 44px; }
.shm-sec__head--center { margin-inline: auto; text-align: center; justify-items: center; }
.shm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .02em;
  color: var(--accent);
}
.shm-eyebrow__idx {
  font-family: var(--font-math);
  font-style: italic;
  font-size: 15px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--accent-soft);
  direction: ltr;
}
.shm-sec__title { font-size: clamp(28px, 3.6vw, 42px); font-weight: 700; letter-spacing: -.01em; }
.shm-sec__title em { font-style: normal; color: var(--accent); }
.shm-sec__sub { color: var(--ink-soft); font-size: 18px; line-height: 1.9; }

/* ---------- Footer ---------- */
body:has(> .shm-ftr) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
body:has(> .shm-ftr) > main { margin-bottom: 40px; }
body:has(> .shm-ftr) > .shm-ftr { margin-top: auto !important; flex-shrink: 0; }
.shm-ftr {
  --ftr-bg: linear-gradient(180deg, #ffffff 0%, #f6f3ec 100%);
  --ftr-grid: rgba(19, 41, 59, .05);
  --ftr-sigma: rgba(19, 41, 59, .045);
  --ftr-ink: var(--shm-navy-900);
  --ftr-soft: #3f5466;
  --ftr-mute: #6b7c8b;
  --ftr-accent: var(--shm-rose-600);
  --ftr-card: #ffffff;
  --ftr-card-hover: #fdf4f6;
  --ftr-line: #e3e1d9;
  --ftr-quote: rgba(184, 67, 90, .06);
  --ftr-shadow: 0 10px 24px -16px rgba(19, 41, 59, .35);
  position: relative;
  margin-top: 40px;
  color: var(--ftr-soft);
  background: var(--ftr-bg);
  border-top: 1px solid var(--ftr-line);
  overflow: hidden;
}
html[data-theme="dark"] .shm-ftr {
  --ftr-bg: linear-gradient(180deg, #0d1c29 0%, #08131d 100%);
  --ftr-grid: rgba(157, 184, 207, .06);
  --ftr-sigma: rgba(255, 255, 255, .035);
  --ftr-ink: #f1f5f9;
  --ftr-soft: #c3d1de;
  --ftr-mute: #8ba1b5;
  --ftr-accent: #f08aa0;
  --ftr-card: rgba(255, 255, 255, .05);
  --ftr-card-hover: rgba(255, 255, 255, .1);
  --ftr-line: rgba(255, 255, 255, .1);
  --ftr-quote: rgba(255, 255, 255, .04);
  --ftr-shadow: 0 10px 24px -16px rgba(0, 0, 0, .8);
}
.shm-ftr::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--ftr-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ftr-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  pointer-events: none;
}
.shm-ftr__sigma {
  position: absolute;
  inset-inline-end: -30px;
  bottom: -110px;
  font-family: var(--font-math);
  font-size: 420px;
  line-height: 1;
  color: var(--ftr-sigma);
  pointer-events: none;
  user-select: none;
}
.shm-ftr__rule {
  position: relative;
  height: 4px;
  background: linear-gradient(90deg, var(--shm-rose-600) 0 33%, var(--shm-navy-500) 33% 66%, var(--shm-amber-500) 66%);
}
.shm-ftr__in { position: relative; padding: 40px 0 22px; }
.shm-ftr__grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 36px; }
.shm-ftr__grid--solo { grid-template-columns: auto minmax(0, 1fr); }
.shm-ftr__grid .shm-ftr__quote { justify-self: center; margin: 0; }
.shm-ftr__grid--solo .shm-ftr__quote { justify-self: end; }
.shm-ftr__side { display: grid; gap: 10px; align-content: center; max-width: 440px; }
.shm-ftr__side .shm-ftr__head { margin-bottom: 0; }
.shm-ftr__side .shm-ftr__phones { display: flex; flex-wrap: wrap; gap: 8px; }
.shm-ftr__brandRow { display: flex; align-items: center; gap: 18px; }
.shm-ftr__logo.shm-logoTile {
  width: 96px;
  height: 112px;
  padding: 10px 12px;
  border-radius: 24px;
  border: 1px solid var(--ftr-line);
  box-shadow: 0 0 0 4px var(--ftr-card), 0 0 0 8px rgba(184, 67, 90, .18), 0 22px 40px -18px rgba(10, 24, 36, .55);
  transition: transform .25s ease;
}
.shm-ftr__logo.shm-logoTile:hover { transform: translateY(-3px) rotate(-2deg); }
.shm-ftr__name { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--ftr-ink); display: block; line-height: 1.3; }
.shm-ftr__teacher { font-size: 15.5px; color: var(--ftr-accent); font-weight: 600; }
.shm-ftr__quote {
  max-width: 560px;
  padding: 14px 18px;
  border-inline-start: 3px solid var(--shm-rose-500);
  background: var(--ftr-quote);
  border-radius: 0 12px 12px 0;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ftr-soft);
}
.shm-ftr__head {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--ftr-ink);
}

.shm-ftr__socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.shm-ftr__soc {
  --soc: var(--shm-navy-800);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px 5px 14px;
  border-radius: 999px;
  background: var(--ftr-card);
  border: 1px solid var(--ftr-line);
  box-shadow: var(--ftr-shadow);
  color: var(--ftr-ink);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}
.shm-ftr__soc:hover { transform: translateY(-2px); border-color: var(--soc); background: var(--ftr-card-hover); }
.shm-ftr__soc:focus-visible { outline: 2px solid var(--soc); outline-offset: 2px; }
.shm-ftr__socIco {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soc);
  color: #fff;
}
.shm-ftr__socIco svg { width: 18px; height: 18px; }
.shm-ftr__socIco.is-img {
  background: #fff;
  border: 1px solid rgba(19, 41, 59, .12);
  padding: 5px;
  overflow: hidden;
}
.shm-ftr__socIco.is-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shm-ftr__socName { white-space: nowrap; }
.shm-ftr__soc--facebook  { --soc: #1877f2; }
.shm-ftr__soc--youtube   { --soc: #ff0000; }
.shm-ftr__soc--instagram { --soc: #e1306c; }
.shm-ftr__soc--instagram .shm-ftr__socIco:not(.is-img) { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.shm-ftr__soc--tiktok    { --soc: #111111; }
.shm-ftr__soc--whatsapp  { --soc: #25d366; }
.shm-ftr__soc--telegram  { --soc: #229ed9; }
.shm-ftr__soc--x         { --soc: #111111; }
.shm-ftr__soc--linkedin  { --soc: #0a66c2; }
html[data-theme="dark"] .shm-ftr__soc--tiktok .shm-ftr__socIco:not(.is-img),
html[data-theme="dark"] .shm-ftr__soc--x .shm-ftr__socIco:not(.is-img) { background: #fff; color: #111; }
html[data-theme="dark"] .shm-ftr__soc--tiktok,
html[data-theme="dark"] .shm-ftr__soc--x { --soc: #ffffff; }

.shm-ftr__phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ftr-card);
  border: 1px solid var(--ftr-line);
  box-shadow: var(--ftr-shadow);
  color: var(--ftr-ink);
  font-weight: 700;
  direction: ltr;
  transition: background-color .2s ease, border-color .2s ease;
}
.shm-ftr__phone .shm-ico { color: var(--ftr-accent); }
.shm-ftr__phone:hover { background: var(--ftr-card-hover); border-color: var(--ftr-accent); }
.shm-ftr__phones { display: grid; gap: 10px; justify-items: start; }
.shm-ftr__bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--ftr-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ftr-mute);
}
.shm-ftr__bottom p { margin: 0; }
@media (max-width: 960px) {
  .shm-ftr__grid, .shm-ftr__grid--solo { grid-template-columns: 1fr; gap: 20px; justify-items: center; text-align: center; }
  .shm-ftr__grid .shm-ftr__quote, .shm-ftr__grid--solo .shm-ftr__quote { justify-self: stretch; max-width: none; }
  .shm-ftr__side { justify-items: center; max-width: none; }
  .shm-ftr__socials, .shm-ftr__side .shm-ftr__phones { justify-content: center; }
}
@media (max-width: 560px) {
  .shm-ftr__in { padding-top: 32px; }
  .shm-ftr__brandRow { text-align: start; }
  .shm-ftr__logo.shm-logoTile { width: 76px; height: 90px; }
  .shm-ftr__name { font-size: 23px; }
  .shm-ftr__bottom { justify-content: center; text-align: center; }
}

/* ---------- Toasts (auth notices) ---------- */
.phy-toast {
  position: fixed;
  z-index: 3000;
  top: max(18px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 16px 16px 20px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: shmToastIn .35s cubic-bezier(.2, .8, .2, 1) both;
}
.phy-toast.is-leaving { animation: shmToastOut .3s ease both; }
.phy-toast__icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: var(--danger);
}
.phy-toast--success .phy-toast__icon { background: var(--success); }
.phy-toast__title { display: block; font-family: var(--font-display); font-size: 16px; margin-bottom: 2px; }
.phy-toast__msg, .phy-toast__list { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.8; }
.phy-toast__list { padding-inline-start: 18px; }
.phy-toast__close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--ink-mute);
  font-size: 18px;
  line-height: 1;
}
.phy-toast__progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--surface-3); }
.phy-toast__progress span {
  display: block;
  height: 100%;
  background: var(--danger);
  transform-origin: right;
  animation: shmToastBar var(--toast-duration, 6000ms) linear forwards;
}
.phy-toast--success .phy-toast__progress span { background: var(--success); }
.phy-toast.is-paused .phy-toast__progress span { animation-play-state: paused; }
@keyframes shmToastIn { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shmToastOut { to { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes shmToastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Shared UI controls (used by modals & scripts) ---------- */
.ui-input, .ui-select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 15.5px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ui-input:focus, .ui-select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  font-weight: 700;
  font-size: 15.5px;
  background: var(--surface-3);
  color: var(--ink);
  transition: filter .2s ease, transform .2s ease;
}
.ui-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.ui-btn:disabled { opacity: .6; transform: none; }
.ui-btn--solid { background: var(--primary); color: #fff; }
.ui-btn--success { background: var(--success); color: #fff; }
.ui-note--warning {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--warning-soft-bg);
  border: 1px solid var(--warning-soft-border);
  color: var(--warning);
  font-weight: 600;
}
.ui-msg--success, .ui-msg--error {
  padding: 10px 14px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  line-height: 1.8;
}
.ui-msg--success { background: var(--success-soft-bg); color: var(--success); border: 1px solid var(--success-soft-border); }
.ui-msg--error { background: var(--danger-soft-bg); color: var(--danger); border: 1px solid var(--danger-soft-border); }

/* ---------- Modal dialogs rendered with inline styles ---------- */
#redeemModal > div,
#accModalBackdrop > div {
  border-radius: 22px !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-3) !important;
  padding: 30px 26px 26px !important;
}
#redeemModal > div::before,
#accModalBackdrop > div::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--shm-navy-600));
}
#redeemModal h3,
#accModalBackdrop h3 { font-family: var(--font-display); font-size: 20px !important; }
#redeemModal,
#accModalBackdrop { background: rgba(10, 24, 36, .62) !important; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.shm-modal { position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; padding: 16px; }
.shm-modal__box {
  position: relative;
  overflow: hidden;
  width: min(440px, 100%);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
}
.shm-modal__close {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--ink-soft);
}
.shm-modal__close:hover { color: var(--accent); }
.shm-modal__ico {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 12px;
}
.shm-modal__title { margin: 0 0 6px; }
.shm-modal__sub { margin: 0 0 18px; color: var(--ink-mute); font-size: 14.5px; }
.shm-modal .ui-input, .shm-modal .ui-select, .shm-modal .ui-note--warning, #redeemMsg { margin-bottom: 12px; text-align: start; }
.shm-modal .ui-input[dir="ltr"] { text-align: center; letter-spacing: .12em; font-family: var(--font-math); font-size: 18px; }

/* ---------- How-to video (home) ---------- */
.howto-video { padding: 40px 0 96px; }
.howto-video__head { display: grid; justify-items: center; text-align: center; gap: 12px; margin-bottom: 32px; }
.howto-video__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
}
.howto-video__title { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; }
.howto-video__sub { color: var(--ink-mute); max-width: 640px; }
.howto-video__frame {
  position: relative;
  max-width: 980px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  background: var(--shm-navy-950);
  border: 8px solid var(--surface);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--line);
}
.howto-video__frame iframe, .howto-video__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nimr-divider { display: none; }

/* ---------- Reduced motion / lite ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.student-perf-lite .shm-hdr__island { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
