/* ============================================================
   DigiSafe — custom_styles.css  (Premium Overhaul)
   Single source of truth for all visual design.
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Design Tokens (Light Mode) ─────────────────────────── */
:root {
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --color-primary:   #6366F1;   /* indigo         */
  --color-secondary: #8B5CF6;   /* violet         */
  --color-accent:    #F59E0B;   /* amber          */
  --color-cyan:      #06B6D4;   /* cyan           */
  --color-danger:    #EF4444;
  --color-success:   #10B981;
  --color-pink:      #EC4899;

  --bg:           #F0F4FF;
  --bg-card:      #FFFFFF;
  --bg-topbar:    #0A0F1E;
  --bg-navbar:    rgba(255,255,255,0.92);

  --text-main:    #0F172A;
  --text-muted:   #475569;
  --text-light:   #94A3B8;
  --text-on-dark: #E2E8F0;

  --border:       #E2E8F0;
  --border-glow:  rgba(99,102,241,0.3);
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 24px rgba(0,0,0,.1);
  --shadow-lg:    0 12px 48px rgba(0,0,0,.15);
  --shadow-glow:  0 0 40px rgba(99,102,241,0.25);

  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  36px;

  --topbar-h:  44px;
  --navbar-h:  70px;

  --gradient-hero:    linear-gradient(135deg, #0A0F1E 0%, #0F172A 40%, #1a1040 100%);
  --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  --gradient-warm:    linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  --gradient-cool:    linear-gradient(135deg, #06B6D4 0%, #6366F1 100%);
  --gradient-glass:   linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
}

/* ── Dark Mode Tokens ──────────────────────────────────── */
.dark {
  --bg:        #070C1A;
  --bg-card:   #0E1628;
  --bg-navbar: rgba(10,15,30,0.94);

  --text-main:  #F1F5F9;
  --text-muted: #94A3B8;
  --text-light: #475569;

  --border:     #1E2D47;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.5);
  --shadow-md:  0 4px 24px rgba(0,0,0,.6);
  --shadow-glow: 0 0 60px rgba(99,102,241,0.35);
}

/* Prevent white flash — apply bg colour directly on html element */
html { background: #F0F4FF; }
html.dark { background: #070C1A; }

/* Smooth page-transition fade-in (replaces the flash) */
body { animation: pageIn .18s ease-out both; }
@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Malayalam Language Font Stack ──────────────────── */
/* Applied by JS when user switches to Malayalam (adds body.mal-active) */
body.mal-active {
  font-family: 'Noto Sans Malayalam', 'Manjari', 'Rachana', serif;
  font-size: 0.96em;     /* Slightly smaller than default for better density */
  line-height: 1.85;
  letter-spacing: 0.005em;
  word-break: break-word;
}
body.mal-active h1, body.mal-active h2, body.mal-active h3 {
  font-family: 'Noto Sans Malayalam', serif;
  font-weight: 700;
  line-height: 1.45;
}
body.mal-active strong { font-weight: 700; }

/* Navbar in Malayalam — prevent overflow, shrink font */
body.mal-active .nav-links a {
  font-size: .78rem;
  letter-spacing: 0;
  white-space: nowrap;
  padding: 0.3rem 0.45rem;
}
body.mal-active .nav-links {
  gap: 0.1rem;
}
body.mal-active .btn {
  font-size: .78rem;
  padding: .45rem .85rem;
}

/* Legacy selectors kept for backward compat */
:lang(ml), .lang-ml, [lang="ml"] {
  font-family: 'Noto Sans Malayalam', 'Manjari', 'Rachana', serif;
  line-height: 1.85;
  word-break: break-word;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  transition: background .4s, color .4s;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── TOP BAR ──────────────────────────────────────────────── */
.topbar {
  background: var(--bg-topbar);
  color: var(--text-on-dark);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  font-size: .8rem;
  font-family: var(--font-body);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(99,102,241,0.15);
}

.topbar-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-left .skip-link {
  background: none;
  border: none;
  color: var(--text-on-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  padding: .25rem .5rem;
  border-radius: var(--radius-sm);
  transition: color .2s;
  opacity: 0.7;
}
.topbar-left .skip-link:hover { color: var(--color-accent); opacity: 1; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Dark Mode Toggle */
#darkModeToggle {
  background: none;
  border: none;
  color: var(--text-on-dark);
  cursor: pointer;
  padding: .3rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color .2s, transform .3s;
}
#darkModeToggle:hover { color: var(--color-accent); transform: rotate(20deg); }
.hidden { display: none !important; }

/* Font Resizers */
.font-resizers {
  display: flex;
  align-items: center;
  gap: .5rem;
  border-left: 1px solid rgba(255,255,255,.15);
  padding-left: 1.25rem;
}
.font-resizers button {
  background: none;
  border: none;
  color: var(--text-on-dark);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  transition: color .2s;
  line-height: 1;
  opacity: 0.7;
}
.font-resizers button:nth-child(1) { font-size: 1.1rem; }
.font-resizers button:nth-child(2) { font-size: .95rem; }
.font-resizers button:nth-child(3) { font-size: .75rem; }
.font-resizers button:hover { color: var(--color-accent); opacity: 1; }

/* Language Selector */
.language-dropdown {
  border-left: 1px solid rgba(255,255,255,.15);
  padding-left: 1.25rem;
}
.language-dropdown select {
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  color: var(--text-on-dark);
  padding: .25rem .5rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.language-dropdown select:hover { border-color: var(--color-primary); }
.language-dropdown select option { background: #0A0F1E; color: #fff; }

/* ── NAVBAR ───────────────────────────────────────────────── */
.navbar {
  background: var(--bg-navbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  height: var(--navbar-h);
  border-bottom: 1px solid rgba(99,102,241,0.12);
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  position: sticky;
  top: var(--topbar-h);
  z-index: 99;
  transition: background .3s, box-shadow .3s;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.dark .logo {
  background: linear-gradient(135deg, #818CF8 0%, #A78BFA 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.logo .accent {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo .logo-icon { font-size: 1.5rem; -webkit-text-fill-color: initial; }

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.nav-links a {
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s, background .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width .25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 60%; }
.nav-links a:hover,
.nav-links a.active { color: var(--color-primary); background: rgba(99,102,241,.07); }
.dark .nav-links a:hover,
.dark .nav-links a.active { color: #818CF8; background: rgba(99,102,241,.12); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.btn-login {
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
  transition: all .22s;
  background: transparent;
}
.btn-login:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
  transform: translateY(-1px);
}
.dark .btn-login { color: #818CF8; border-color: #818CF8; }
.dark .btn-login:hover { background: #6366F1; color: #fff; border-color: #6366F1; }

.btn-register {
  padding: .5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 700;
  background: var(--gradient-primary);
  color: #fff;
  transition: all .22s;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
  border: none;
}
.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99,102,241,.55);
  filter: brightness(1.1);
}

.btn-logout {
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-danger);
  border: 1.5px solid var(--color-danger);
  transition: all .2s;
  background: transparent;
}
.btn-logout:hover { background: var(--color-danger); color: #fff; transform: translateY(-1px); }

/* Hamburger */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: .3rem;
}

/* ── HERO SECTION ─────────────────────────────────────────── */
.hero {
  position: relative;
  height: 88vh;
  min-height: 600px;
  overflow: hidden;
  background: #060C1A;
}

/* Animated noise grid overlay for the hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(99,102,241,0.18) 0%, transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(139,92,246,0.15) 0%, transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(6,182,212,0.12) 0%, transparent 50%);
  z-index: 3;
  pointer-events: none;
  animation: heroAura 8s ease-in-out infinite alternate;
}

@keyframes heroAura {
  0%   { opacity: 0.7; }
  100% { opacity: 1; }
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(.4,0,.2,1);
  z-index: 0;
}
.slide.active { opacity: 1; z-index: 1; }

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 8s ease-out;
}
.slide.active img { transform: scale(1); }

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(6,9,22,0.92) 0%,
    rgba(10,15,30,0.75) 50%,
    rgba(10,15,30,0.35) 100%
  );
  z-index: 2;
}

.slide-content {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
  left: 0;
  right: 0;
}

/* Module badge */
.slide-content > span:first-child {
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
  padding: .35rem 1rem !important;
  border-radius: 100px;
  background: rgba(255,255,255,0.08) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: .78rem !important;
  letter-spacing: 2px !important;
  font-family: var(--font-mono);
  margin-bottom: 1.5rem !important;
  animation: fadeUp .5s ease both;
}

.slide-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.2rem;
  text-shadow: 0 4px 32px rgba(0,0,0,.5);
  animation: fadeUp .6s .08s ease both;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 700px;
}

.slide-content p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(226,232,240,0.85);
  margin-bottom: 2.5rem;
  max-width: 580px;
  animation: fadeUp .6s .18s ease both;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  animation: fadeUp .6s .3s ease both;
}

/* Slide indicators */
.slide-dots {
  position: absolute;
  bottom: 2.5rem;
  left: 2.5rem;
  z-index: 10;
  display: flex;
  gap: .5rem;
  align-items: center;
}
.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  border: none;
  cursor: pointer;
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
  padding: 0;
}
.slide-dot.active {
  background: var(--color-accent);
  width: 32px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(245,158,11,.6);
}

/* Slide progress bar */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 20;
  animation: slideProgress 5s linear infinite;
}

@keyframes slideProgress {
  from { width: 0; }
  to   { width: 100%; }
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .2s;
}
.btn:hover::after { background: rgba(255,255,255,0.08); }

.btn-primary {
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(245,158,11,.45);
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px rgba(245,158,11,.6);
}
.btn-outline-white {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255,255,255,.4);
  color: #fff;
}
.btn-outline-white:hover {
  background: rgba(255,255,255,.18);
  border-color: #fff;
  transform: translateY(-2px);
}

/* ── CORE CAPABILITIES (UTILITIES) SECTION ────────────────── */
.section-utilities {
  padding: 1rem 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.section-utilities::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* ── STATS SECTION ────────────────────────────────────────── */
.section-stats {
  padding: 6rem 0;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.section-stats::before {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: .6rem;
  letter-spacing: -0.02em;
}
.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .35s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity .3s;
}
.stat-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md), var(--shadow-glow); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 68px; height: 68px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.5rem;
  transition: transform .3s;
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-5deg); }

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: .5rem;
  letter-spacing: -0.02em;
}
.stat-label {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-main);
  margin-bottom: .35rem;
}
.stat-note {
  font-size: .8rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ── MASCOTS SECTION ──────────────────────────────────────── */
.section-mascots {
  padding: 7rem 0;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.section-mascots::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 50%, rgba(99,102,241,0.06) 0%, transparent 50%),
    radial-gradient(circle at 90% 50%, rgba(239,68,68,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.dark .section-mascots {
  background: #070C1A;
}

.mascot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  margin-bottom: 6rem;
}
.mascot-row:last-child { margin-bottom: 0; }
.mascot-row.reverse { direction: rtl; }
.mascot-row.reverse > * { direction: ltr; }

.mascot-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.mascot-image-wrap::before {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  animation: pulseGlow 4s ease-in-out infinite;
}

.mascot-row:nth-child(2) .mascot-image-wrap::before {
  background: radial-gradient(circle, rgba(239,68,68,0.15) 0%, transparent 70%);
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(1.1); opacity: 1; }
}

.mascot-img {
  width: 300px;
  max-width: 100%;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,.3));
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), filter .5s;
  cursor: pointer;
  animation: float 6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
