/* ==========================================================================
   XPROTECT — LIGHT THEME
   Activated by <html data-theme="light"> (toggle in the header, saved in
   localStorage "xp-theme", or ?theme=light). Dark stays the default.
   Every rule is scoped to html[data-theme="light"] so dark mode is untouched.
   ========================================================================== */

html[data-theme="light"] {
  color-scheme: light;
  --bg-dark: #f5f6fb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.86);
  --border-subtle: rgba(15, 23, 42, 0.10);
  --border-light: rgba(15, 23, 42, 0.16);
  --border-glow: rgba(37, 99, 235, 0.30);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-glow-blue: 0 10px 30px -14px rgba(37, 99, 235, 0.35);
  --shadow-glow-green: 0 10px 30px -14px rgba(16, 185, 129, 0.35);
  --shadow-glow-purple: 0 10px 30px -14px rgba(124, 58, 237, 0.35);

  /* light tokens shared by the rules below */
  --lt-bg: #f5f6fb;
  --lt-surface: #ffffff;
  --lt-surface-2: #f1f3f9;
  --lt-line: rgba(15, 23, 42, 0.10);
  --lt-line-2: rgba(15, 23, 42, 0.16);
  --lt-text: #0f172a;
  --lt-text-2: #334155;
  --lt-muted: #64748b;
  --lt-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -14px rgba(15, 23, 42, 0.16);
}

/* smooth switch only while toggling (never on first paint) */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease, fill 0.2s ease !important;
}

html[data-theme="light"] body {
  background: var(--lt-bg) !important;
  color: var(--lt-text) !important;
}
html[data-theme="light"] ::selection { background: rgba(37, 99, 235, 0.18); color: inherit; }

