/*
 * Public theme contrast corrections.
 * Loaded after public-pages.css so explicit page styles cannot leave dark text on dark surfaces.
 */
body:not(.student-shell) {
  color: var(--pub-text, #1d1d1f);
  background: var(--pub-bg, #fbfbfd);
}
body.public-dark:not(.student-shell) {
  --pub-bg: #101116;
  --pub-surface: #191b22;
  --pub-text: #f5f6fa;
  --pub-muted: #b5bac6;
  --pub-border: rgba(255,255,255,.15);
  --pub-accent: #9fc2ff;
}
body.public-dark:not(.student-shell) main,
body.public-dark:not(.student-shell) main section,
body.public-dark:not(.student-shell) .section,
body.public-dark:not(.student-shell) .page-section {
  color: var(--pub-text);
}
body.public-dark:not(.student-shell) main p,
body.public-dark:not(.student-shell) main li,
body.public-dark:not(.student-shell) main label,
body.public-dark:not(.student-shell) main summary,
body.public-dark:not(.student-shell) main small,
body.public-dark:not(.student-shell) main .description,
body.public-dark:not(.student-shell) main .subtitle,
body.public-dark:not(.student-shell) main .muted,
body.public-dark:not(.student-shell) main .text-muted,
body.public-dark:not(.student-shell) main .meta,
body.public-dark:not(.student-shell) main .course-meta,
body.public-dark:not(.student-shell) main .section-intro,
body.public-dark:not(.student-shell) main .lead {
  color: #d4d8e2;
}
body.public-dark:not(.student-shell) main h1,
body.public-dark:not(.student-shell) main h2,
body.public-dark:not(.student-shell) main h3,
body.public-dark:not(.student-shell) main h4,
body.public-dark:not(.student-shell) main h5,
body.public-dark:not(.student-shell) main h6,
body.public-dark:not(.student-shell) main strong,
body.public-dark:not(.student-shell) main b,
body.public-dark:not(.student-shell) main .title,
body.public-dark:not(.student-shell) main .section-title {
  color: #f7f8fc;
}
body.public-dark:not(.student-shell) main a:not(.btn):not(.public-login) {
  color: #a9c9ff;
}
body.public-dark:not(.student-shell) main a:not(.btn):not(.public-login):hover {
  color: #d2e2ff;
}
body.public-dark:not(.student-shell) main .card,
body.public-dark:not(.student-shell) main .module,
body.public-dark:not(.student-shell) main .stat,
body.public-dark:not(.student-shell) main .table-wrap,
body.public-dark:not(.student-shell) main .faq-item,
body.public-dark:not(.student-shell) main .resource-card,
body.public-dark:not(.student-shell) main .course-card,
body.public-dark:not(.student-shell) main .batch-card,
body.public-dark:not(.student-shell) main .feature-card,
body.public-dark:not(.student-shell) main .content-card {
  color: #f0f2f7;
  background-color: #1a1c24;
  border-color: rgba(255,255,255,.14);
}
body.public-dark:not(.student-shell) main .card p,
body.public-dark:not(.student-shell) main .module p,
body.public-dark:not(.student-shell) main .faq-item p,
body.public-dark:not(.student-shell) main .resource-card p,
body.public-dark:not(.student-shell) main .course-card p,
body.public-dark:not(.student-shell) main .batch-card p,
body.public-dark:not(.student-shell) main .feature-card p,
body.public-dark:not(.student-shell) main .content-card p {
  color: #d4d8e2;
}
body.public-dark:not(.student-shell) main .page-hero,
body.public-dark:not(.student-shell) main .hero:not(.hero-dark) {
  color: #f7f8fc;
}
body.public-dark:not(.student-shell) main input,
body.public-dark:not(.student-shell) main textarea,
body.public-dark:not(.student-shell) main select {
  color: #f5f6fa;
  background: #171922;
  border-color: rgba(255,255,255,.22);
}
body.public-dark:not(.student-shell) main input::placeholder,
body.public-dark:not(.student-shell) main textarea::placeholder {
  color: #a9afbd;
  opacity: 1;
}
body.public-dark:not(.student-shell) main table,
body.public-dark:not(.student-shell) main td {
  color: #e7eaf1;
}
body.public-dark:not(.student-shell) main th {
  color: #f7f8fc;
  background: #252833;
}
body.public-dark:not(.student-shell) main hr,
body.public-dark:not(.student-shell) main .divider {
  border-color: rgba(255,255,255,.15);
}
body.public-dark:not(.student-shell) main .badge,
body.public-dark:not(.student-shell) main .pill,
body.public-dark:not(.student-shell) main .tag {
  color: #f1f4fa;
  border-color: rgba(255,255,255,.18);
}
body.public-dark:not(.student-shell) main .btn.primary,
body.public-dark:not(.student-shell) main .btn:not(.ghost):not(.light) {
  color: #fff;
}
body.public-dark:not(.student-shell) .public-header {
  background: rgba(24,25,31,.96);
}
body.public-dark:not(.student-shell) .public-utility-bar {
  background: #101116;
  color: #c2c6d0;
}
body.public-dark:not(.student-shell) .public-utility-phone {
  color: #f0f2f7;
}
@media (prefers-reduced-motion: reduce) {
  body:not(.student-shell) { transition: none; }
}

/* Public page hero contrast fix: contact, resources, tests and courses share .page-hero. */
html.public-dark .page-hero,
body.public-dark .page-hero,
html.public-dark main .page-hero,
body.public-dark main .page-hero {
  color: #f5f7fb !important;
  background: linear-gradient(135deg, #171e2b 0%, #202b3d 55%, #263750 100%) !important;
  border-color: rgba(255,255,255,.13) !important;
}
html.public-dark .page-hero h1,
body.public-dark .page-hero h1,
html.public-dark .page-hero h2,
body.public-dark .page-hero h2,
html.public-dark .page-hero p,
body.public-dark .page-hero p,
html.public-dark .page-hero .eyebrow,
body.public-dark .page-hero .eyebrow,
html.public-dark .page-hero .breadcrumb,
body.public-dark .page-hero .breadcrumb,
html.public-dark .page-hero span,
body.public-dark .page-hero span {
  color: #f5f7fb !important;
}
html.public-dark .page-hero p,
body.public-dark .page-hero p { color: #cbd5e1 !important; }
html.public-dark .page-hero a:not(.btn),
body.public-dark .page-hero a:not(.btn) { color: #a9cbff !important; }
html.public-dark .page-hero .btn.light,
body.public-dark .page-hero .btn.light,
html.public-dark .page-hero .btn.ghost,
body.public-dark .page-hero .btn.ghost {
  color: #f8fafc !important; background: #303b4d !important; border-color: #586579 !important;
}

/* Mobile public navigation: off-canvas drawer from the left, approximately 70% viewport width. */
@media (max-width: 920px) {
  body:not(.student-shell) .public-nav { position: relative; }
  body:not(.student-shell) .public-main-nav {
    position: fixed !important;
    z-index: 1200 !important;
    inset: 0 auto 0 0 !important;
    width: min(70vw, 360px) !important;
    max-width: 70vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 88px 18px 24px !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    border: 0 !important;
    border-right: 1px solid var(--pub-border) !important;
    border-radius: 0 20px 20px 0 !important;
    background: var(--pub-bg, #fbfbfd) !important;
    box-shadow: 18px 0 55px rgba(0,0,0,.22) !important;
    transform: translateX(-105%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform .25s ease, visibility .25s ease !important;
  }
  body:not(.student-shell).menu-open .public-main-nav {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  body:not(.student-shell) .public-main-nav > a {
    display: flex !important; width: 100% !important; min-height: 46px !important;
    align-items: center !important; padding: 12px 13px !important;
    font-size: 15px !important; border-radius: 11px !important;
  }
  body:not(.student-shell) .public-nav-actions {
    display: flex !important; flex-wrap: wrap !important; align-items: center !important;
    gap: 12px !important; padding: 14px 8px 8px !important; margin-top: 8px !important;
    border-top: 1px solid var(--pub-border) !important;
  }
  body:not(.student-shell) .public-menu-toggle { position: relative; z-index: 1201; }
  body:not(.student-shell).menu-open::after {
    content: ""; position: fixed; inset: 0; z-index: 90;
    background: rgba(8,12,20,.52); backdrop-filter: blur(2px);
  }
  body:not(.student-shell).menu-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.student-shell) .public-main-nav { transition: none !important; }
}


/* Mobile drawer layering and opaque surfaces: keep drawer above the page scrim. */
body:not(.student-shell) .public-utility-bar {
  background: var(--pub-bg, #fbfbfd);
  color: var(--pub-muted, #6e6e73);
}
body:not(.student-shell) .public-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--pub-bg, #fbfbfd);
  color: var(--pub-text, #1d1d1f);
}
body:not(.student-shell) .public-main-nav {
  color: var(--pub-text, #1d1d1f);
}
@media (max-width: 920px) {
  body:not(.student-shell) .public-main-nav {
    background: #fbfbfd !important;
    color: #1d1d1f !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    isolation: isolate;
  }
  html.public-dark body:not(.student-shell) .public-main-nav,
  body.public-dark:not(.student-shell) .public-main-nav {
    background: #171a22 !important;
    color: #f5f6fa !important;
  }
  body:not(.student-shell) .public-main-nav > a:not(.public-login) {
    color: inherit !important;
  }
  body:not(.student-shell).menu-open::after {
    z-index: 99 !important;
  }
  body:not(.student-shell).menu-open .public-header {
    z-index: 100 !important;
  }
}