.mascot-img.rogue-float { animation: float 7s ease-in-out infinite .5s; }

.mascot-img:hover {
  transform: scale(1.12) rotate(-3deg);
  filter: drop-shadow(0 32px 64px rgba(0,0,0,.45));
}
.mascot-row.reverse .mascot-img:hover { transform: scale(1.12) rotate(3deg); }

.mascot-content {
  position: relative;
}

.mascot-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.mascot-content p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  line-height: 1.8;
}
.mascot-traits { display: flex; flex-direction: column; gap: .75rem; }
.mascot-trait {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-main);
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform .2s, border-color .2s;
}
.mascot-trait:hover { transform: translateX(4px); border-color: var(--color-primary); }
.mascot-row.reverse .mascot-trait:hover { transform: translateX(-4px); }

.trait-dot {
  width: 24px; height: 24px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.dot-green  { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); color: #059669; }
.dot-red    { background: linear-gradient(135deg, #FEE2E2, #FECACA); color: #DC2626; }

/* ── DASHBOARD CARD (used in utilities) ───────────────────── */
.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s, border-color .3s;
}
.dashboard-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-glow);
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  background: var(--bg-topbar);
  color: var(--text-on-dark);
  padding: 4rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo {
  background: linear-gradient(135deg, #818CF8, #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  display: inline-block;
}
.footer-brand p { color: #64748B; font-size: .875rem; line-height: 1.75; }
.footer-col h4 { font-weight: 600; margin-bottom: 1.25rem; font-size: .85rem; color: #94A3B8; text-transform: uppercase; letter-spacing: 1px; }
.footer-col a {
  display: block;
  color: #475569;
  font-size: .875rem;
  margin-bottom: .65rem;
  transition: color .2s, transform .2s;
  transform: translateX(0);
}
.footer-col a:hover { color: var(--color-accent); transform: translateX(4px); }
.footer-bottom {
  border-top: 1px solid #0F172A;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8rem;
  color: #334155;
}

/* ── AUTH PAGES ───────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #06091A 0%, #0F172A 50%, #1a0f3a 100%);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.auth-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(99,102,241,0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139,92,246,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-xl);
  padding: 2.75rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  position: relative;
  z-index: 1;
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo {
  justify-content: center;
  font-size: 1.7rem;
  background: linear-gradient(135deg, #818CF8, #A78BFA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #F1F5F9;
  text-align: center;
  margin-bottom: .4rem;
  letter-spacing: -0.02em;
}
.auth-card .subtitle {
  text-align: center;
  color: #64748B;
  font-size: .9rem;
  margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: #94A3B8;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  color: #F1F5F9;
  font-size: .95rem;
  font-family: var(--font-body);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
  background: rgba(99,102,241,.06);
}
.form-group input::placeholder { color: #475569; }
.dark .form-group input,
.dark .form-group select { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.06); }

.age-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.btn-auth {
  width: 100%;
  padding: .9rem;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: .75rem;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 4px 20px rgba(99,102,241,.45);
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,.6); filter: brightness(1.1); }

.auth-alt {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .875rem;
  color: #475569;
}
.auth-alt a { color: #818CF8; font-weight: 600; transition: color .2s; }
.auth-alt a:hover { color: #A78BFA; }

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1rem;
  display: none;
}
.alert-error   { background: rgba(239,68,68,.12); color: #FCA5A5; border: 1px solid rgba(239,68,68,.2); }
.alert-success { background: rgba(16,185,129,.12); color: #6EE7B7; border: 1px solid rgba(16,185,129,.2); }
.alert.show    { display: block; }

/* ── DASHBOARD ────────────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--topbar-h) - var(--navbar-h));
}

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: calc(var(--topbar-h) + var(--navbar-h));
  height: calc(100vh - var(--topbar-h) - var(--navbar-h));
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  padding: .75rem 1.5rem .4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.5rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--color-primary); background: rgba(99,102,241,.06); border-left-color: var(--color-primary); }
.sidebar-link.active { color: var(--color-primary); background: rgba(99,102,241,.08); border-left-color: var(--color-primary); font-weight: 600; }
.dark .sidebar-link:hover,
.dark .sidebar-link.active { color: #818CF8; background: rgba(99,102,241,.1); border-left-color: #818CF8; }
.sidebar-link span { font-size: 1.1rem; }

.main-content { padding: 2rem; background: var(--bg); }

.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.dashboard-header p { color: var(--text-muted); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card-icon { font-size: 2rem; margin-bottom: .75rem; }
.card-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}
.card-label { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; }

/* Hygiene Meter */
.meter-wrap { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.meter-svg { transform: rotate(-90deg); }
.meter-text { font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; fill: var(--text-main); }

/* ── UTILITY PAGES (About, FAQ, etc.) ─────────────────────── */
.page-hero {
  background: var(--gradient-hero);
  color: #fff;
  padding: 6rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(99,102,241,0.25) 0%, transparent 55%),
    radial-gradient(circle at 70% 50%, rgba(139,92,246,0.2) 0%, transparent 55%);
}
.page-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 700;
  margin-bottom: .75rem;
  letter-spacing: -0.02em;
  position: relative;
}
.page-hero p { font-size: 1.1rem; color: rgba(255,255,255,.75); max-width: 600px; margin: 0 auto; position: relative; }

.page-body { padding: 4rem 0; }
.page-body h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2rem 0 .75rem;
}
.page-body p { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.8; }
.page-body ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.page-body ul li { color: var(--text-muted); margin-bottom: .4rem; list-style: disc; }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: .75rem;
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item:hover { border-color: var(--border-glow); }
.faq-question {
  width: 100%;
  background: var(--bg-card);
  border: none;
  padding: 1.2rem 1.5rem;
  text-align: left;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .2s;
}
.faq-question:hover { background: rgba(99,102,241,.04); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s;
  background: var(--bg-card);
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.75;
}
.faq-answer.open { max-height: 300px; padding: .75rem 1.5rem 1.25rem; }
.faq-arrow { transition: transform .3s; }
.faq-arrow.open { transform: rotate(180deg); }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-16px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position: 200% center; }
}