/* ---------- Top info bar ---------- */
html[data-theme="light"] .top-info-bar {
  background: #ffffff !important;
  border-bottom-color: var(--lt-line) !important;
  color: var(--lt-text) !important;
}
html[data-theme="light"] .top-info-bar::after { opacity: 0.55; }
html[data-theme="light"] .ip-display {
  background: var(--lt-surface-2);
  border-color: var(--lt-line);
  color: var(--lt-muted) !important;
}
html[data-theme="light"] .ip-display:hover { color: var(--lt-text) !important; border-color: var(--lt-line-2); background: #e9edf5; }
html[data-theme="light"] .ip-display i { color: #2563eb !important; }
html[data-theme="light"] .ip-display #user-ip-address { color: var(--lt-text); }
html[data-theme="light"] .dns-status-pill { box-shadow: none; }
html[data-theme="light"] .dns-status-pill.status-protected {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}
html[data-theme="light"] .dns-status-pill.status-unprotected {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}
html[data-theme="light"] .dns-status-pill.status-checking {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1e40af !important;
}
html[data-theme="light"] .dns-brand-name { color: inherit; font-weight: 600; }
html[data-theme="light"] .status-protected i.status-icon { color: #059669; }
html[data-theme="light"] .status-unprotected i.status-icon { color: #dc2626; }
html[data-theme="light"] .dns-setup-btn {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff !important;
}
html[data-theme="light"] .dns-setup-btn:hover { background: #b91c1c; }
html[data-theme="light"] .dns-status i.fa-rotate-right { color: var(--lt-muted) !important; }

/* ---------- Header & menu ---------- */
html[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom: 1px solid var(--lt-line) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}
html[data-theme="light"] .nav-brand,
html[data-theme="light"] .nav-brand span { color: var(--lt-text) !important; }
html[data-theme="light"] .menu li a { color: #334155 !important; }
html[data-theme="light"] .menu li a:hover,
html[data-theme="light"] .menu li.active > a { color: #fff !important; }
html[data-theme="light"] .submenu {
  background: #ffffff !important;
  border: 1px solid var(--lt-line) !important;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.22) !important;
}
html[data-theme="light"] .submenu li a:hover { background: #f1f5f9 !important; }
html[data-theme="light"] .submenu li a,
html[data-theme="light"] .submenu li a:hover { color: var(--lt-text) !important; }
html[data-theme="light"] .tool-title { color: var(--lt-text) !important; }
html[data-theme="light"] .tool-desc { color: var(--lt-muted) !important; }
html[data-theme="light"] .tool-info i { color: #2563eb !important; }
html[data-theme="light"] .hamburger-line,
html[data-theme="light"] .toggle-btn .icon span { background: #0f172a !important; }
html[data-theme="light"] .hamburger-circle {
  background: transparent !important;
}

html[data-theme="light"] .theme-toggle {
  background: #ffffff;
  border-color: var(--lt-line-2);
  color: #334155;
}
html[data-theme="light"] .theme-toggle:hover { background: #f1f5f9; }

html[data-theme="light"] #login-button,
html[data-theme="light"] .btn-webauth {
  background: #0f172a !important;
  border-color: #0f172a !important;
  color: #fff !important;
  box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.5) !important;
}
html[data-theme="light"] #login-button:hover { background: #1e293b !important; }
html[data-theme="light"] #dropdown {
  background: #ffffff !important;
  border: 1px solid var(--lt-line) !important;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.25) !important;
}
html[data-theme="light"] .wallet-item { color: var(--lt-text) !important; }
html[data-theme="light"] .wallet-item:hover:not(.cursor-default):not([style*="cursor: default"]) { background: #eef2ff !important; color: #3730a3 !important; }
html[data-theme="light"] .wallet-divider { background: var(--lt-line) !important; }

@media (max-width: 991px) {
  html[data-theme="light"] .site-header { background: #ffffff !important; }
  html[data-theme="light"] .menu {
    background: #ffffff !important;
    border-top: 1px solid var(--lt-line) !important;
    box-shadow: 0 30px 50px -20px rgba(15, 23, 42, 0.25) !important;
  }
  html[data-theme="light"] .menu li:not(:last-child) { border-color: var(--lt-line) !important; }
  html[data-theme="light"] .menu li a:active { color: #1d4ed8 !important; }
  html[data-theme="light"] .submenu { background: transparent !important; border: 0 !important; box-shadow: none !important; }
}

/* ---------- Footer ---------- */
html[data-theme="light"] .site-footer {
  background: #ffffff !important;
  border-top: 1px solid var(--lt-line) !important;
}
html[data-theme="light"] .footer-logo,
html[data-theme="light"] .footer-col h4 { color: var(--lt-text) !important; }
html[data-theme="light"] .footer-desc { color: var(--lt-text-2) !important; }
html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-legal-btn { color: #475569 !important; }
html[data-theme="light"] .footer-links a:hover,
html[data-theme="light"] .footer-legal-btn:hover { color: #1d4ed8 !important; }
html[data-theme="light"] .footer-bottom { border-color: var(--lt-line) !important; color: var(--lt-muted) !important; }
html[data-theme="light"] .footer-social-btn {
  background: var(--lt-surface-2);
  border-color: var(--lt-line);
  color: #475569 !important;
}
html[data-theme="light"] .footer-social-btn:hover { background: #2563eb; border-color: #2563eb; color: #fff !important; }
html[data-theme="light"] .footer-status-pill { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }

/* ---------- Modals (shared) ---------- */
html[data-theme="light"] .modal-overlay { background: rgba(15, 23, 42, 0.45); }
html[data-theme="light"] .modal-container {
  background: #ffffff !important;
  border-color: var(--lt-line) !important;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.45) !important;
  color: var(--lt-text);
}
html[data-theme="light"] .modal-header { border-bottom-color: var(--lt-line) !important; }
html[data-theme="light"] .modal-header h2,
html[data-theme="light"] .modal-header h3,
html[data-theme="light"] .modal-title { color: var(--lt-text) !important; }
html[data-theme="light"] .modal-body { color: var(--lt-text-2); }
html[data-theme="light"] .modal-close-btn { color: var(--lt-muted) !important; background: var(--lt-surface-2) !important; border-color: var(--lt-line) !important; }
html[data-theme="light"] .modal-close-btn:hover { color: var(--lt-text) !important; }

/* ---------- Under attack modal ---------- */
html[data-theme="light"] .ua-fab { box-shadow: 0 8px 20px -10px rgba(153, 27, 27, 0.6); }
html[data-theme="light"] .ua-modal { background: #ffffff !important; border-color: #fecaca !important; }
html[data-theme="light"] .ua-head { background: linear-gradient(180deg, #fef2f2, #ffffff) !important; border-bottom-color: var(--lt-line) !important; }
html[data-theme="light"] .ua-title h2 { color: var(--lt-text); }
html[data-theme="light"] .ua-title p { color: var(--lt-muted); }
html[data-theme="light"] .ua-title-icon { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
html[data-theme="light"] .ua-label { color: var(--lt-text); }
html[data-theme="light"] .ua-label i, html[data-theme="light"] .ua-hint { color: var(--lt-muted); }
html[data-theme="light"] .ua-input,
html[data-theme="light"] .ua-textarea {
  background: #ffffff;
  border-color: var(--lt-line-2);
  color: var(--lt-text);
}
html[data-theme="light"] .ua-input::placeholder, html[data-theme="light"] .ua-textarea::placeholder { color: #94a3b8; }
html[data-theme="light"] .ua-input:focus, html[data-theme="light"] .ua-textarea:focus { background: #fff; border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14); }
html[data-theme="light"] .ua-seg { background: var(--lt-surface-2); border-color: var(--lt-line); }
html[data-theme="light"] .ua-seg label { color: #475569; }
html[data-theme="light"] .ua-seg label:hover { color: var(--lt-text); }
html[data-theme="light"] .ua-seg input:checked + label { color: #fff; }
html[data-theme="light"] .ua-note { background: var(--lt-surface-2); border-color: var(--lt-line); color: #475569; }
html[data-theme="light"] .ua-note i { color: #7c3aed; }
html[data-theme="light"] .ua-auth.is-in { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
html[data-theme="light"] .ua-auth.is-out { background: #fffbeb; border-color: #fde68a; color: #92400e; }
html[data-theme="light"] .ua-status.is-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
html[data-theme="light"] .ua-status.is-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
html[data-theme="light"] .ua-btn-ghost { background: #ffffff; border-color: var(--lt-line-2); color: #334155; }
html[data-theme="light"] .ua-btn-ghost:hover { background: var(--lt-surface-2); color: var(--lt-text); }
@media (max-width: 640px) {
  html[data-theme="light"] .ua-actions { background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 22%); }
}

/* ---------- Generic form controls ---------- */
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color-scheme: light;
}

/* ==========================================================================
   PAGE FIXES (on top of the generated /assets/css/light/<page>.css)
   ========================================================================== */

/* ---------- Home ---------- */
html[data-theme="light"][data-page="home"] {
  --primary-orange: #e06a00;
  --text-dim: #475569;
}
html[data-theme="light"][data-page="home"] #text_block-1112-47,
html[data-theme="light"][data-page="home"] #text_block-1112-47 * { color: #ffffff !important; }
html[data-theme="light"][data-page="home"] .text-gradient {
  background-image: linear-gradient(135deg, #0f172a 0%, #334155 100%) !important;
}
html[data-theme="light"][data-page="home"] .hero-btn-secondary {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
html[data-theme="light"][data-page="home"] .hero-btn-secondary:hover { background: #f1f5f9 !important; }
html[data-theme="light"][data-page="home"] .hero-stats-row { background: #ffffff; border-color: rgba(15, 23, 42, 0.1); box-shadow: var(--lt-card-shadow); }
html[data-theme="light"][data-page="home"] .sherlock-audit-card { box-shadow: 0 30px 60px -25px rgba(15, 23, 42, 0.45) !important; }
html[data-theme="light"][data-page="home"] .hero-bg-glow { opacity: 0.6; }
html[data-theme="light"][data-page="home"] .orange-gradient { background-image: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important; }
html[data-theme="light"][data-page="home"] #new_columns-1038-47 h1,
html[data-theme="light"][data-page="home"] #new_columns-1038-47 h2,
html[data-theme="light"][data-page="home"] #new_columns-1038-47 .ct-headline,
html[data-theme="light"][data-page="home"] #new_columns-1038-47 .ct-text-block { color: #ffffff !important; }
html[data-theme="light"][data-page="home"] #_tabs-1149-47,
html[data-theme="light"][data-page="home"] #_tabs_contents-1181-47 { border: 1px solid rgba(15, 23, 42, 0.08) !important; box-shadow: var(--lt-card-shadow) !important; }

/* ---------- Shared accents on light surfaces ---------- */
html[data-theme="light"] .text-gradient,
html[data-theme="light"] .gradient-text {
  background-image: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* ---------- Tailwind utility pages (My DNS, Bug Hunter) ---------- */
html[data-theme="light"] .text-white { color: #0f172a !important; }
html[data-theme="light"] .text-gray-100,
html[data-theme="light"] .text-gray-200 { color: #1e293b !important; }
html[data-theme="light"] .text-gray-300 { color: #334155 !important; }
html[data-theme="light"] .text-gray-400 { color: #475569 !important; }
html[data-theme="light"] .text-gray-500 { color: #64748b !important; }
html[data-theme="light"] .text-blue-200,
html[data-theme="light"] .text-blue-300,
html[data-theme="light"] .text-blue-400 { color: #1d4ed8 !important; }
html[data-theme="light"] .text-green-200,
html[data-theme="light"] .text-green-300,
html[data-theme="light"] .text-green-400,
html[data-theme="light"] .text-green-500 { color: #047857 !important; }
html[data-theme="light"] .text-teal-400 { color: #0f766e !important; }
html[data-theme="light"] .text-red-300,
html[data-theme="light"] .text-red-400 { color: #b91c1c !important; }
html[data-theme="light"] .text-yellow-400,
html[data-theme="light"] .text-amber-200,
html[data-theme="light"] .text-amber-300 { color: #a16207 !important; }
html[data-theme="light"] .text-orange-400 { color: #c2410c !important; }
html[data-theme="light"] .text-purple-200,
html[data-theme="light"] .text-purple-400 { color: #6d28d9 !important; }
html[data-theme="light"] .hover\:text-white:hover { color: #1d4ed8 !important; }
html[data-theme="light"] .bg-slate-800 { background-color: #f1f5f9 !important; }
html[data-theme="light"] .border-gray-800 { border-color: #e2e8f0 !important; }
/* white text must stay white on solid / gradient fills */
html[data-theme="light"] [class*="bg-gradient-to"],
html[data-theme="light"] [class*="bg-gradient-to"] *,
html[data-theme="light"] .bg-blue-600, html[data-theme="light"] .bg-blue-600 *,
html[data-theme="light"] .bg-green-500, html[data-theme="light"] .bg-green-500 *,
html[data-theme="light"] .bg-gray-500, html[data-theme="light"] .bg-gray-500 *,
html[data-theme="light"] .btn-primary, html[data-theme="light"] .btn-primary *,
html[data-theme="light"] .setup-step-num { color: #ffffff !important; }

/* ---------- XPR Block Producers ---------- */
html[data-theme="light"] .bp-dash {
  --bp-card: #ffffff;
  --bp-card-2: #ffffff;
  --bp-line: rgba(15, 23, 42, 0.09);
  --bp-text: #0f172a;
  --bp-muted: #64748b;
  --bp-primary: #0369a1;
  --bp-violet: #6d28d9;
  --bp-ok: #047857;
  --bp-warn: #c2410c;
  --bp-bad: #be123c;
}
html[data-theme="light"] .bp-dash .bp-chip.is-gov,
html[data-theme="light"] .bp-dash .bp-chip.is-good { color: #047857; }
html[data-theme="light"] .bp-dash .bp-kv > b.lvl-medium,
html[data-theme="light"] .bp-dash .bp-kv > b.lvl-note { color: #fff; }

/* ---------- Browser scan ---------- */
html[data-theme="light"] #xr-start, html[data-theme="light"] #xr-start * { color: #ffffff !important; }

/* ---------- Scan domain ---------- */
html[data-theme="light"] .xprotect-scanner-wrap {
  --cyan: #0284c7;
  --green: #059669;
  --amber: #d97706;
  --orange: #ea580c;
  --crit: #e11d48;
}
html[data-theme="light"] .xprotect-scanner-wrap .tab-btn .tab-count.bad { color: #fff !important; }
html[data-theme="light"] .xprotect-scanner-wrap .verdict-title span { color: color-mix(in srgb, var(--vtone, #0284c7) 72%, #000) !important; }
@media (max-width: 991px) {
  html[data-theme="light"] .menu li,
  html[data-theme="light"] .menu li a,
  html[data-theme="light"] .submenu li a { border-color: rgba(15, 23, 42, 0.08) !important; }
}
