/* =========================================
   FCF ELETTRONICA — DESIGN SYSTEM GLOBALE
   Mobile-First | Tech-Premium | Dark-aware
   ========================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- Local Fonts (Montserrat fallback) --- */
@font-face { font-family: 'Montserrat'; font-weight: 300; font-style: normal; font-display: swap; src: url('../fonts/montserrat-v31-latin-300.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/montserrat-v31-latin-regular.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/montserrat-v31-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/montserrat-v31-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 900; font-style: normal; font-display: swap; src: url('../fonts/montserrat-v31-latin-900.woff2') format('woff2'); }

/* =========================================
   0. DESIGN TOKENS
   ========================================= */
:root {
    /* Typography */
    --font-display: 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Colors — Light Mode */
    --color-primary: #00C853;
    --color-primary-dark: #00a344;
    --color-primary-glow: rgba(0, 200, 83, 0.25);
    --color-accent: #FF9100;
    --color-accent-soft: rgba(255, 145, 0, 0.15);
    --color-bg: #f4f5f7;
    --color-surface: rgba(255, 255, 255, 0.75);
    --color-text-dark: #111827;
    --color-text-gray: #6b7280;
    --color-text-light: #ffffff;

    /* Header */
    --header-bg: rgba(255, 255, 255, 0.82);
    --header-border: rgba(0, 0, 0, 0.06);

    /* Cards */
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-bg-hover: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);

    /* Footer */
    --footer-bg: #f0f1f3;
    --footer-text: #4b5563;
    --footer-title: #111827;
    --footer-icon-bg: #ffffff;

    /* Misc */
    --divider-color: #e5e7eb;
    --icon-color: #6b7280;

    /* Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-green: 0 8px 24px rgba(0, 200, 83, 0.3);

    /* Transitions */
    --transition-base: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --easing-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Dark Mode Tokens --- */
[data-theme="dark"] {
    --color-bg: #0a0a0f;
    --color-surface: rgba(20, 20, 30, 0.8);
    --color-text-dark: #f0f0f5;
    --color-text-gray: #9ca3af;
    --header-bg: rgba(10, 10, 15, 0.88);
    --header-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(25, 25, 35, 0.8);
    --card-bg-hover: rgba(30, 30, 45, 0.95);
    --card-border: rgba(255, 255, 255, 0.06);
    --footer-bg: #050508;
    --footer-text: #9ca3af;
    --footer-title: #f0f0f5;
    --footer-icon-bg: rgba(30, 30, 45, 0.9);
    --divider-color: rgba(255, 255, 255, 0.08);
    --icon-color: #9ca3af;
}

/* =========================================
   1. RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    width: 100%;
    overflow-x: clip;
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-dark);
    background: var(--color-bg);
    overflow-x: clip;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}
body::-webkit-scrollbar { display: none; }

/* Subtle gradient overlays in light mode */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(800px 400px at 10% -5%, rgba(0, 200, 83, 0.08), transparent 60%),
        radial-gradient(600px 350px at 90% 0%, rgba(255, 145, 0, 0.06), transparent 55%);
    pointer-events: none;
    z-index: 0;
}
[data-theme="dark"] body::before {
    background:
        radial-gradient(600px 300px at 10% -5%, rgba(0, 200, 83, 0.04), transparent 50%),
        radial-gradient(500px 250px at 90% 0%, rgba(255, 145, 0, 0.03), transparent 50%);
}

main { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
    line-height: 1.15;
}

a { color: inherit; text-decoration: none; }

::selection {
    background: rgba(0, 200, 83, 0.2);
    color: var(--color-text-dark);
}

img { max-width: 100%; height: auto; display: block; }

/* =========================================
   2. READING PROGRESS BAR
   ========================================= */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    width: 0%;
    z-index: 1200;
    box-shadow: 0 0 12px rgba(0, 200, 83, 0.5);
    transition: width 0.05s linear;
}