.fade-up {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ───────────────────────────────────────────── */

/* ── 1100px: compact navbar ─────────────── */
@media (max-width: 1100px) {
  .navbar-container { gap: .75rem; }
  .nav-links a { padding: .45rem .65rem; font-size: .82rem; }
  .font-resizers { display: none; }
}

/* ── 1024px: switch to hamburger ─────────── */
@media (max-width: 1024px) {
  .nav-links, .nav-actions { display: none; }
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(99,102,241,.08);
    border: 1px solid rgba(99,102,241,.15);
    transition: background .2s;
  }
  .mobile-menu-toggle:hover { background: rgba(99,102,241,.18); }

  /* ── Mobile drawer ── */
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(var(--topbar-h, 36px) + var(--navbar-h, 64px));
    left: 0; right: 0;
    background: rgba(8,12,28,0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(99,102,241,.18);
    padding: .75rem 1.25rem;
    gap: .2rem;
    z-index: 999;
    animation: drawerSlide .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 16px 40px rgba(0,0,0,.45);
  }
  .nav-actions.open {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .5rem 0 .25rem;
    margin-top: .35rem;
    border-top: 1px solid rgba(99,102,241,.2);
  }
  .nav-links.open a {
    padding: .75rem 1rem;
    border-radius: 10px;
    font-size: .95rem;
    color: rgba(241,245,249,.85);
    border-left: 2px solid transparent;
    transition: background .15s, border-color .15s;
  }
  .nav-links.open a:hover,
  .nav-links.open a.active {
    background: rgba(99,102,241,.12);
    border-left-color: #818CF8;
    color: #818CF8;
  }
  .nav-actions.open .btn-login,
  .nav-actions.open .btn-logout {
    width: 100%; text-align: center;
    padding: .75rem; border-radius: 10px;
  }
  .nav-actions.open .btn-register {
    width: 100%; text-align: center;
    padding: .8rem; border-radius: 10px;
    display: block;
  }

  /* overlay backdrop — must be BELOW the drawer (drawer teleports to body at z-index:999) */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 80;
    animation: fadeIn .2s ease;
  }

  @keyframes drawerSlide {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
  }

  .topbar-left .skip-link span { display: none; }
  .hero { height: 75vh; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .slide-content { padding: 0 1.5rem; }
  .auth-card { padding: 2rem; }
  .slide-dots { left: 1.5rem; }
}

