/* ==========================================================================
   SilverNest - Dark mode
   Activated by the "dark" class on <html> (set before first paint by the
   small inline script in each page <head>, so there is no white flash).
   Tokens are re-mapped first, then components that need more than a token.
   ========================================================================== */

html.dark {
  color-scheme: dark;
  background: #17131C;
  --bg: #17131C;
  --bg-alt: #1F1924;
  --surface: #28202E;
  --ink: #F4EEF6;
  --muted: #BEB4C6;
  --line: #44374D;
  --brand: #3E2F52;
  --brand-2: #5A4573;
  --brand-soft: #33283F;
  --brand-text: #F5CACB;
  --accent: #C4B2D6;
  --accent-hover: #D8CAE6;
  --accent-soft: #3A2C46;
  --on-accent: #1E1626;
  --gold: #F5CACB;
  --gold-soft: #43303A;
  --on-gold-soft: #FFE1E1;
  --ok: #86D6AA;   --ok-soft: #1D3A2C;
  --warn: #F1C76B; --warn-soft: #40330F;
  --bad: #F5A092;  --bad-soft: #47221C;
  --info: #A2CDE6; --info-soft: #1D3644;
  --on-brand-soft: #EBE2F3;
  --chart-2: #F5CACB;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow: 0 14px 40px -14px rgba(0, 0, 0, .65);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, .8);
}

/* Short, global colour cross-fade while the theme is switching */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease, stroke .45s ease !important;
}

/* Toggle icon */
html.dark .theme-toggle .i-sun { display: block; }
html.dark .theme-toggle .i-moon { display: none; }