/* =========================================
   3. REVEAL ANIMATIONS
   ========================================= */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(12px);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform, filter;
}
.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.reveal-left { transform: translateX(-60px) scale(0.95); filter: blur(12px); }
.reveal-right { transform: translateX(60px) scale(0.95); filter: blur(12px); }
.reveal-bottom { transform: translateY(60px) scale(0.95); filter: blur(12px); }

.reveal-left.visible,
.reveal-right.visible,
.reveal-bottom.visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: blur(0);
}

.delay-1 { --reveal-delay: 80ms; }
.delay-2 { --reveal-delay: 160ms; }
.delay-3 { --reveal-delay: 240ms; }
.delay-4 { --reveal-delay: 320ms; }
.delay-5 { --reveal-delay: 400ms; }
.delay-6 { --reveal-delay: 480ms; }
.delay-7 { --reveal-delay: 560ms; }
.delay-8 { --reveal-delay: 640ms; }
.delay-9 { --reveal-delay: 720ms; }

.delay-100 { --reveal-delay: 100ms; }
.delay-200 { --reveal-delay: 200ms; }
.delay-300 { --reveal-delay: 300ms; }
.delay-400 { --reveal-delay: 400ms; }

.blur-in {
    opacity: 0;
    filter: blur(15px);
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), filter 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
}
.blur-in.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Mobile Optimizations for Entrance Effects */
@media (max-width: 768px) {
    .reveal-on-scroll {
        transform: translateY(20px) scale(0.98);
        filter: blur(4px);
        transition-duration: 0.6s;
    }
    .reveal-left { transform: translateX(-20px) scale(0.98); filter: blur(4px); }
    .reveal-right { transform: translateX(20px) scale(0.98); filter: blur(4px); }
    .reveal-bottom { transform: translateY(20px) scale(0.98); filter: blur(4px); }
    .blur-in {
        transform: translateY(10px);
        filter: blur(6px);
        transition-duration: 0.8s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll, .blur-in,
    .reveal-left, .reveal-right, .reveal-bottom {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }
}

/* Mobile optimizations for entrance effects */
@media (max-width: 768px) {
    .reveal-on-scroll {
        transform: translateY(15px) scale(0.98);
        filter: blur(4px);
    }
    .reveal-left { transform: translateX(-15px) scale(0.98); }
    .reveal-right { transform: translateX(15px) scale(0.98); }
    .reveal-bottom { transform: translateY(15px) scale(0.98); }
}

/* =========================================
   4. HEADER & NAVIGATION — Mobile-First
   ========================================= */
header.header-principale {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--header-border);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: var(--transition-base);
}

header.header-principale.nav-open {
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text-dark);
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.header-logo-img { height: 30px; width: auto; }
.logo-text {
    font-size: 0.65rem;
    letter-spacing: 0.03em;
    line-height: 1.1;
    max-width: 90px;
    display: block;
}

/* Nav — hidden on mobile */
nav[aria-label="Menu Principale"] {
    position: fixed;
    top: 70px;
    left: 12px;
    right: 12px;
    background: var(--color-bg);
    border: 1px solid var(--header-border);
    border-radius: var(--radius-lg);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--easing-out), opacity 0.3s ease, padding 0.3s ease;
    z-index: 999;
    box-shadow: var(--shadow-lg);
}
nav[aria-label="Menu Principale"].nav-open {
    max-height: 300px;
    opacity: 1;
    padding: 20px;
}

.menu-centrato {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 4px;
    margin: 0; padding: 0;
}
.menu-centrato li a {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--color-text-gray);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}
.menu-centrato li a:hover,
.menu-centrato li a.active {
    color: var(--color-primary);
    background: rgba(0, 200, 83, 0.08);
}

/* Header settings */
.header-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dark Mode Toggle */
.theme-switch-wrapper { display: flex; align-items: center; }
.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 52px;
}
.theme-switch input { display: none; }
.slider {
    background-color: var(--divider-color);
    bottom: 0; left: 0; right: 0; top: 0;
    position: absolute;
    cursor: pointer;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}