/* ── 900px: content layout ───────────────── */
@media (max-width: 900px) {
  .mascot-row { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .mascot-row.reverse { direction: ltr; }
  .mascot-trait { justify-content: center; }
  .mascot-row .mascot-image-wrap { order: -1; }
}

/* ── 680px: small phone tweaks ───────────── */
@media (max-width: 680px) {
  .language-dropdown select { font-size: .72rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { height: 38px; }
  .topbar-container { padding: 0 1rem; gap: .5rem; }
  .topbar-right { gap: .6rem; }
  .topbar-left .skip-link span { display: none; }
}

/* ── 480px: hide topbar on small phones ─── */
@media (max-width: 480px) {
  .topbar { display: none; }
  .navbar { top: 0; position: sticky; }
}

/* ── Back-to-Top Button ──────────────────── */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 6px 24px rgba(99,102,241,.45);
  z-index: 500;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#backToTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(99,102,241,.6);
}

/* ══════════════════════════════════════════════════════════════
   COMPREHENSIVE DARK MODE FIXES — Landing Page
   Fixes all cases where text or backgrounds were hardcoded to
   light values and disappeared when dark mode was activated.
══════════════════════════════════════════════════════════════ */

/* Stat icon — hardcoded #EFF6FF becomes invisible blue tint in dark */
.dark .stat-icon {
  background: rgba(99,102,241,0.15) !important;
}

/* Mascot section section-header headings */
.dark .section-mascots .section-header h2,
.dark .section-header h2 {
  color: var(--text-main);
}
.dark .section-mascots .section-header p,
.dark .section-header p {
  color: var(--text-muted);
}

/* Mascot card headings — h2 inside dashboard-card on mascots section */
.dark .section-mascots .dashboard-card h2,
.dark .section-mascots .mascot-content h2 {
  color: var(--text-main) !important;
}

/* Mascot description paragraph */
.dark .section-mascots .mascot-content p {
  color: var(--text-muted) !important;
}

/* Trait list items */
.dark .section-mascots .mascot-trait {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: var(--text-main);
}
.dark .section-mascots .mascot-trait span {
  color: var(--text-main);
}

/* Mascot image wrap — Ray's light blue tint */
.dark .section-mascots .mascot-image-wrap {
  background: rgba(99,102,241,0.08) !important;
  border-color: rgba(99,102,241,0.15) !important;
}

/* Hero section big headings */
.dark .hero-title,
.dark .slide-title,
.dark .hero h1,
.dark .slide-content h1,
.dark .slide-content h2 {
  color: #F1F5F9 !important;
}
.dark .hero-subtitle,
.dark .slide-content p {
  color: #94A3B8 !important;
}

/* Stat card hardcoded bg overrides */
.dark .stat-card {
  background: var(--bg-card);
  border-color: var(--border);
}
.dark .stat-value { color: inherit; }
.dark .stat-label { color: var(--text-main); }
.dark .stat-note  { color: var(--text-muted); }

/* Section header used outside mascots section too */
.dark .section-header h2 { color: var(--text-main); }
.dark .section-header p  { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY PANEL  (Ctrl+F2)
═══════════════════════════════════════════════════════════ */

/* Floating trigger button */
#a11y-trigger {
  position: fixed;
  bottom: 5.2rem;        /* just above Back-to-Top */
  right: 1.25rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 800;
  box-shadow: 0 4px 18px rgba(99,102,241,.45);
  transition: transform .2s, box-shadow .2s;
}
#a11y-trigger:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(99,102,241,.6); }

/* Overlay */
#a11y-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1100;
  backdrop-filter: blur(2px);
}
#a11y-overlay.open { display: block; }