/* Header and navigation */
html.dark .topbar { background: #120E16; border-bottom: 1px solid var(--line); }
html.dark .site-header.is-scrolled { background: rgba(31, 25, 36, .92); }
html.dark .hamburger { background: var(--brand-2); }
html.dark .logo-mark .m-bg { fill: #5A4573; }
html.dark .mobile-menu { background: #1F1924; }

/* Hero */
html.dark .hero { background: linear-gradient(180deg, #17131C 0%, #1F1924 100%); }
html.dark .blob-1 { background: #3A2C4C; opacity: .7; }
html.dark .blob-2 { background: #33283F; opacity: .8; }
html.dark .hero-label, html.dark .float-card { border: 1px solid var(--line); }
html.dark .spin-badge::before { background: #28202E; border: 1px solid var(--line); }
html.dark .collage .img-a, html.dark .collage .img-b { border-color: #1F1924; }
html.dark .avatar-stack img { border-color: #17131C; }
html.dark .info-strip .inner { background: #3E2F52; border: 1px solid #5A4573; }
html.dark .info-item.hot { color: var(--on-accent); }
html.dark .info-item.hot small { color: #3A2C46; }
html.dark .info-item.hot .ico { background: rgba(0, 0, 0, .16); color: #1E1626; }

/* Hero slider (Home 2) */
html.dark .hslide::before { background: radial-gradient(ellipse at center, rgba(15, 11, 19, .82) 0%, rgba(15, 11, 19, .66) 55%, rgba(15, 11, 19, .5) 100%); }
html.dark .enquiry-card { border-inline: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Buttons */
html.dark .btn-primary { box-shadow: 0 12px 24px -14px #000; }
html.dark .btn-outline:hover { background: var(--brand-text); color: #1E1626; }
html.dark .btn-brand { background: var(--brand-2); }
html.dark .btn-brand:hover { background: #5A4573; }
html.dark .icon-btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
html.dark .to-top { background: var(--brand-2); }
html.dark .to-top:hover { color: var(--on-accent); }
html.dark .chip[aria-pressed="true"], html.dark .chip[aria-selected="true"] { background: var(--brand-text); color: #1E1626; border-color: var(--brand-text); }
html.dark .seg button[aria-pressed="true"] { background: var(--brand-text); color: #1E1626; }

/* Cards and sections */
html.dark .section--brand, html.dark .stats-band, html.dark .page-banner { background: radial-gradient(90% 120% at 100% 0%, #4A3862 0%, transparent 60%), #2A2135; }
html.dark .feature--wide { background: #3E2F52; border-color: #5A4573; }
html.dark .feature:hover .f-ico { background: var(--brand-text); color: #1E1626; }
html.dark .feature .num { color: #44374D; }
html.dark .card-hover:hover { border-color: #5A4573; }
html.dark .plan--featured { background: #3E2F52; border-color: #5A4573; }
html.dark .about-media .ph-sub { border-color: var(--bg); }
html.dark .section--alt .about-media .ph-sub { border-color: var(--bg-alt); }
html.dark .program .thumb::after { background: linear-gradient(180deg, transparent 40%, rgba(15, 11, 19, .85)); }
html.dark .tag { background: #17131C; }
html.dark .g-item::after { background: rgba(15, 11, 19, .7); }
html.dark .pm-tile { background: #1F1924; }
html.dark .rating-box { background: #3E2F52; }
html.dark .tl-step .dot { background: #28202E; }
html.dark .pbar .fill { background: linear-gradient(90deg, #C4B2D6, #F5CACB); }

/* Illustrations and photos are toned down slightly so they do not glare */
html.dark img:not(.no-dim) { filter: brightness(.88) saturate(.95); }

/* CTA, video and modals */
html.dark .cta { background: #2A2135; }
html.dark .cta::before { background: linear-gradient(90deg, rgba(31, 23, 40, .98) 0%, rgba(31, 23, 40, .92) 45%, rgba(31, 23, 40, .35) 100%); }
html.dark .video-band::before { background: rgba(8, 10, 9, .6); }
html.dark .play-xl, html.dark .play-btn .halo { background: #28202E; }
html.dark .modal .backdrop { background: rgba(4, 7, 6, .78); }
html.dark .modal .dialog { border: 1px solid var(--line); }
html.dark .lightbox .dialog { border: 0; }
html.dark .toast { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); }

/* Forms, login and register */
html.dark .input, html.dark .select, html.dark .textarea { background-color: #1F1924; }
html.dark .input::placeholder, html.dark .textarea::placeholder { color: #9A8DA6; }
html.dark .input:focus, html.dark .select:focus, html.dark .textarea:focus { border-color: var(--brand-text); box-shadow: 0 0 0 4px #33283F; }
html.dark .check input { background: #1F1924; border-color: #9A8DA6; }
html.dark .check input:checked { background: var(--brand-text); border-color: var(--brand-text); }
html.dark .check input::after { border-color: #1E1626; }
html.dark .auth-side::before { background: linear-gradient(180deg, rgba(15, 11, 19, .3) 20%, rgba(15, 11, 19, .95) 78%); }
html.dark .demo-box { border-color: #7A5A9C; }
html.dark .pw-toggle:hover { background: #3A2C46; }

/* Dashboard */
html.dark .sidebar { background: #1A1520; border-inline-end: 1px solid var(--line); }
html.dark .side-link[aria-current="page"] { background: #33283F; color: #F4EEF6; }
html.dark .dash-top { background: rgba(23, 19, 28, .92); }
html.dark .welcome { background: #3E2F52; border-color: #5A4573; }
html.dark .vital-mini div, html.dark .cal-cell { background: #1F1924; }
html.dark .cal-cell[data-s="present"] { background: var(--ok-soft); }
html.dark .cal-cell[data-s="absent"] { background: var(--bad-soft); }
html.dark .cal-cell[data-s="half"] { background: var(--warn-soft); }
html.dark .cal-cell[data-s="holiday"] { background: var(--info-soft); }
html.dark .table th { background: #1F1924; }
html.dark .table tbody tr:hover, html.dark .notif:hover, html.dark .sched-row:hover { background: #33283F; }
html.dark .hbar .fill { background: #C4B2D6; }
html.dark .chart-tip { background: #F4EEF6; color: #17131C; }
html.dark .seg { background: #1F1924; }
html.dark .bell .badge { border-color: #17131C; }

/* Footer, 404 and Coming Soon */
html.dark .site-footer { background: #120E16; border-top: 1px solid var(--line); }
html.dark .big-404 { color: var(--brand-text); }
html.dark .cd-box { background: #28202E; }

/* Revision 2 components */
html.dark .nav-menu { background: #28202E; }
html.dark .nav-menu a:hover, html.dark .nav-menu a[aria-current="page"] { background: #33283F; }
html.dark .hamburger { background: #5A4573; }
html.dark .switch { background: #5A4573; }
html.dark .switch[aria-checked="true"] { background: #3E8E68; }
html.dark .notif.unread { background: rgba(196, 178, 214, .1); }