.slider:before {
    content: "";
    position: absolute;
    height: 22px; width: 22px;
    left: 3px; bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: .4s;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.slider i { font-size: 11px; z-index: 1; }
.fa-sun { color: #f59e0b; }
.fa-moon { color: #9ca3af; }
input:checked + .slider { background-color: var(--color-primary); }
input:checked + .slider:before { transform: translateX(24px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* Hamburger */
.mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--color-text-dark);
    cursor: pointer;
    width: 40px; height: 40px;
    border-radius: 50%;
    transition: var(--transition-base);
}
.mobile-toggle:hover { background: rgba(0, 200, 83, 0.08); }

/* Desktop (≥768px) */
@media (min-width: 768px) {
    header.header-principale {
        top: 16px;
        left: 20px;
        right: 20px;
        max-width: 1100px;
        margin: 0 auto;
        padding: 10px 24px;
    }
    .logo-text { 
        display: inline; 
        font-size: 0.7rem; 
        letter-spacing: 0.08em; 
        max-width: none; 
    }
    .header-logo-img { height: 34px; }
    .mobile-toggle { display: none; }

    nav[aria-label="Menu Principale"] {
        position: static;
        background: none;
        border: none;
        border-radius: 0;
        padding: 0;
        max-height: none;
        overflow: visible;
        opacity: 1;
        box-shadow: none;
    }
    .menu-centrato {
        flex-direction: row;
        gap: 28px;
    }
    .menu-centrato li a {
        padding: 8px 4px;
        font-size: 0.75rem;
        letter-spacing: 0.14em;
        border-radius: 0;
    }
    .menu-centrato li a:hover,
    .menu-centrato li a.active {
        background: none;
    }
}

/* =========================================
   5. BUTTONS
   ========================================= */
.neon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--color-primary), #28d87a);
    color: var(--color-text-light);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-base);
    box-shadow: var(--shadow-green);
}
.neon-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 200, 83, 0.4);
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
}

/* =========================================
   6. FOOTER — Mobile-First
   ========================================= */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 20px;
    border-top: 3px solid var(--color-primary);
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.footer-col { min-width: 0; }

.footer-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--footer-title);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-display);
}

.contact-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    transition: var(--transition-base);
}
.contact-row:hover { transform: translateX(4px); }

.icon-glow {
    width: 38px; height: 38px;
    background: var(--footer-icon-bg);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.contact-row .text,
.contact-row .text a {
    color: var(--footer-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.quick-links ul { list-style: none; padding: 0; }
.quick-links li { margin-bottom: 12px; }
.quick-links a {
    text-decoration: none;
    color: var(--footer-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-base);
}
.quick-links a:hover { color: var(--color-primary); padding-left: 4px; }

/* Hours Widget */
.hours-widget-glow {
    background: var(--footer-icon-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
}
.status-badge-container {
    text-align: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
}
.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.status-badge.open {
    background: rgba(0, 200, 83, 0.12);
    color: #00a344;
    border: 1px solid var(--color-primary);
}
.status-badge.closed {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid #ef4444;
}

.hours-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.hours-table td { padding: 8px 8px; border-bottom: 1px solid var(--card-border); }
.text-right { text-align: right; font-weight: 700; }
.today-row {
    background: rgba(0, 200, 83, 0.06);
    border-left: 3px solid var(--color-primary);
    font-weight: bold;
}

.small-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer Bottom */
.footer-bottom-bar {
    border-top: 1px solid var(--divider-color);
    margin-top: 40px;
    padding: 20px 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.legal-links-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding-bottom: env(safe-area-inset-bottom, 12px);
}
.toggle-btn, .toggle-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-gray);
    transition: color 0.3s;
    text-decoration: none;
    font-family: var(--font-body);
}
.toggle-btn:hover, .toggle-link:hover { color: var(--color-primary); }
.separator { color: var(--divider-color); font-size: 0.75rem; }

/* Legal Popup (inline expand) */
.legal-wrapper { position: relative; }
.content-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    min-width: 280px;
    max-width: 340px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-text-gray);
}
.content-popup.active { display: block; }
.popup-title {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 30px;
    }
    .footer-col { flex: 1; }
    .footer-title { font-size: 1.2rem; }
}