/* Panel */
#a11y-panel {
  position: fixed;
  bottom: 1rem; right: 1rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  z-index: 1200;
  transform: translateY(20px) scale(.95);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .25s;
}
#a11y-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Panel header */
.a11y-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.a11y-title { font-weight: 700; font-size: .95rem; flex: 1; color: var(--text-main); }
.a11y-shortcut {
  font-size: .7rem;
  background: var(--color-primary);
  color: #fff;
  padding: .15rem .55rem;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: .03em;
}
.a11y-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.a11y-close-btn:hover { background: var(--bg-hover, #f1f5f9); color: var(--text-main); }

/* Grid of buttons */
.a11y-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  padding: .75rem;
}

/* Wide cell (spans full row) */
.a11y-cell-wide {
  grid-column: 1 / -1;
  background: var(--bg-hover, #f8fafc);
  border-radius: 10px;
  padding: .5rem .75rem;
  border: 1px solid var(--border, #e2e8f0);
}
.a11y-row-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
}
.a11y-font-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.a11y-scale-display {
  font-size: .85rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 40px;
  text-align: center;
}

/* Individual icon buttons */
.a11y-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .65rem .5rem;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-card, #fff);
  cursor: pointer;
  color: var(--text-main);
  font-size: .68rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  min-height: 72px;
}
.a11y-icon-btn:hover { background: var(--bg-hover, #f8fafc); border-color: var(--color-primary); transform: translateY(-1px); }
.a11y-icon-btn svg { width: 26px; height: 26px; flex-shrink: 0; }
.a11y-icon-btn.a11y-on {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 3px 12px rgba(99,102,241,.4);
}

/* Font-row sub-buttons */
.a11y-font-row .a11y-icon-btn {
  min-height: auto;
  padding: .4rem .6rem;
  flex-direction: row;
  gap: .4rem;
}
.a11y-font-row .a11y-icon-btn svg { width: 20px; height: 20px; }

/* Footer reset button */
.a11y-footer {
  padding: .75rem;
  border-top: 1px solid var(--border, #e2e8f0);
  display: flex;
  justify-content: center;
}
.a11y-reset-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1.4rem;
  border-radius: 30px;
  background: var(--bg-hover, #f1f5f9);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  width: 100%;
  justify-content: center;
}
.a11y-reset-btn:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Dark mode panel */
.dark #a11y-panel {
  background: #1E293B;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.dark .a11y-icon-btn { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); color: #f1f5f9; }
.dark .a11y-icon-btn:hover { background: rgba(255,255,255,.12); }
.dark .a11y-cell-wide { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
.dark .a11y-close-btn:hover { background: rgba(255,255,255,.08); }
.dark .a11y-reset-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #f1f5f9; }
.dark .a11y-reset-btn:hover { background: rgba(220,38,38,.15); color: #fca5a5; border-color: rgba(220,38,38,.3); }

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY FEATURE CLASSES
═══════════════════════════════════════════════════════════ */
.a11y-text-spacing * { letter-spacing: .12em !important; word-spacing: .2em !important; }
.a11y-line-height  * { line-height: 2 !important; }
.a11y-dyslexia, .a11y-dyslexia * {
  font-family: 'Comic Sans MS', 'Comic Sans', 'Chalkboard SE', cursive !important;
  letter-spacing: .05em;
}
.a11y-adhd p, .a11y-adhd li {
  border-left: 3px solid var(--color-primary);
  padding-left: .75rem;
  margin-bottom: 1rem;
}
.a11y-adhd p:hover, .a11y-adhd li:hover {
  background: rgba(99,102,241,.06);
  border-radius: 0 8px 8px 0;
}
.a11y-invert { filter: invert(1) hue-rotate(180deg); }
.a11y-invert img, .a11y-invert video { filter: invert(1) hue-rotate(180deg); }
.a11y-highlight-links a {
  background: rgba(99,102,241,.12) !important;
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px !important;
  border-radius: 3px !important;
  padding: .1em .25em !important;
  text-decoration: underline !important;
}
.a11y-big-cursor, .a11y-big-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='%236366f1' stroke='white' stroke-width='1.5' d='M5 3l14 9-7 1-3 6z'/%3E%3C/svg%3E") 0 0, pointer !important; }
.a11y-pause-anim *, .a11y-pause-anim *::before, .a11y-pause-anim *::after {
  animation-play-state: paused !important;
  transition: none !important;
}
.a11y-hide-images img, .a11y-hide-images video, .a11y-hide-images picture,
.a11y-hide-images [style*="background-image"] { opacity: 0 !important; visibility: hidden !important; }

/* ═══════════════════════════════════════════════════════════
   MOBILE NAV DRAWER — improved spacing & responsiveness
═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

  /* Override the existing drawer styles for better spacing */
  .nav-links.open {
    padding: 1.25rem 1rem 1.5rem !important;
    gap: .15rem !important;
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .nav-links.open a {
    display: block;
    padding: 1rem 1.2rem !important;
    font-size: 1rem !important;
    font-weight: 500;
    border-radius: 10px !important;
    border-left: 3px solid transparent !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: left !important;
    letter-spacing: 0;
    transition: background .15s, border-color .15s !important;
  }
  .nav-links.open a:last-of-type { border-bottom: none !important; }
  .nav-links.open a:hover {
    background: rgba(99,102,241,.07) !important;
    border-left-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
  }
  .nav-links.open a.active {
    background: rgba(99,102,241,.1) !important;
    border-left-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
    font-weight: 600;
  }

  /* Action buttons in drawer */
  .nav-actions.open {
    flex-direction: column !important;
    gap: .65rem !important;
    padding: 1rem 0 .5rem !important;
    margin-top: .5rem !important;
    border-top: 2px solid var(--border) !important;
    width: 100%;
  }
  .nav-actions.open .btn-login,
  .nav-actions.open .btn-logout {
    width: 100% !important;
    text-align: center !important;
    padding: .85rem 1rem !important;
    border-radius: 10px !important;
    display: block;
    font-size: .95rem !important;
    font-weight: 600;
  }
  .nav-actions.open .btn-register {
    width: 100% !important;
    text-align: center !important;
    padding: .9rem 1rem !important;
    border-radius: 10px !important;
    display: block !important;
    font-size: .95rem !important;
    font-weight: 600;
  }

  /* Dark mode: drawer bg */
  .dark .nav-links.open {
    background: rgba(10,14,30,.97) !important;
    border-color: rgba(99,102,241,.15) !important;
  }
  .dark .nav-links.open a {
    color: rgba(241,245,249,.85) !important;
    border-bottom-color: rgba(255,255,255,.06) !important;
  }
  .dark .nav-links.open a:hover,
  .dark .nav-links.open a.active {
    background: rgba(99,102,241,.12) !important;
    color: #818CF8 !important;
    border-left-color: #818CF8 !important;
  }
  .dark .nav-actions.open { border-top-color: rgba(99,102,241,.2) !important; }
}

/* ═══════════════════════════════════════════════════════════
   FONT-RESIZER LAYOUT FIX
   Use CSS var instead of changing html font-size directly,
   so em/rem layout doesn't shift when user adjusts text size.
═══════════════════════════════════════════════════════════ */
:root { --user-font-scale: 1; }
/* The JS now calls body.style.fontSize — clamp it so layout stays intact */
body { font-size: calc(1rem * var(--user-font-scale, 1)); }

/* Ensure navbar never overflows at any font size */
.navbar-container {
  flex-wrap: nowrap !important;
  overflow: visible;
}
.nav-links {
  flex-shrink: 1;
  min-width: 0;
}
.nav-links a {
  white-space: nowrap;
}
.nav-actions {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   PAGE TRANSITION — no white flash in light mode
═══════════════════════════════════════════════════════════ */
/* Light-mode background set immediately via CSS (before JS loads) */
html { background: #F1F5F9; }
html.dark { background: #070C1A; }
/* Smooth fade-in on page load — starts from light-mode bg, not white */
body {
  animation: ds-fadein .18s ease-out both;
}
@keyframes ds-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Skip-to-content scroll fix */
#main-content:focus { outline: 3px solid var(--color-primary); outline-offset: 4px; scroll-margin-top: 100px; }

