/**
 * PIIRATE Elite — Smart Light Mode
 * Background-conscious, high-contrast, readable
 */

/* ═══ BASE BODY ═══ */
body.light-mode {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

/* ═══ NAVIGATION ═══ */
body.light-mode .navbar,
body.light-mode nav,
body.light-mode .main-nav {
    background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
    border-bottom: 2px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
}
body.light-mode .navbar a,
body.light-mode .nav-link,
body.light-mode nav a {
    color: #334155 !important;
}
body.light-mode .navbar a:hover,
body.light-mode .nav-link:hover {
    color: #dc2626 !important;
}
body.light-mode .navbar .brand-text,
body.light-mode .nav-brand span {
    color: #f59e0b !important;
}

/* ═══ HAMBURGER / MOBILE MENU ═══ */
body.light-mode .mobile-menu,
body.light-mode .nav-mobile-menu,
body.light-mode .hamburger-menu {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-mode .mobile-menu a,
body.light-mode .nav-mobile-menu a {
    color: #334155 !important;
}

/* ═══ HERO / SECTIONS ═══ */
body.light-mode section,
body.light-mode .section {
    background: transparent !important;
}
body.light-mode .hero-section,
body.light-mode .free-scan-section-v2 {
    background: linear-gradient(165deg, #e0e7ff 0%, #dbeafe 25%, #e0f2fe 50%, #f0f9ff 75%, #f8fafc 100%) !important;
}

/* ═══ CARDS & CONTAINERS ═══ */
body.light-mode .card,
body.light-mode .service-card,
body.light-mode .feature-card,
body.light-mode .pricing-card,
body.light-mode .results-card,
body.light-mode .stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    color: #1e293b !important;
}

/* ═══ TEXT — Context-Aware Contrast ═══ */
body.light-mode h1, body.light-mode h2, body.light-mode h3,
body.light-mode h4, body.light-mode h5, body.light-mode h6 {
    color: #0f172a !important;
}
body.light-mode p,
body.light-mode span,
body.light-mode li,
body.light-mode label,
body.light-mode td,
body.light-mode th {
    color: #334155 !important;
}
body.light-mode a {
    color: #2563eb !important;
}
body.light-mode a:hover {
    color: #dc2626 !important;
}
body.light-mode .text-muted,
body.light-mode small,
body.light-mode .text-secondary {
    color: #64748b !important;
}

/* ═══ BUTTONS — Keep branded colors ═══ */
body.light-mode .btn-primary,
body.light-mode .cta-button,
body.light-mode .mobile-cta-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #ffffff !important;
    border: none !important;
}
body.light-mode .btn-outline-light {
    border-color: #334155 !important;
    color: #334155 !important;
}

/* ═══ FORMS & INPUTS ═══ */
body.light-mode input,
body.light-mode textarea,
body.light-mode select {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 2px solid #cbd5e1 !important;
}
body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
    color: #94a3b8 !important;
}
body.light-mode input:focus,
body.light-mode textarea:focus,
body.light-mode select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important;
}