/* =========================================
   7. COOKIE BANNER — Mobile-First, iOS Safe
   ========================================= */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--header-border);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.1);
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    -webkit-transform: translateY(100%);
    transform: translateY(100%);
    -webkit-transition: opacity 0.4s ease, -webkit-transform 0.4s ease;
    transition: opacity 0.4s ease, transform 0.4s ease;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    box-sizing: border-box;
}
.cookie-banner.show {
    opacity: 1;
    pointer-events: auto;
    -webkit-transform: translateY(0);
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cookie-text h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--color-text-dark);
}
.cookie-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-gray);
    line-height: 1.5;
}
.cookie-text a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}
.cookie-text a:hover { text-decoration: underline; }

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.btn-decline, .btn-accept {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    -webkit-transition: var(--transition-base);
    transition: var(--transition-base);
    font-family: var(--font-body);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}
.btn-decline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--color-text-gray);
}
.btn-decline:hover {
    border-color: var(--color-text-gray);
    color: var(--color-text-dark);
}
.btn-accept {
    background: linear-gradient(135deg, var(--color-primary), #28d87a);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-green);
}
.btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 200, 83, 0.35);
}

@media (min-width: 768px) {
    .cookie-content {
        flex-direction: row;
        align-items: center;
        gap: 24px;
    }
    .cookie-banner { padding: 20px; }
}

/* =========================================
   8. GLOBAL MODALS (Privacy & Terms)
   ========================================= */
.global-modal-overlay,
.contact-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 16px;
    overflow-y: auto;
}
.global-modal-overlay.active,
.contact-modal-overlay[style*="display: flex"] {
    display: flex;
}

.global-modal-content,
.privacy-modal {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px 20px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.35s var(--easing-out);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.global-close-btn,
.close-modal {
    position: absolute;
    top: 16px; right: 16px;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-border);
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    color: var(--color-text-gray);
    cursor: pointer;
    transition: var(--transition-base);
    line-height: 1;
}
.global-close-btn:hover, .close-modal:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.modal-title-green {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 20px;
    padding-right: 40px;
}

.global-modal-text, .modal-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-text-gray);
    margin-bottom: 24px;
}
.global-modal-text h4,
.modal-text h4,
.modal-h4 {
    color: var(--color-text-dark);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-gray);
    margin-bottom: 12px;
}

.modal-text-justified { text-align: justify; }

.modal-submit-btn {
    width: 100%;
    margin-top: 8px;
}

@media (min-width: 768px) {
    .global-modal-content, .privacy-modal { padding: 36px 32px; }
    .modal-title-green { font-size: 1.5rem; }
}

/* =========================================
   9. GLASS PANEL UTILITY
   ========================================= */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}
.glass-panel:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 200, 83, 0.15);
}

[data-theme="dark"] .glass-panel,
[data-theme="dark"] .stat-3d-card,
[data-theme="dark"] .category-card,
[data-theme="dark"] .help-card,
[data-theme="dark"] .feature-card {
    background: rgba(25, 25, 35, 0.7);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* =========================================
   10. RESPONSIVE UTILITIES
   ========================================= */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Tooltip/privacy link */
.privacy-link, .tooltip-link {
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
}
.privacy-link:hover, .tooltip-link:hover {
    color: var(--color-primary-dark);
}

/* =========================================
   11. STATS RESPONSIVE (Mobile 2-col)
   ========================================= */
@media (max-width: 600px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 16px !important;
    }
    .stat-box { padding: 20px 14px !important; }
    .stat-number { font-size: 2rem !important; }
    .stat-label { font-size: 0.75rem !important; letter-spacing: 0.08em !important; }
}