/* ═══ FOOTER ═══ */
body.light-mode .main-footer {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    color: #cbd5e1 !important;
}
body.light-mode .main-footer a { color: #94a3b8 !important; }
body.light-mode .main-footer h6 { color: #e2e8f0 !important; }
body.light-mode .main-footer p { color: #94a3b8 !important; }

/* ═══ BADGES & ALERTS ═══ */
body.light-mode .badge {
    border: 1px solid rgba(0,0,0,0.1) !important;
}
body.light-mode .alert {
    border: 1px solid #e2e8f0 !important;
}

/* ═══ TABLES ═══ */
body.light-mode table {
    background: #ffffff !important;
}
body.light-mode th {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}
body.light-mode td {
    border-color: #f1f5f9 !important;
}
body.light-mode tr:hover td {
    background: #f8fafc !important;
}

/* ═══ MODALS & OVERLAYS ═══ */
body.light-mode .modal-content,
body.light-mode .popup-content,
body.light-mode .checkout-content {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}

/* ═══ COOKIE CONSENT ═══ */
body.light-mode .cookie-consent {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    color: #e2e8f0 !important;
}

/* ═══ SERVICE-SPECIFIC — Smart Contrast ═══ */
body.light-mode .service-card .price,
body.light-mode .pricing-amount {
    color: #dc2626 !important;
}
body.light-mode .service-card .features li {
    color: #475569 !important;
}
body.light-mode .service-card .features li i {
    color: #10b981 !important;
}
body.light-mode .trial-badge {
    background: rgba(16,185,129,0.1) !important;
    color: #059669 !important;
    border-color: rgba(16,185,129,0.3) !important;
}

/* ═══ SCAN SECTIONS ═══ */
body.light-mode .scan-result,
body.light-mode .results-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* ═══ STATUS BADGES ═══ */
body.light-mode .severity-critical { background: #fef2f2 !important; border-color: #fecaca !important; color: #991b1b !important; }
body.light-mode .severity-high { background: #fff7ed !important; border-color: #fed7aa !important; color: #9a3412 !important; }
body.light-mode .severity-medium { background: #fefce8 !important; border-color: #fef08a !important; color: #854d0e !important; }
body.light-mode .severity-low { background: #f0fdf4 !important; border-color: #bbf7d0 !important; color: #166534 !important; }

/* ═══ THEME TOGGLE BUTTON ═══ */
body.light-mode .piirate-theme-toggle,
body.light-mode .navbar-theme-btn {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    color: #f59e0b !important;
    border-color: #dc2626 !important;
}
body.light-mode .mobile-theme-btn {
    background: rgba(220,38,38,0.1) !important;
    color: #334155 !important;
}
body.light-mode .mobile-theme-btn .theme-icon-dark { display: none; }
body.light-mode .mobile-theme-btn .theme-icon-light { display: inline; }

/* ═══ ACCESSIBILITY PANEL ═══ */
body.light-mode .piirate-a11y-panel {
    background: linear-gradient(135deg, #ffffff, #f1f5f9) !important;
    border-color: rgba(220,38,38,0.2) !important;
}
body.light-mode .a11y-option { border-bottom-color: rgba(0,0,0,0.1) !important; }
body.light-mode .a11y-option label { color: #334155 !important; }
body.light-mode .a11y-panel-footer { background: #f1f5f9 !important; }

/* ═══ SCROLLBAR ═══ */
body.light-mode ::-webkit-scrollbar-track { background: #f1f5f9; }
body.light-mode ::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ═══ DARK INLINE STYLES OVERRIDE ═══ */
/* These catch inline style="color: #94a3b8" etc. on dark backgrounds */
body.light-mode [style*="color: #94a3b8"],
body.light-mode [style*="color:#94a3b8"],
body.light-mode [style*="color: #cbd5e1"],
body.light-mode [style*="color:#cbd5e1"],
body.light-mode [style*="color: #e2e8f0"],
body.light-mode [style*="color:#e2e8f0"] {
    color: #475569 !important;
}
body.light-mode [style*="color: #f1f5f9"],
body.light-mode [style*="color:#f1f5f9"],
body.light-mode [style*="color: #f8fafc"],
body.light-mode [style*="color:#f8fafc"],
body.light-mode [style*="color: white"],
body.light-mode [style*="color: #fff"],
body.light-mode [style*="color:#fff"] {
    color: #1e293b !important;
}
/* But NOT in footer or dark sections */
body.light-mode .main-footer [style*="color:"],
body.light-mode .cookie-consent [style*="color:"] {
    color: inherit !important;
}

/* ═══ DARK BACKGROUND OVERRIDES ═══ */
body.light-mode [style*="background: var(--dark"],
body.light-mode [style*="background:linear-gradient(135deg, #1e293b"],
body.light-mode [style*="background: linear-gradient(135deg, #1a1a2e"],
body.light-mode [style*="background: #0f172a"],
body.light-mode [style*="background:#0f172a"] {
    background: #ffffff !important;
}
/* Keep footer dark */
body.light-mode .main-footer,
body.light-mode .main-footer [style*="background"] {
    background: inherit !important;
}

/* ═══ NAVBAR THEME TOGGLE BUTTON ═══ */
.navbar-theme-btn {
    background: transparent;
    border: 2px solid rgba(220, 38, 38, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin-left: 10px;
    padding: 0;
}
.navbar-theme-btn:hover {
    border-color: #DC2626;
    background: rgba(220, 38, 38, 0.1);
    transform: scale(1.1);
}
.navbar-theme-btn .theme-icon-dark,
.navbar-theme-btn .theme-icon-light {
    position: absolute;
    font-size: 16px;
    transition: all 0.3s ease;
}
.navbar-theme-btn .theme-icon-dark {
    color: #f59e0b;
    opacity: 1;
}
.navbar-theme-btn .theme-icon-light {
    color: #f59e0b;
    opacity: 0;
}
body.light-mode .navbar-theme-btn .theme-icon-dark { opacity: 0; }
body.light-mode .navbar-theme-btn .theme-icon-light { opacity: 1; }
body.light-mode .navbar-theme-btn {
    border-color: #DC2626;
    background: rgba(220, 38, 38, 0.1);
}

/* ═══ MOBILE MENU THEME TOGGLE — Compact Design ═══ */
.mobile-theme-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mobile-theme-label {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.mobile-theme-btn-compact {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(220, 38, 38, 0.5);
    background: rgba(15, 23, 42, 0.6);
    color: #f59e0b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    padding: 0;
    font-size: 18px;
}
.mobile-theme-btn-compact:hover,
.mobile-theme-btn-compact:active {
    border-color: #DC2626;
    background: rgba(220, 38, 38, 0.15);
    transform: scale(1.1);
}
.mobile-theme-btn-compact .theme-icon-dark,
.mobile-theme-btn-compact .theme-icon-light {
    position: absolute;
    font-size: 18px;
    transition: opacity 0.3s ease;
}
.mobile-theme-btn-compact .theme-icon-dark { opacity: 1; }
.mobile-theme-btn-compact .theme-icon-light { opacity: 0; }
body.light-mode .mobile-theme-btn-compact .theme-icon-dark { opacity: 0; }
body.light-mode .mobile-theme-btn-compact .theme-icon-light { opacity: 1; }
body.light-mode .mobile-theme-btn-compact {
    background: rgba(241, 245, 249, 0.9);
    border-color: #DC2626;
}
body.light-mode .mobile-theme-label {
    color: #475569;
}

/* ═══ UNIVERSAL FORM INPUT FIX — Readable on ALL backgrounds ═══ */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
    background: rgba(30, 41, 59, 0.95) !important;
    color: #f1f5f9 !important;
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
    caret-color: #f59e0b !important;
}
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(148, 163, 184, 0.8) !important;
}
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    background: rgba(30, 41, 59, 1) !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

/* Light mode inputs */
body.light-mode .form-control,
body.light-mode input[type="text"],
body.light-mode input[type="email"],
body.light-mode input[type="password"],
body.light-mode input[type="tel"],
body.light-mode input[type="number"],
body.light-mode input[type="search"],
body.light-mode input[type="url"],
body.light-mode textarea,
body.light-mode select {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 2px solid #cbd5e1 !important;
    caret-color: #3b82f6 !important;
}
body.light-mode .form-control::placeholder,
body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
    color: #94a3b8 !important;
}
body.light-mode .form-control:focus,
body.light-mode input:focus,
body.light-mode textarea:focus,
body.light-mode select:focus {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Labels */
label, .form-label {
    color: #e2e8f0 !important;
}
body.light-mode label,
body.light-mode .form-label {
    color: #334155 !important;
}

/* ═══ ADMIN NAV — App Links & Divider ═══ */
.admin-nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    margin: 0 4px;
    align-self: center;
}
.admin-nav-app-link {
    color: #94a3b8 !important;
    font-size: 0.75rem !important;
    opacity: 0.7;
    transition: all 0.2s ease;
}
.admin-nav-app-link:hover {
    color: #f59e0b !important;
    opacity: 1;
}
@media (max-width: 768px) {
    .admin-nav-divider {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }
}

/* ═══ INLINE COLOR OVERRIDES — Invisible-on-white prevention ═══ */
body.light-mode [style*="color: #06b6d4"],
body.light-mode [style*="color:#06b6d4"] { color: #0e7490 !important; }
body.light-mode [style*="color: #34d399"],
body.light-mode [style*="color:#34d399"] { color: #047857 !important; }
body.light-mode [style*="color: #4ade80"],
body.light-mode [style*="color:#4ade80"] { color: #15803d !important; }
body.light-mode [style*="color: #60a5fa"],
body.light-mode [style*="color:#60a5fa"] { color: #1d4ed8 !important; }
body.light-mode [style*="color: #a78bfa"],
body.light-mode [style*="color:#a78bfa"] { color: #6d28d9 !important; }
body.light-mode [style*="color: #ef4444"],
body.light-mode [style*="color:#ef4444"] { color: #b91c1c !important; }
body.light-mode [style*="color: #f87171"],
body.light-mode [style*="color:#f87171"] { color: #b91c1c !important; }
body.light-mode [style*="color: #fbbf24"],
body.light-mode [style*="color:#fbbf24"] { color: #92400e !important; }

/* ═══ COLORBLIND-SAFE STATUS — Border patterns distinguish without color ═══ */
/* Solid border = success, Dashed = danger, Dotted = warning */
body.light-mode .badge-success,
body.light-mode .status-success,
body.light-mode .severity-low { background: #dcfce7 !important; color: #14532d !important; border: 2px solid #22c55e !important; }

body.light-mode .badge-danger,
body.light-mode .status-danger,
body.light-mode .severity-critical { background: #fef2f2 !important; color: #7f1d1d !important; border: 2px dashed #dc2626 !important; }

body.light-mode .badge-warning,
body.light-mode .status-warning,
body.light-mode .severity-medium { background: #fefce8 !important; color: #713f12 !important; border: 2px dotted #ca8a04 !important; }

body.light-mode .badge-info,
body.light-mode .status-info,
body.light-mode .severity-high { background: #fff7ed !important; color: #9a3412 !important; border: 2px solid #ea580c !important; }

/* ═══ ANTI-BLUR — Crisp text on light backgrounds ═══ */
body.light-mode {
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: optimizeLegibility !important;
}

/* ═══ DARK INLINE BACKGROUND OVERRIDES ═══ */
body.light-mode [style*="background: #0a0e1a"],
body.light-mode [style*="background:#0a0e1a"],
body.light-mode [style*="background: #111827"],
body.light-mode [style*="background:#111827"],
body.light-mode [style*="background: #1a1a2e"],
body.light-mode [style*="background:#1a1a2e"],
body.light-mode [style*="background: #111"],
body.light-mode [style*="background:#111"],
body.light-mode [style*="background: #0d1117"],
body.light-mode [style*="background:#0d1117"],
body.light-mode [style*="background: #121212"],
body.light-mode [style*="background:#121212"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* Protect intentionally dark sections */
body.light-mode footer [style*="background"],
body.light-mode .main-footer [style*="background"],
body.light-mode .cookie-consent [style*="background"] { background: inherit !important; border: none !important; }
body.light-mode footer *, body.light-mode .main-footer * { color: inherit !important; }

/* ═══ ICON VISIBILITY — Muted icons need darker shade ═══ */
body.light-mode i[style*="color: #94a3b8"],
body.light-mode i[style*="color:#94a3b8"],
body.light-mode i[style*="color: #64748b"],
body.light-mode i[style*="color:#64748b"],
body.light-mode i[style*="color: #cbd5e1"],
body.light-mode i[style*="color:#cbd5e1"] {
    color: #475569 !important;
}


/* ═══════════════════════════════════════════════════════════════
   CLASS-BASED LIGHT MODE OVERRIDES
   Targets actual dark-theme classes used in templates
   ═══════════════════════════════════════════════════════════════ */

/* ─── STAT ITEMS (3,227+, 99%, Live, <30s boxes) ─── */
body.light-mode .stat-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-mode .stat-number {
    color: #b45309 !important; /* dark amber — 7.5:1 AAA on white */
    text-shadow: none !important;
}
body.light-mode .stat-label {
    color: #475569 !important; /* 7.1:1 AAA on white */
}

/* ─── SERVICE / RESULTS CARDS (dark gradient cards) ─── */
body.light-mode .results-card,
body.light-mode .card.border-0,
body.light-mode .card.h-100 {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    backdrop-filter: none !important;
}
body.light-mode .results-card h3,
body.light-mode .results-card h4,
body.light-mode .results-card h5,
body.light-mode .card.h-100 h3,
body.light-mode .card.h-100 h4,
body.light-mode .card.h-100 h5 {
    color: #0f172a !important;
}
body.light-mode .results-card p,
body.light-mode .results-card span,
body.light-mode .results-card li,
body.light-mode .card.h-100 p,
body.light-mode .card.h-100 span {
    color: #334155 !important;
}

/* ─── RISK BOX ─── */
body.light-mode .risk-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

/* ─── ALERT CARDS (dark gradient alerts) ─── */
body.light-mode .alert.border-0 {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}
body.light-mode .alert.border-0 h4,
body.light-mode .alert.border-0 h5 {
    color: #0f172a !important;
}
body.light-mode .alert.border-0 p {
    color: #475569 !important;
}

/* ─── RETURNING CUSTOMER BANNER ─── */
body.light-mode .returning-customer-banner {
    background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
    border: 1px solid #93c5fd !important;
    color: #1e3a8a !important;
}

/* ─── SECTIONS WITH DARK GRADIENTS ─── */
body.light-mode .hero-section,
body.light-mode .free-scan-section,
body.light-mode .free-scan-section-v2,
body.light-mode .removal-section,
body.light-mode .cta-section,
body.light-mode .arsenal-section,
body.light-mode .features-section,
body.light-mode .pricing-section,
body.light-mode .testimonials-section,
body.light-mode .faq-section,
body.light-mode .stats-section {
    background: linear-gradient(165deg, #eff6ff 0%, #dbeafe 25%, #e0f2fe 50%, #f0f9ff 75%, #f8fafc 100%) !important;
}

/* ─── ACTION BUTTONS ON CARDS ─── */
body.light-mode .btn.fw-bold,
body.light-mode .btn.btn-sm.fw-bold {
    color: #ffffff !important;
}

/* ─── MUTED/GHOST TEXT that vanishes on light ─── */
body.light-mode .action-description,
body.light-mode .feature-description {
    color: #475569 !important;
}

/* ─── BADGE TEXT ON LIGHT BG ─── */
body.light-mode .badge {
    color: #ffffff !important;
}

/* ─── DARK VAR() GRADIENT OVERRIDES ─── */
body.light-mode [class*="gradient"] {
    /* Don't override button gradients, only bg gradients */
}

/* ─── ICON CIRCLES (green/blue circles with icons) ─── */
body.light-mode .stat-item i,
body.light-mode .results-card i.fas,
body.light-mode .card.h-100 i.fas {
    /* Keep icon colors — they work on both backgrounds */
}

/* ─── SCAN FORM AREA ─── */
body.light-mode .scan-main-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-mode .scan-main-title {
    color: #0f172a !important;
}
body.light-mode .scan-subtitle {
    color: #475569 !important;
}
body.light-mode .field-group {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-mode .field-label {
    color: #334155 !important;
}

/* ─── TRUST BAR (bottom feature strip) ─── */
body.light-mode .trust-item,
body.light-mode .trust-badge {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}
body.light-mode .trust-item span,
body.light-mode .trust-item p,
body.light-mode .trust-badge span {
    color: #334155 !important;
}

/* ─── LIVE STATS ROW ─── */
body.light-mode .live-stat {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-mode .live-stat-value {
    color: #0f172a !important;
}
body.light-mode .live-stat-label {
    color: #475569 !important;
}

/* ─── TESTIMONIAL CARDS ─── */
body.light-mode .testimonial-card,
body.light-mode .testimonial {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}

/* ─── FAQ ─── */
body.light-mode .faq-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-mode .faq-question {
    color: #0f172a !important;
}
body.light-mode .faq-answer {
    color: #475569 !important;
}

/* ─── PRICING CARDS ─── */
body.light-mode .pricing-card,
body.light-mode .plan-card {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    color: #1e293b !important;
}
body.light-mode .pricing-card .price,
body.light-mode .pricing-amount {
    color: #b91c1c !important;
}
body.light-mode .pricing-card .features li,
body.light-mode .plan-card li {
    color: #475569 !important;
}

/* ─── col-md cards with dark inline gradients ─── */
body.light-mode .col-md-4 > div,
body.light-mode .col-md-6 > div,
body.light-mode .col-lg-4 > div,
body.light-mode .col-lg-6 > div {
    /* Only override if parent has dark bg — use specificity */
}

/* ─── GENERIC: Any element with these dark bg classes ─── */
body.light-mode .bg-dark,
body.light-mode .bg-darker {
    background: #f8fafc !important;
    color: #1e293b !important;
}

/* ─── HEADER ACTIONS (settings gear, sign out) ─── */
body.light-mode .main-header .btn-outline-light {
    color: #334155 !important;
    border-color: #d1d5db !important;
}
body.light-mode .main-header .btn-outline-light:hover {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* ═══ FOOTER TEXT PROTECTION v2 — Exact .main-footer selectors ═══ */
body.light-mode .main-footer { background: linear-gradient(135deg, #1e293b, #0f172a) !important; }
body.light-mode .main-footer * { color: #cbd5e1 !important; }
body.light-mode .main-footer h3,
body.light-mode .main-footer h4,
body.light-mode .main-footer h5,
body.light-mode .main-footer h6,
body.light-mode .main-footer .footer-logo h3 { color: #f1f5f9 !important; }
body.light-mode .main-footer a { color: #cbd5e1 !important; }
body.light-mode .main-footer a:hover { color: #f59e0b !important; }
body.light-mode .main-footer p,
body.light-mode .main-footer span,
body.light-mode .main-footer li,
body.light-mode .main-footer small { color: #cbd5e1 !important; }
body.light-mode .main-footer ul li a { color: #cbd5e1 !important; }
body.light-mode .main-footer ul li a:hover { color: #f59e0b !important; }
body.light-mode .main-footer .badge { color: #cbd5e1 !important; background: rgba(255,255,255,0.1) !important; }
body.light-mode .main-footer [style*="border-top"] { border-color: rgba(255,255,255,0.1) !important; }
body.light-mode .main-footer .d-flex a { color: #cbd5e1 !important; }
body.light-mode .main-footer .d-flex a:hover { color: #f59e0b !important; }
body.light-mode .main-footer i { color: #cbd5e1 !important; }


/* ═══ MOBILE WIDGET STACKING — Prevent overlaps ═══ */
.main-header { z-index: 1000 !important; }
.mobile-menu { z-index: 1100 !important; }
.mobile-menu-overlay { z-index: 1050 !important; }
.back-to-top { z-index: 900 !important; }
.cookie-consent { z-index: 9000 !important; }
.flash-messages { z-index: 8000 !important; }
.loading-overlay { z-index: 9500 !important; }
.piirate-a11y-btn { z-index: 800 !important; }
.piirate-a11y-panel { z-index: 850 !important; }

@media (max-width: 768px) {
    .piirate-a11y-btn { bottom: 20px !important; left: 15px !important; right: auto !important; width: 44px !important; height: 44px !important; }
    .back-to-top { bottom: 80px !important; right: 15px !important; width: 44px !important; height: 44px !important; }
    .chat-bubble { bottom: 20px !important; right: 15px !important; width: 50px !important; height: 50px !important; }
    .chat-window { bottom: 80px !important; right: 10px !important; width: calc(100vw - 20px) !important; max-width: 380px !important; max-height: 60vh !important; }
    .cookie-consent { bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; border-radius: 0 !important; padding: 12px 15px !important; }
    .floating-cart { bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; border-radius: 12px 12px 0 0 !important; }
    .checkout-modal, .service-form-modal, .support-modal, .verification-modal { padding: 10px !important; }
    .checkout-content, .service-form-content, .support-modal-content, .verification-modal-content { width: 100% !important; max-width: 100% !important; max-height: 90vh !important; overflow-y: auto !important; border-radius: 12px !important; }
    .notification, .toast-container { top: 80px !important; right: 10px !important; left: 10px !important; width: auto !important; }
    .flash-messages { top: 70px !important; left: 10px !important; right: 10px !important; width: auto !important; }
    .loading-overlay { top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; }
    .reading-guide-line { pointer-events: none !important; }
    .back-to-top, .piirate-a11y-btn, .chat-bubble, .mobile-menu-toggle, .mobile-close-btn, .cookie-btn { min-width: 44px !important; min-height: 44px !important; }
}


/* ═══ COLORBLIND-SAFE BOOTSTRAP OVERRIDES — Both modes ═══ */
/* Pattern: solid=success, dashed=danger, dotted=warning, double=info */

/* Badges */
.badge-success, .bg-success { border: 2px solid #16a34a !important; }
.badge-danger, .bg-danger { border: 2px dashed #dc2626 !important; }
.badge-warning, .bg-warning { border: 2px dotted #ca8a04 !important; }
.badge-info, .bg-info { border: 2px double #2563eb !important; }

/* Text indicators — add icon-like prefix via border-left */
.text-success { border-left: 3px solid #16a34a; padding-left: 6px; }
.text-danger { border-left: 3px dashed #dc2626; padding-left: 6px; }
.text-warning { border-left: 3px dotted #ca8a04; padding-left: 6px; }
.text-info { border-left: 3px double #2563eb; padding-left: 6px; }

/* Alerts */
.alert-success { border-left: 4px solid #16a34a !important; }
.alert-danger { border-left: 4px dashed #dc2626 !important; }
.alert-warning { border-left: 4px dotted #ca8a04 !important; }
.alert-info { border-left: 4px double #2563eb !important; }

/* Severity badges */
.severity-critical { border: 2px dashed #dc2626 !important; }
.severity-high { border: 2px solid #ea580c !important; }
.severity-medium { border: 2px dotted #ca8a04 !important; }
.severity-low { border: 2px solid #16a34a !important; }

/* Risk indicators */
.risk-high { border-left: 4px dashed #dc2626; padding-left: 6px; }
.risk-medium { border-left: 4px dotted #ca8a04; padding-left: 6px; }
.risk-low { border-left: 4px solid #16a34a; padding-left: 6px; }

/* Status badges — custom classes */
.status-active, .status-enabled, .status-completed { border: 2px solid #16a34a !important; }
.status-inactive, .status-disabled { border: 2px dashed #dc2626 !important; }
.status-pending, .status-processing { border: 2px dotted #ca8a04 !important; }
.status-info { border: 2px double #2563eb !important; }

/* Light mode specific overrides */
body.light-mode .badge-success, body.light-mode .bg-success { background: #dcfce7 !important; color: #14532d !important; }
body.light-mode .badge-danger, body.light-mode .bg-danger { background: #fef2f2 !important; color: #7f1d1d !important; }
body.light-mode .badge-warning, body.light-mode .bg-warning { background: #fefce8 !important; color: #713f12 !important; }
body.light-mode .badge-info, body.light-mode .bg-info { background: #eff6ff !important; color: #1e3a8a !important; }
body.light-mode .text-success { color: #15803d !important; }
body.light-mode .text-danger { color: #b91c1c !important; }
body.light-mode .text-warning { color: #a16207 !important; }
body.light-mode .text-info { color: #1d4ed8 !important; }


/* ═══ AUTH INPUT VISIBILITY — Dark mode inputs readable ═══ */
/* Dark mode: light text on dark inputs */
input, select, textarea,
.form-control, .form-input,
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="search"] {
    color: #f1f5f9 !important;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
input::placeholder, textarea::placeholder {
    color: #64748b !important;
}
input:focus, select:focus, textarea:focus,
.form-control:focus, .form-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
    color: #f1f5f9 !important;
}

/* Light mode: dark text on light inputs */
body.light-mode input, body.light-mode select, body.light-mode textarea,
body.light-mode .form-control, body.light-mode .form-input {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
}
body.light-mode input::placeholder, body.light-mode textarea::placeholder {
    color: #9ca3af !important;
}
body.light-mode input:focus, body.light-mode select:focus, body.light-mode textarea:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
    color: #0f172a !important;
}

/* Admin section inputs */
.admin-section input, .admin-section select, .admin-section textarea {
    color: #f1f5f9 !important;
}
body.light-mode .admin-section input, 
body.light-mode .admin-section select {
    color: #0f172a !important;
    background: #f8fafc !important;
}

/* === PLATFORM-SPECIFIC NATIVE STYLES === */
.native-app.platform-android .piirate-a11y-btn,
.native-app.platform-android .chat-bubble {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
}
.native-app.platform-ios .main-header {
    padding-top: env(safe-area-inset-top, 0px) !important;
}
.native-app.platform-ios footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
}
