/* Home New CSS - Versione migliorata e ottimizzata */
/* Stili migrati da style-home.css per consolidamento */

/* Reset CSS Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

        /* Variabili per il tema chiaro/scuro */
        :root {
            --primary: #6366f1;
            --primary-hover: #4f46e5;
            --primary-light: rgba(99, 102, 241, 0.1);
            --secondary: #200e51;
            --accent: #8b5cf6;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --info: #3b82f6;

            --gray-50: #f9fafb;
            --gray-100: #f3f4f6;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-400: #9ca3af;
            --gray-500: #6b7280;
            --gray-600: #4b5563;
            --gray-700: #374151;
            --gray-800: #1f2937;
            --gray-900: #111827;
            --gray-950: #030712;

            --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            --gradient-secondary: linear-gradient(135deg, #d648ec 0%, #f87171 100%);

            --text-primary: var(--gray-800);
            --text-secondary: var(--gray-600);
            --text-muted: var(--gray-400);
            --bg-body: var(--gray-50);
            --bg-card: #ffffff;
            --border-color: var(--gray-200);
            --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }

        html[data-theme='dark'] {
            --text-primary: var(--gray-100);
            --text-secondary: var(--gray-300);
            --text-muted: var(--gray-500);
            --bg-body: var(--gray-900);
            --bg-card: var(--gray-800);
            --border-color: var(--gray-700);
            --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
            --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
        }

        /* Applicare i colori del tema agli elementi specifici */

        /* Icone bianche nei pulsanti del welcome banner */
        #welcome-banner .auth-actions .btn i {
            color: white !important;
        }

        /* Welcome Banner Buttons - Same size as service buttons */
        #welcome-banner .auth-actions .btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 14px 28px;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border: none;
            cursor: pointer;
            position: relative;
        }

        #welcome-banner .auth-actions .btn::after {
            content: '→';
            transition: transform 0.3s ease;
        }

        #welcome-banner .auth-actions .btn:hover {
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
            text-decoration: none;
        }

        #welcome-banner .auth-actions .btn:hover::after {
            transform: translateX(4px);
        }

        /* User Menu Dropdown Styles - Ora centralizzati in auth-components.css */
        /* Gli stili sono stati spostati in UI/css/auth-components.css per coerenza cross-page */
        html[data-theme='dark'] .hero-section {
            background-color: var(--gray-900);
        }

        html[data-theme='dark'] .service-card,
        html[data-theme='dark'] .kb-card,
        html[data-theme='dark'] .agent-card,
        html[data-theme='dark'] .agents-section,
        html[data-theme='dark'] .services-section {
            background-color: var(--bg-card);
            border-color: var(--border-color);
        }

        /* Dark mode per navbar - chiaro come prima */
        html[data-theme='dark'] .navbar {
            background: rgba(31, 41, 55, 0.95);
            border-bottom: 1px solid rgba(75, 85, 99, 0.3);
        }

        html[data-theme='dark'] .navbar.scrolled {
            background: rgba(31, 41, 55, 0.98);
            border-bottom: 1px solid rgba(75, 85, 99, 0.3);
        }

        html[data-theme='dark'] .navbar-link {
            color: var(--text-primary);
        }

        html[data-theme='dark'] .navbar-link:hover {
            color: var(--primary);
        }

        html[data-theme='dark'] .floating-elements .floating-element {
            background: rgba(255, 255, 255, 0.03);
        }

        /* Nascondi floating-elements nella zona della navbar per evitare sovrapposizioni */
        /* I floating-elements hanno z-index: 1, quindi sono sotto la navbar (z-index: 1000) */
        /* Ma per sicurezza, riduciamo l'opacità degli elementi nella parte superiore */
        .floating-elements .floating-element {
            /* Se l'elemento si trova nella zona navbar (top < 15%), riduci opacità */
        }

        /* Regola specifica per elementi nella zona superiore */
        .floating-elements .floating-element:nth-child(1),
        .floating-elements .floating-element:nth-child(4) {
            opacity: 0.15; /* Ridotta opacità per elementi nella zona superiore */
        }

        html[data-theme='dark'] .admin-section {
            background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
        }

        html[data-theme='dark'] .kb-section {
            background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
        }



        html[data-theme='dark'] .agents-grid,
        html[data-theme='dark'] .services-grid {
            background-color: var(--bg-card);
        }

        html[data-theme='dark'] .section-divider h2,
        html[data-theme='dark'] .section-divider p {
            color: var(--text-primary);
        }

        /* Dark theme override per header - RIMOSSO (2026-01-25)
           La toolbar centralizzata ha gradient viola fisso, non cambia con tema.
           Stili gestiti da header-responsive.css */

        body {
            background-color: var(--bg-body);
            color: var(--text-primary);
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        html.hero-locked,
        body.hero-locked {
            height: 100%;
            overflow: hidden;
        }

        /*
         * Homepage splash: su viewport basse (es. laptop 14" con toolbar browser) il blocco hero
         * supera l’altezza utile — senza scroll il pulsante "Prova ora" resta fuori e overflow:hidden lo taglia.
         */
        html[data-page="homepage"].hero-locked,
        body[data-page="homepage"].hero-locked {
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* 🆕 Override altezza header solo per la homepage (sincronizza --toolbar-height per logo immagine) */
        body[data-page="homepage"] .header-container,
        body[data-page="homepage"] .main-header .header-container {
            --toolbar-height: 60px !important;
            height: 60px !important;
        }

        /*
         * Toolbar fixed: non occupa flusso — senza questo spazio il workspace (titolo, chat, icone)
         * parte da y=0 e finisce sotto l'header. Allineato a --toolbar-height homepage (60px).
         */
        html[data-page="homepage"] {
            scroll-padding-top: max(env(safe-area-inset-top, 0px), 60px);
        }

        body[data-page="homepage"] {
            --homepage-toolbar-clearance: 60px;
        }


        .section-divider {
            margin: clamp(6.5rem, 9vw, 8.5rem) 0 clamp(5.5rem, 7.5vw, 7rem) 0;
            text-align: center;
            position: relative;
            z-index: 10;
        }

        /* Divisore visivo tra sezioni */
        .section-divider::before {
            content: '';
            position: absolute;
            top: -30px;
            left: 50%;
            transform: translateX(-50%);
            width: 80%;
            height: 3px;
            background: linear-gradient(90deg, transparent, #CBCBD8, transparent);
            border-radius: 2px;
        }

        .section-divider h2 {
            color: #232145; /* colore più scuro per migliore contrasto */
            font-size: 3.5rem;
            font-weight: 800;
            font-family: var(--font-sans);
            margin-bottom: 36px; /* extra spazio per evitare sovrapposizione con il sottotitolo */
            position: relative;
            padding: 8px 18px;
            border-radius: 12px;
            text-shadow: none; /* rimuoviamo text-shadow per il nuovo design */
            text-transform: uppercase; /* Titoli sezioni in maiuscolo */
            letter-spacing: 1px; /* Spacing per leggibilità */
        }


        /* Assicura che le emoji nei titoli mantengano i loro colori originali */
        .section-divider h2 * {
            background: none !important;
            background-clip: unset !important;
            -webkit-background-clip: unset !important;
            -webkit-text-fill-color: unset !important;
            color: inherit !important;
        }

        .section-divider h2::after {
            content: '';
            position: absolute;
            bottom: -12px;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 6px;

            border-radius: 3px;
            box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
        }

        .section-divider p {
            color: var(--text-secondary);
            font-size: 1.1rem;
            margin-top: 24px; /* incremento per distanziare dal titolo con underline decorativa */
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
            line-height: 1.6;
        }

        /* Responsive fix: riduci dimensioni e spaziature su mobile per evitare overlap */
        @media (max-width: 768px) {
            .section-divider h2 {
                font-size: 2.3rem;
                margin-bottom: 28px;
            }
            .section-divider h2::after {
                width: 60px;
                height: 5px;
                bottom: -10px;
            }
            .section-divider p {
                font-size: 0rem;
                margin-top: 0px;
                padding: 0 0px;
            }
        }

        .agents-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 24px;
            justify-content: center;
            margin-bottom: 40px;
            margin-top: 200px;
            align-items: stretch; /* garantisce allineamento verticale */
        }

        .agents-grid .service-card {
            flex: 1 1 300px; /* grow, shrink, minimum width */
            max-width: 340px;
            min-height: 260px;
        }



        /* Background sezioni differenziati */
        .agents-section {
            background: transparent;
            padding: 60px 0;
            margin: 0;
        }

        .admin-section {
            background: linear-gradient(135deg, #fef7ed 0%, #dee3e6 100%);
            padding: 60px 0;
            margin: 0;
            width: 100vw;
            position: relative;
            left: 50%;
            right: 50%;
            margin-left: -50vw;
            margin-right: -50vw;
        }

        .admin-section .services-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* Knowledge Base Section */
        .kb-section {
            background: linear-gradient(135deg, #f0fdf4 0%, #f5ab60 100%);
            padding: 60px 0;
            margin: 0;
            width: 100vw;
            position: relative;
            left: 50%;
            right: 50%;
            margin-left: -50vw;
            margin-right: -50vw;
        }

        .kb-section .services-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
        }

        .kb-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 24px;
            justify-content: center;
            margin-bottom: 40px;
            margin-top: 200px;
            align-items: stretch; /* garantisce allineamento verticale */
        }

        .kb-grid .service-card {
            flex: 1 1 300px; /* grow, shrink, minimum width */
            max-width: 340px;
            min-height: 260px;
        }

        .status-section {
            background: linear-gradient(135deg, #f0f9ff 0%, #dbeafe 100%);
            padding: 60px 0;
            margin: 0;
            width: 100vw;
            position: relative;
            left: 50%;
            right: 50%;
            margin-left: -50vw;
            margin-right: -50vw;
        }

        .status-section .services-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
        }

        .admin-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 25px;
            margin-bottom: 40px;
            margin-top: 200px;
        }

        .info-grid-new {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-top: 40px;
        }

        .service-card.priority-high {
            border-left: 5px solid #10b981;
            box-shadow: 0 10px 25px rgba(16, 185, 129, 0.1);
        }

        .service-card.priority-medium {
            border-left: 5px solid #f59e0b;
            box-shadow: 0 10px 25px rgba(245, 158, 11, 0.1);
        }

        /* Highlight style for NoteBuddy (moved from inline) */
        .notebuddy-highlight {
            outline: 3px solid rgba(168,85,247,0.18);
            box-shadow: 0 14px 40px rgba(168,85,247,0.08);
            position: relative;
            animation: subtlePulse 3s ease-in-out infinite;
        }

        @keyframes subtlePulse {
            0% { transform: translateY(0); }
            50% { transform: translateY(-2px); }
            100% { transform: translateY(0); }
        }

        /* Status pill for services */
        .status-pill {
            display: inline-block;
            padding: 6px 10px;
            border-radius: 999px;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.4px;
        }

        .status-online { background-color: #dcfce7; color: #166534; }
        .status-offline { background-color: #fef2f2; color: #dc2626; }
        .status-checking { background-color: #fef3c7; color: #d97706; }

        /* "Nuovo" badge */
        .new-badge {
            display: inline-block;
            background: linear-gradient(135deg,#8b5cf6,#a855f7);
            color: white;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 700;
            margin-left: 8px;
            box-shadow: 0 6px 18px rgba(139,92,246,0.18);
            transform-origin: center;
            animation: badgeFloat 2.6s ease-in-out infinite;
        }

        @keyframes badgeFloat {
            0% { transform: translateY(0); }
            50% { transform: translateY(-4px); }
            100% { transform: translateY(0); }
        }

        .service-card.priority-low {
            border-left: 5px solid #6b7280;
            box-shadow: 0 10px 25px rgba(107, 114, 128, 0.1);
        }

        .service-icon {
            font-size: 2rem;
            color: var(--primary);
            margin-bottom: 15px;
            display: block;
            width: 60px;
            height: 60px;
            border-radius: 15px;
            background: var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .status-overview {
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            border-radius: 12px;
            padding: 25px;
            margin-bottom: 30px;
        }

        .status-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .status-item {
            display: grid;
            grid-template-columns: auto 1fr auto;
            grid-template-rows: auto auto;
            gap: 8px 12px;
            padding: 15px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            align-items: center;
        }

        .status-item .icon {
            font-size: 2.4rem;
            grid-row: 1 / 3;
            width: 50px;
            height: 50px;
            border-radius: 12px;
            background: var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .status-item .name {
            font-weight: 600;
            color: #1f2937;
            font-size: 1rem;
        }

        .status-item .description {
            color: #6b7280;
            font-size: 0.85rem;
            grid-column: 2;
        }

        .status-item .status {
            grid-row: 1 / 3;
            grid-column: 3;
        }

        .endpoints-list {
            background: white;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15),
                0 10px 20px rgba(0, 0, 0, 0.1),
                0 4px 8px rgba(0, 0, 0, 0.05);
        }

        .endpoint-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #e5e7eb;
        }

        .endpoint-item:last-child {
            border-bottom: none;
        }

        .endpoint-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .service-icon-small {
            font-size: 2.2rem;
            margin-right: 8px;
            width: 45px;
            height: 45px;
            border-radius: 10px;
            background: var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .endpoint-name {
            font-weight: 500;
            color: #374151;
        }

        .endpoint-url {
            background: #f3f4f6;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.85rem;
            color: #6b7280;
        }



        @keyframes gradientShift {

            0%,
            100% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }
        }


        /* Enhanced navigation - Hero section buttons
           Nota: .hero-nav .nav-btn per evitare conflitto con toolbar .nav-btn */
        .hero-nav {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 15px;
            margin-top: 40px;
        }

        .hero-nav .nav-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 20px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            color: white;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s ease;
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            font-size: 1rem;
        }

        .hero-nav .nav-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
            color: white;
            text-decoration: none;
        }

        .hero-nav .nav-btn .icon {
            font-size: 2.2rem;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .status {
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .status-online {
            background-color: #dcfce7;
            color: #166534;
        }

        .status-offline {
            background-color: #fef2f2;
            color: #dc2626;
        }

        .status-checking {
            background-color: #fef3c7;
            color: #d97706;
        }

        /* Tooltip per badge tecnici */
        .badge {
            position: relative;
            cursor: help;
        }

        .badge::after {
            content: attr(title);
            position: absolute;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            background: #232145;
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 0.8rem;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s, visibility 0.3s;
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .badge::before {
            content: '';
            position: absolute;
            bottom: 115%;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-top-color: #232145;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s, visibility 0.3s;
            z-index: 1000;
        }

        .badge:hover::after,
        .badge:hover::before {
            opacity: 1;
            visibility: visible;
        }






        /* Enhanced Footer Styles - Ottimizzato */
        .footer-enhanced {
            background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
            color: white;
            margin-top: 0; /* Rimosso margin-top per eliminare spazio */
            border-top: none; /* Rimossa banda viola */
            position: relative;
            overflow: hidden;
            overflow-x: hidden; /* Evita overflow orizzontale su mobile */
        }

        /* Overlay scuro sopra il footer per coprire completamente la banda viola */
        .footer-enhanced::before {
            content: '';
            position: absolute;
            top: -80px; /* Estende sopra il footer per coprire la banda viola (aumentato da 50px) */
            left: 0;
            right: 0;
            height: 80px; /* Aumentato per coprire meglio la banda viola */
            background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
            z-index: 1;
        }

        /* Nasconde qualsiasi elemento viola che potrebbe apparire prima del footer */
        .desktop-section::after {
            bottom: 0 !important; /* Assicura che non si estenda oltre */
        }

        /* Assicura che il contenuto del footer sia sopra l'overlay */
        .footer-container {
            position: relative;
            z-index: 2;
        }

        /* Nasconde eventuali gradient overlay che si estendono oltre la sezione desktop */
        .desktop-section::before {
            bottom: 0; /* Assicura che il gradient non si estenda oltre la sezione */
        }

        /* Assicura che non ci siano elementi viola tra desktop-section e footer */
        section + .footer-enhanced {
            margin-top: 0 !important;
            border-top: none !important;
        }

        /* Rimuove eventuali gradient viola che potrebbero apparire prima del footer */
        body > section:last-of-type::after {
            display: none;
        }

        /* Nasconde completamente qualsiasi elemento viola prima del footer */
        .desktop-section + .footer-enhanced::before,
        section:last-of-type + .footer-enhanced::before {
            display: block !important; /* Mostra l'overlay scuro */
        }

        /* Aggiunge un overlay scuro per coprire eventuali gradient viola residui */
        .footer-enhanced {
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5) inset; /* Ombra interna superiore più scura per nascondere gradient */
        }

        .footer-container {
            max-width: 1400px;
            width: 100%;
            box-sizing: border-box;
            margin: 0 auto;
            padding: 0 20px;
        }

        .footer-grid {
            display: flex; /* Flexbox per mettere tutto su una riga */
            align-items: center; /* Allinea verticalmente al centro */
            justify-content: space-between; /* Distribuisce lo spazio */
            gap: 2rem;
            padding: 0.75rem 0; /* Altezza ridotta: da 1.5rem/1rem a 0.75rem */
            max-width: 1400px; /* Larghezza massima per contenere tutto */
            margin: 0 auto; /* Centra il contenuto */
            min-width: 0; /* Consente restringimento su mobile */
        }

        .footer-column {
            display: flex; /* Flexbox per allineare elementi in riga */
            align-items: center; /* Allinea verticalmente */
            gap: 1.5rem; /* Spazio tra elementi */
        }

        .footer-column h4 {
            margin: 0; /* Rimuove margin */
            font-size: 1.1rem; /* Ridotto per adattarsi alla riga */
            font-weight: 700;
        }

        /* Link D-One Platform con colore corretto per sfondo nero */
        .footer-brand-link {
            color: #60a5fa !important; /* Colore blu chiaro per link su sfondo nero */
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .footer-brand-link:hover {
            color: #93c5fd !important; /* Colore più chiaro al hover */
            text-decoration: underline;
        }

        .footer-column h5 {
            color: #e2e8f0;
            margin: 0; /* Rimuove margin per riga singola */
            font-size: 1rem;
            font-weight: 600;
        }

        /* Teaser portale nella colonna centrale */
        .footer-teaser-col p {
            color: #cbd5e1;
            line-height: 1.4; /* Compattato per riga singola */
            margin: 0; /* Rimuove margin */
            font-size: 0.9rem; /* Leggermente ridotto */
            text-align: center; /* Centra il testo */
        }

        /* Link Richiedi supporto nella colonna destra */
        .support-link {
            color: #60a5fa !important; /* Colore blu chiaro per link su sfondo nero */
            text-decoration: none;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: color 0.3s ease;
        }

        .support-link:hover {
            color: #93c5fd !important; /* Colore più chiaro al hover */
            text-decoration: underline;
        }

        .support-link i {
            color: #60a5fa;
        }

        .contact-info i {
            color: #667eea;
            width: 16px;
        }

        .footer-links {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .footer-links li {
            margin-bottom: 0.35rem; /* Compattato: da 0.5rem a 0.35rem */
        }

        .footer-links a {
            color: #cbd5e1;
            text-decoration: none;
            transition: all 0.3s ease;
            display: inline-block;
            padding: 0.15rem 0; /* Compattato: da 0.25rem a 0.15rem */
        }

        .footer-links a:hover {
            color: #667eea;
            transform: translateX(5px);
        }

        /* Compliance & Security Badges */
        .compliance-badge, .security-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem; /* Compattato: da 0.5rem a 0.4rem */
            padding: 0.4rem 0.8rem; /* Compattato: da 0.5rem 1rem a 0.4rem 0.8rem */
            border-radius: 18px; /* Leggermente ridotto: da 20px a 18px */
            font-size: 0.8rem; /* Leggermente ridotto: da 0.85rem a 0.8rem */
            font-weight: 500;
            border: 1px solid;
        }

        .compliance-badge {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
            border-color: #10b981;
        }

        .security-badge {
            background: rgba(59, 130, 246, 0.1);
            color: #3b82f6;
            border-color: #3b82f6;
        }

        .footer-status {
            color: #68d391;
            font-weight: 600;
        }

        .footer-bottom {
            border-top: 1px solid #4a5568;
            padding: 0.5rem 0; /* Altezza ridotta: da 1rem a 0.5rem */
        }

        .footer-bottom-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
            font-size: 0.85rem; /* Leggermente ridotto */
            min-width: 0; /* Consente restringimento su mobile */
        }

        .footer-bottom-content p {
            margin: 0;
            color: #a0aec0;
            font-size: 0.85rem; /* Leggermente ridotto: da 0.9rem a 0.85rem */
            word-wrap: break-word;
            overflow-wrap: break-word;
            max-width: 100%;
        }

        .footer-bottom-content p a {
            color: #a0aec0;
            text-decoration: none;
        }
        .footer-bottom-content p a:hover {
            color: #cbd5e1;
            text-decoration: underline;
        }

        .footer-tech-stack {
            display: flex;
            gap: 0.4rem; /* Compattato: da 0.5rem a 0.4rem */
            flex-wrap: wrap;
        }

        .tech-badge {
            background: rgba(102, 126, 234, 0.2);
            color: #667eea;
            padding: 0.2rem 0.6rem; /* Compattato: da 0.25rem 0.75rem a 0.2rem 0.6rem */
            border-radius: 10px; /* Leggermente ridotto: da 12px a 10px */
            font-size: 0.75rem; /* Leggermente ridotto: da 0.8rem a 0.75rem */
            font-weight: 500;
            border: 1px solid rgba(102, 126, 234, 0.3);
        }

        /* Footer Legal Section */
        .footer-legal {
            display: flex;
            gap: 0.75rem; /* Compattato: da 1rem a 0.75rem */
            flex-wrap: wrap;
            max-width: 100%;
        }

        .footer-legal a {
            color: #a0aec0;
            text-decoration: none;
            font-size: 0.8rem; /* Leggermente ridotto: da 0.85rem a 0.8rem */
            transition: color 0.3s ease;
        }

        .footer-legal a:hover {
            color: #667eea;
        }



        /* Navbar Styles from index3.html */
        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
        }



        /* Notification Styles */
        .notification-fixed {
            position: fixed !important;
            top: 20px !important;
            right: 20px !important;
            z-index: 9999 !important;
            max-width: 400px !important;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
            border-radius: 8px !important;
            padding: 1rem !important;
            animation: slideInRight 0.3s ease-out !important;
        }

        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOutRight {
            from {
                transform: translateX(0);
                opacity: 1;
            }

            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        /* Protected content styles */
        .protected-content {
            display: none;
        }

        .auth-required {
            display: block;
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            .auth-buttons {
                gap: 0.25rem;
            }

            .btn-auth {
                padding: 0.4rem 0.8rem;
                font-size: 0.8rem;
            }

            .user-menu-toggle {
                padding: 0.2rem 0.4rem;
                font-size: 0.6rem;
            }
        }

        /* .btn-theme-toggle - RIMOSSO: ora gestito da header-responsive.css
           La homepage usa la toolbar centralizzata da daitanone-ui.js */

        .hamburger-menu {
            display: none;
            width: 40px;
            height: 40px;
            background: var(--bg-card);
            border: none;
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 1.2rem;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .btn {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 1rem 2rem;
            font-weight: 600;
            font-size: 0.95rem;
            border-radius: 12px;
            text-decoration: none;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: none;
            cursor: pointer;
            overflow: hidden;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
        }

        .btn:hover::before {
            left: 100%;
        }

        .btn-primary {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        .btn-primary:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }

        .btn-accent {
            background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
            color: white;
            border: none;
        }

        .btn-accent:hover {
            background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
        }

        .btn-outline {
            background: transparent;
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }

        .btn-outline:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
        }

        .btn-icon {
            font-size: 1.1rem;
        }

        .scroll-indicator {
            position: absolute;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            padding: 0;
            border: none;
            background: none;
            color: rgba(255, 255, 255, 0.8);
            text-decoration: none;
            transition: all 0.3s ease;
            cursor: pointer;
            font: inherit;
        }

        .scroll-indicator:hover {
            color: white;
            transform: translateX(-50%) translateY(-5px);
        }

        /* Pulsante "Prova ora!" nella hero */
        .btn-hero-prova {
            background: rgba(156, 63, 196, 0.662);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 2px solid rgba(255, 255, 255, 0.3);
            color: white;
            font-size: 1.2rem;
            font-weight: 600;
            padding: 14px 32px;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 2rem;
            font-family: var(--font-sans);
        }

        .btn-hero-prova:hover {
            background: rgba(255, 255, 255, 0.25);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

        .btn-hero-prova:active {
            transform: translateY(0);
        }

        .scroll-indicator-text {
            font-size: 0.9rem;
            font-weight: 500;
        }

        .scroll-indicator-icon {
            animation: float 2s ease-in-out infinite;
        }


        @media (max-width: 768px) {
            .info-grid-new {
                grid-template-columns: 1fr;
            }

            .agents-grid {
                grid-template-columns: 1fr;
            }

            .admin-grid {
                grid-template-columns: 1fr;
            }

            .kb-grid {
                grid-template-columns: 1fr;
            }
        }

        @keyframes float {

            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-10px);
            }
        }

        /* Media queries for responsiveness */
        @media (max-width: 992px) {
            .navbar-menu {
                display: none;
            }

            .hamburger-menu {
                display: flex;
            }
        }

        @media (max-width: 768px) {
            .hero-buttons {
                flex-direction: column;
                align-items: center;
            }

            .btn {
                width: 100%;
                max-width: 300px;
                justify-content: center;
            }

            /* Footer Responsive */
            .footer-container {
                padding: 0 var(--space-3, 1rem);
                max-width: 100%;
            }

            .footer-grid {
                flex-direction: column;
                align-items: center;
                text-align: center;
                gap: 1rem;
                padding: 0.75rem 0;
            }

            .footer-column {
                flex-direction: column;
                align-items: center;
            }

            .footer-teaser-col p {
                text-align: center;
            }

            .footer-bottom-content {
                flex-direction: column;
                text-align: center;
                gap: 0.75rem;
            }

            .footer-bottom-content p {
                font-size: 0.8rem;
                text-align: center;
            }

            .footer-tech-stack {
                justify-content: center;
            }

            .footer-legal {
                justify-content: center;
                flex-wrap: wrap;
            }
        }

        @media (max-width: 480px) {
            .navbar-container {
                padding: 0 15px;
            }

            .hero-content {
                padding: 0 15px;
            }

            /* Footer Mobile stretto */
            .footer-container {
                padding: 0 var(--space-2, 0.5rem);
            }

            .footer-bottom-content p {
                font-size: 0.75rem;
            }

            .tech-badge {
                font-size: 0.75rem;
                padding: 0.2rem 0.6rem;
            }

            .footer-legal {
                flex-direction: row;
                justify-content: center;
                gap: 0.35rem;
                font-size: 0.75rem;
            }

            .footer-legal a {
                font-size: 0.75rem;
            }
        }


        @keyframes gridMove {
            0% {
                transform: perspective(1000px) rotateX(60deg) translateY(0);
            }

            100% {
                transform: perspective(1000px) rotateX(60deg) translateY(50px);
            }
        }



        /* Enhanced Hero Background */
        .hero-grid {
            position: absolute;
            width: 200%;
            height: 200%;
            top: -50%;
            left: -50%;
            background-image:
                linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
            background-size: 60px 60px;
            transform: perspective(900px) rotateX(55deg) scale(1.15);
            animation: gridMove 45s linear infinite;
            opacity: 0.35;
            z-index: 2;
            pointer-events: none;
            will-change: transform;
        }

        .hero-glow {
            position: absolute;
            width: 60%;
            height: 40%;
            top: 30%;
            left: 20%;
            background: radial-gradient(circle,
                    rgba(93, 133, 6, 0.08) 0%,
                    rgba(139, 92, 246, 0.04) 35%,
                    rgba(15, 23, 42, 0) 75%);
            filter: blur(50px);
            z-index: 3;
            pointer-events: none;
        }




        /* Enhanced Hero Badge */
        .hero-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.5rem 1rem;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50px;
            font-size: 0.875rem;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 2rem;
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .hero-badge-icon {
            margin-right: 0.5rem;
            font-size: 1rem;
        }



        /* Hero Content Container */
        .hero-content {
            position: relative;
            z-index: 2;
            color: white;
            max-width: 800px;
            padding: 0 20px;
            text-align: center;
        }

        /* Hero title tuned for video contrast */
        .hero-title {
            font-family: 'Montserrat', sans-serif;
            font-size: clamp(2rem, 8vw, 5rem);
            font-weight: 800;
            margin-bottom: 1rem;
            display: inline-flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            align-items: baseline;
            letter-spacing: -0.015em;
            z-index: 2;
            justify-content: center;
        }

        .hero-title .hero-word {
            display: inline-block;
            color: rgba(17, 24, 39, 0.92);
            -webkit-text-fill-color: rgba(17, 24, 39, 0.92);
            text-shadow: 0 18px 40px rgba(255, 255, 255, 0.35);
            -webkit-text-stroke: 1.35px rgba(255, 255, 255, 0.85);
            paint-order: stroke fill;
        }

        .hero-title .hero-word.highlight {
            color: rgba(12, 74, 110, 0.95);
            -webkit-text-fill-color: rgba(12, 74, 110, 0.95);
            -webkit-text-stroke: 1.35px rgba(255, 255, 255, 0.85);
            paint-order: stroke fill;
        }

        .hero-title .hero-word.accent {
            color: rgba(85, 11, 11, 0.95);
            -webkit-text-fill-color: rgba(140, 20, 20, 0.847);
            text-shadow: 0 12px 32px rgba(248, 113, 113, 0.35);
            -webkit-text-stroke: 1.35px rgba(255, 255, 255, 0.85);
            paint-order: stroke fill;
        }
        
        /* Hero Subtitle */
        .hero-subtitle {
            font-size: clamp(1.2rem, 3vw, 1.8rem);
            margin-bottom: 2rem;
            opacity: 0.9;
            line-height: 1.4;
            color: white;
        }
        /* Background animation color Hero Section */
        .hero-section {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: white;
            overflow: hidden;
            /* Occupazione full screen sotto la toolbar */
            min-height: 100vh;
            min-height: 100dvh; /* Mobile Safari: rispetta la viewport dinamica */
            height: 100vh;
            height: 100dvh;
            width: 100%;
            padding-top: 0;
            margin-top: 0;
            background: #020617;
        }
        
        /* Se la navbar è fixed, la hero deve partire da sotto */
        body:not(.hero-locked) .hero-section {
            margin-top: 0;
        }
        
        body.hero-locked .hero-section {
            /* Quando hero-locked è attivo, assicurati che occupi tutto lo spazio */
            min-height: 100vh;
            min-height: 100dvh;
            height: 100vh;
            height: 100dvh;
        }

        .hero-section.is-hidden {
            display: none;
        }

        /*
         * Homepage splash: la hero deve coprire tutta la prima schermata (niente footer “in vista”).
         * daitanone-ui impone body flex + main { flex:1; min-height:0 }: senza questo il main si restringe
         * e in basso resta visibile la striscia del footer.
         */
        body[data-page="homepage"] .floating-elements {
            position: fixed;
            inset: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1;
        }

        /* !important: daitanone-ui assegna flex inline a main e altrimenti queste regole non vincono */
        body[data-page="homepage"] main:has(.hero-section:not(.is-hidden)) {
            flex: 1 0 auto !important;
            min-height: 100svh !important;
            min-height: 100dvh !important;
        }

        body[data-page="homepage"] .hero-section:not(.is-hidden) {
            flex-shrink: 0;
            height: auto;
            min-height: 100svh;
            min-height: 100dvh;
            min-height: max(100svh, 100dvh);
            /* Non tagliare titolo/sottotitolo/CTA: lo scroll avviene sulla pagina */
            overflow-x: hidden;
            overflow-y: visible;
        }

        .desktop-section {
            display: none;
            background: var(--desktop-section-bg, var(--bg-body));
            position: relative;
            overflow: hidden;
            overflow-x: hidden; /* Evita scroll orizzontale su mobile */
            margin-bottom: 0; /* Assicura che non ci sia spazio extra prima del footer */
        }

        .desktop-section.is-visible {
            display: block;
        }

        /* Background Image Layer - Immagine di sfondo sfumata sul desktop */
        .desktop-section::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            background-image: var(--desktop-bg-image, none);
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            /* 
             * FILTER: Applica effetti visivi all'immagine di sfondo
             * 
             * blur(20px): Sfoca l'immagine
             *   - Valore: 0px (nessun blur) a 50px+ (molto sfocato)
             *   - Esempio: blur(10px) = meno sfocato, blur(30px) = più sfocato
             *   - Modifica questo valore per cambiare l'intensità dello sfocamento
             * 
             * brightness(0.7): Regola la luminosità dell'immagine
             *   - Valore: 0.0 (nero) a 1.0 (normale) a 2.0+ (molto luminoso)
             *   - Esempio: brightness(0.5) = più scuro, brightness(0.9) = più chiaro
             *   - Modifica questo valore per rendere l'immagine più chiara/scura
             * 
             * Altri filtri disponibili (puoi aggiungerli separati da spazio):
             *   - contrast(1.2): Aumenta contrasto (0.5 = basso, 2.0 = alto)
             *   - saturate(1.5): Aumenta saturazione colori (0 = grigio, 2.0 = molto colorato)
             *   - sepia(0.3): Effetto seppia (0 = normale, 1.0 = completamente seppia)
             */
            filter: blur(20px) brightness(0.9);
            
            /* 
             * -WEBKIT-FILTER: Versione per browser WebKit (Safari, Chrome vecchi)
             *   - Stesso valore di filter per compatibilità
             *   - Mantieni sempre lo stesso valore di filter
             */
            -webkit-filter: blur(20px) brightness(0.9);
            
            /* 
             * TRANSFORM SCALE: Ingrandisce l'immagine per evitare bordi bianchi dal blur
             * 
             * scale(1.1): Ingrandisce l'immagine del 10%
             *   - Valore: 1.0 (normale) a 1.2+ (più grande)
             *   - Esempio: scale(1.0) = dimensione normale, scale(1.15) = più grande
             *   - Più grande = meno bordi bianchi visibili dopo il blur
             *   - Modifica questo valore se vedi bordi bianchi o se l'immagine è troppo grande
             * 
             * Perché serve: Il blur può creare bordi bianchi/trasparenti ai lati.
             *               Ingrandendo l'immagine, questi bordi vengono tagliati via.
             */
            transform: scale(1.1);
            
            /* 
             * OPACITY: Controlla la trasparenza dell'immagine di sfondo
             * 
             * opacity: 0 = Immagine completamente invisibile (quando non c'è immagine caricata)
             * opacity: 1 = Immagine completamente visibile (100% opacità)
             * 
             * Per VELARE l'immagine (renderla meno visibile):
             *   - Riduci l'opacità: opacity: 0.3-0.6 = immagine più velata
             *   - Esempio: opacity: 0.4 = immagine al 40% (molto velata)
             *   - Esempio: opacity: 0.7 = immagine al 70% (leggermente velata)
             * 
             * Modifica questo valore per controllare quanto l'immagine è visibile
             */
            opacity: 0.4;
            transition: opacity 0.5s ease-in-out;
            pointer-events: none;
        }

        .desktop-section.has-bg-image::after {
            /* 
             * OPACITY quando l'immagine è caricata
             * 
             * Valore attuale: opacity: 0.7 (70% visibile - ridotto del 30% rispetto a 1.0)
             * 
             * Per VELARE maggiormente l'immagine, riduci questo valore:
             *   - opacity: 0.3 = Immagine molto velata (30% visibile)
             *   - opacity: 0.5 = Immagine mediamente velata (50% visibile)
             *   - opacity: 0.7 = Immagine leggermente velata (70% visibile) ← ATTUALE
             *   - opacity: 1.0 = Immagine completamente visibile
             * 
             * COMBINAZIONE CONSIGLIATA per velare:
             *   - brightness(0.9-1.2) = Schiarisci l'immagine
             *   - opacity: 0.4-0.6 = Riduci opacità
             *   - Esempio: filter: blur(20px) brightness(1.0); opacity: 0.5;
             */
            opacity: 0.5;
        }

        .desktop-section::before {
            content: '';
            position: absolute;
            inset: 0;
            z-index: 1;
            background: linear-gradient(135deg,
                    rgba(255, 254, 255, 0.913) 0%,
                    rgba(214, 189, 237, 0.55) 25%,
                    rgba(207, 82, 221, 0.18) 50%,
                    rgba(120, 17, 130, 0.16) 75%,
                    rgba(5, 46, 81, 0.18) 100%),
                radial-gradient(circle at top left, rgba(234, 230, 237, 0.76), transparent 55%),
                radial-gradient(circle at 70% 20%, rgba(201, 103, 212, 0.429), transparent 50%),
                radial-gradient(circle at bottom right, rgba(67, 8, 84, 0.559), transparent 55%);
            
            /* 
             * OPACITY GRADIENT OVERLAY: Velatura colorata sopra l'immagine
             * 
             * opacity: 0.7 = Overlay al 70% (attuale)
             * 
             * Per VELARE maggiormente l'immagine con questo overlay:
             *   - Aumenta l'opacità: opacity: 0.8-0.9 = overlay più opaco (vela di più)
             *   - Esempio: opacity: 0.85 = overlay molto visibile che vela l'immagine
             * 
             * NOTA: Questo overlay viene nascosto quando c'è un'immagine caricata
             *       (vedi regola .has-bg-image::before sotto)
             */
            opacity: 0.7;
            background-size: 400% 400%;
            background-position: 0% 50%; /* Forza posizione iniziale per consistenza */
            animation: gradientShift 18s ease infinite;
            animation-fill-mode: both; /* Mantiene lo stato iniziale e finale */
            pointer-events: none;
        }

        .desktop-section.is-custom-bg::before,
        .desktop-section.has-bg-image::before {
            /* 
             * Quando c'è un'immagine caricata, nascondi il gradient overlay
             * 
             * Se vuoi VELARE l'immagine con un overlay colorato invece di ridurre opacity:
             *   - Cambia opacity: 0 in opacity: 0.3-0.6
             *   - Esempio: opacity: 0.5 = overlay semi-trasparente che vela l'immagine
             * 
             * Questo crea un effetto di "velo colorato" sopra l'immagine
             */
            opacity: 0;
        }

        .desktop-container {
            width: 100%;
            max-width: 100%;
            margin: 0 auto;
            margin-top: 50px;
            position: relative;
            z-index: 2;
            border-radius: var(--radius-xl);
            padding: var(--space-4);
            box-sizing: border-box;
        }

        .desktop-surface {
            width: 100%;
            max-width: 80vw;
            margin: 0 auto;
            min-height: calc(90vh - 65px);
            min-width: 0; /* Consente restringimento su mobile */
            /* 
             * BACKGROUND OPACITY: Controlla la trasparenza del desktop surface
             * 
             * Valore attuale: rgba(255, 255, 255, 0.4) = 40% opaco (meno trasparente)
             * 
             * Per modificare la trasparenza:
             *   - rgba(255, 255, 255, 0.1) = 10% opaco (molto trasparente)
             *   - rgba(255, 255, 255, 0.2) = 20% opaco (leggermente trasparente)
             *   - rgba(255, 255, 255, 0.3) = 30% opaco (meno trasparente)
             *   - rgba(255, 255, 255, 0.4) = 40% opaco (ancora meno trasparente) ← ATTUALE
             *   - rgba(255, 255, 255, 0.5) = 50% opaco (semi-opaco)
             * 
             * Modifica il quarto valore (0.4) per cambiare l'opacità
             */
            background: rgba(255, 255, 255, 0.4);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-lg);
            padding: var(--space-4);
            position: relative;
            z-index: 2;
            display: flex;
            flex-direction: column;
            gap: var(--space-6);
        }

        .desktop-layout {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: auto 1fr;
            grid-template-areas:
                "chat"
                "main";
            gap: var(--space-6);
            min-height: 0;
            min-width: 0; /* Consente restringimento in flex su mobile */
        }

        .desktop-chat-expanded .desktop-layout {
            grid-template-rows: minmax(0, 1fr);
        }

        .desktop-chat-expanded .desktop-main {
            display: none;
        }

        .desktop-chat-expanded .desktop-chat-panel {
            grid-row: 1 / -1;
        }

        .desktop-main {
            grid-area: main;
            min-height: 100%;
            width: 100%;
            min-width: 0; /* Consente restringimento in grid su mobile */
        }

        .desktop-chat-panel {
            grid-area: chat;
            display: flex;
            min-height: 0;
            width: 100%;
            min-width: 0; /* Consente restringimento in grid su mobile */
            align-items: flex-start;
        }

        .desktop-chat-shell {
            flex: 1;
            display: flex;
            min-height: 0;
            max-height: 600px;
            min-width: 0; /* Consente restringimento in flex su mobile */
        }

        .desktop-surface .d-one-chat-widget {
            position: relative;
            right: auto;
            bottom: auto;
            width: 100%;
            max-width: 100%; /* Evita overflow su mobile */
            height: 100%;
            max-height: 600px;
            transform: none;
            opacity: 1;
            min-width: 0;
            /* Rimuoviamo background opaco per mantenere effetto glass */
            background: rgba(255, 255, 255, 0.1); /* Glass effect al 10% */
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
        }

        .desktop-surface .d-one-chat-widget.visible {
            transform: none;
            opacity: 1;
        }

        .desktop-surface .d-one-chat-widget.expanded {
            width: 100%;
            height: 100%;
            bottom: auto;
            right: auto;
            border-radius: var(--radius-lg);
        }

        body.hero-locked .d-one-assistant-icon-container {
            display: block;
        }

        body.desktop-chat-open .d-one-assistant-icon-container {
            display: block;
        }

        body.desktop-chat-closed .d-one-assistant-icon-container {
            display: block;
        }

        body.desktop-chat-closed .desktop-layout {
            grid-template-rows: 1fr;
        }

        body.desktop-chat-closed .desktop-chat-panel {
            display: none;
        }

        .desktop-surface .d-one-assistant-icon-container {
            position: absolute;
            right: var(--space-6);
            bottom: var(--space-6);
            z-index: 6;
        }

        body[data-page="homepage"] .d-one-assistant-icon-container {
            bottom: 100px;
        }

        body[data-page="homepage"] .desktop-surface .d-one-assistant-icon-container {
            bottom: calc(var(--space-6) + 50px);
        }


        .desktop-controls {
            position: absolute;
            left: var(--space-6);
            bottom: var(--space-6);
            display: flex;
            align-items: center;
            gap: var(--space-3);
            z-index: 5;
        }

        .desktop-control-toggle {
            width: 30px;
            height: 30px;
            border-radius: var(--radius-full);
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-sm);
            transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
        }

        .desktop-control-toggle:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
            color: var(--text-primary);
        }

        .desktop-control-panel {
            display: none;
            align-items: center;
            flex-direction: column;
            align-items: flex-start;
            gap: var(--space-3);
            padding: var(--space-3) var(--space-4);
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
        }

        .desktop-control-panel.is-open {
            display: flex;
        }

        .desktop-control-panel label {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 500;
        }

        .desktop-control-panel input[type="color"] {
            width: 34px;
            height: 34px;
            border: none;
            background: transparent;
            padding: 0;
            cursor: pointer;
        }

        /* Background Image Upload Buttons */
        .desktop-control-panel .btn-upload-bg,
        .desktop-control-panel .btn-remove-bg {
            display: inline-flex;
            align-items: center;
            padding: 0.5rem 1rem;
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: var(--radius-md, 12px);
            color: var(--text-primary, #374151);
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: 0.5rem;
        }

        .desktop-control-panel .btn-upload-bg:hover,
        .desktop-control-panel .btn-remove-bg:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-1px);
        }

        .desktop-control-panel .btn-remove-bg {
            background: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.3);
            color: var(--danger, #ef4444);
            margin-left: 0.5rem;
        }

        .desktop-control-panel .btn-remove-bg:hover {
            background: rgba(239, 68, 68, 0.2);
        }

        .desktop-control-panel label[for="background-image-upload"] {
            flex-direction: column;
            align-items: flex-start;
            gap: 0.5rem;
        }

        .hero-background {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 1;
            overflow: hidden;
            pointer-events: none;
        }

        .hero-video {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            filter: none;
            backface-visibility: hidden;
            transform: translate3d(0, 0, 0);
            z-index: 0;
            will-change: transform, opacity;
        }

        .hero-video-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, rgba(17, 24, 39, 0.45) 0%, rgba(17, 24, 39, 0.2) 100%);
            z-index: 1;
            pointer-events: none;
        }



        @keyframes gridMove {
            0% {
                transform: translate(0, 0);
            }

            100% {
                transform: translate(50px, 50px);
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .hero-grid {
                animation: none;
            }

            .hero-video {
                filter: saturate(1) contrast(1);
            }
        }

        .hero-particles {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 2;
        }

        .particle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: rgba(207, 182, 182, 0.6);
            border-radius: 50%;
            animation: float 6s ease-in-out infinite;
        }


        .hero-buttons {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 4rem;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
        }

        .btn:hover::before {
            left: 100%;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
            color: white;
        }

        .btn-secondary {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
        }

        .btn-secondary:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 35px rgba(240, 147, 251, 0.4);
            color: white;
        }

        .btn-accent {
            background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
            color: white;
            box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
        }

        .btn-accent:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 35px rgba(79, 172, 254, 0.4);
            color: white;
        }

        .btn-outline {
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        .btn-outline:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
            color: white;
        }

        .btn-icon {
            font-size: 1rem;
        }

        .scroll-indicator {
            position: absolute;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            color: rgba(255, 255, 255, 0.8);
            text-decoration: none;
            transition: all 0.3s ease;
            z-index: 10;
        }

        .scroll-indicator:hover {
            color: white;
            transform: translateX(-50%) translateY(-4px);
        }

        .scroll-indicator-text {
            font-size: 0.85rem;
            font-weight: 500;
        }

        .scroll-indicator-icon {
            font-size: 1.2rem;
            animation: float 2s ease-in-out infinite;
        }

        @keyframes float {

            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-8px);
            }
        }

        @keyframes gradientShift {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

/* ============================================================================
   Agent Cards Desktop - Dynamic Agent Usage Display
   ============================================================================ */

.desktop-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 0rem;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    align-items: start;
}

.agent-card-desktop {
    /* Glass effect - trasparente per far vedere lo sfondo */
    background: rgba(255, 255, 255, 0.1); /* Glass effect al 10% */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-lg, 16px);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.agent-card-desktop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary, #667eea), var(--accent, #8b5cf6));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.agent-card-desktop:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.15));
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.15); /* Leggermente più opaco su hover */
}

.agent-card-desktop:hover::before {
    transform: scaleX(1);
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md, 12px);
    background: transparent;
}

.agent-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary, #667eea);
    color: white;
    border-radius: var(--radius-full, 9999px);
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-card-title {
    font-size: var(--font-size-md, 0.8rem);
    font-weight: var(--font-weight-semibold, 400);
    color: var(--text-primary, #1e293b);
    margin: 0;
    line-height: 1.3;
    text-transform: uppercase; /* Titoli in maiuscolo */
    letter-spacing: 0.5px; /* Leggero spacing per leggibilità */
}

.agent-usage-stats {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    /* Glass effect per le stats */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm, 8px);
    font-size: var(--font-size-sm, 0.875rem);

}

.usage-count {
    color: var(--primary, #667eea);
    font-weight: var(--font-weight-semibold, 600);
    white-space: nowrap;
}

.last-used {
    color: var(--text-secondary, #64748b);
    font-size: var(--font-size-xs, 0.75rem);
    display: none;
}

.btn-agent-launch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--primary, #667eea);
    border-radius: var(--radius-md, 12px);
    font-weight: var(--font-weight-semibold, 600);
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.btn-agent-launch:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    border-color: rgba(102, 126, 234, 0.5);
    color: var(--primary-hover, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.btn-agent-launch i {
    font-size: 0.9rem;
}

/* Responsive - Tablet e mobile */
@media (max-width: 768px) {
    .desktop-container {
        width: 100%;
        padding: var(--space-2, 0.5rem);
    }

    .desktop-surface {
        max-width: 100%;
        padding: 0; /* Zero su mobile per recuperare spazio */
    }

    .desktop-main {
        grid-template-columns: 1fr;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .agent-card-desktop {
        padding: 0.75rem 1rem;
        min-height: 220px;
        min-width: 0; /* Consente restringimento in grid */
    }

    .agent-card-header,
    .agent-card-title {
        min-width: 0; /* Testo può andare a capo / troncarsi */
    }

    .btn-agent-launch {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
    }

    .agent-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
}

/* Mobile stretto - viewport molto piccoli */
@media (max-width: 576px) {
    .desktop-container {
        padding: 0;
    }

    .desktop-surface {
        padding: 0; /* Zero su mobile per recuperare spazio */
    }

    .agent-card-desktop {
        padding: 0.5rem 0.75rem;
    }

    .btn-agent-launch {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Dark mode support */
html[data-theme='dark'] .agent-card-desktop {
    /* Glass effect per dark mode */
    background: rgba(31, 41, 55, 0.15); /* Glass effect al 15% */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme='dark'] .agent-card-desktop:hover {
    background: rgba(31, 41, 55, 0.2); /* Leggermente più opaco su hover */
    border-color: rgba(102, 126, 234, 0.4);
}

html[data-theme='dark'] .agent-usage-stats {
    /* Glass effect per dark mode */
    background: rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

html[data-theme='dark'] .agent-card-title {
    color: var(--gray-100, #f1f5f9);
}

html[data-theme='dark'] .usage-count {
    color: var(--primary, #667eea);
}

html[data-theme='dark'] .last-used {
    color: var(--gray-400, #94a3b8);
}

/* Dark mode support per desktop-surface glass */
html[data-theme='dark'] .desktop-surface {
    /* 
     * DARK MODE BACKGROUND: Opacità per dark mode
     * 
     * Valore attuale: rgba(31, 41, 55, 0.6) = 60% opaco (meno trasparente)
     * 
     * Per modificare:
     *   - rgba(31, 41, 55, 0.3) = 30% opaco (più trasparente)
     *   - rgba(31, 41, 55, 0.5) = 50% opaco
     *   - rgba(31, 41, 55, 0.6) = 60% opaco (meno trasparente) ← ATTUALE
     *   - rgba(31, 41, 55, 0.7) = 70% opaco (ancora meno trasparente)
     */
    background: rgba(31, 41, 55, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   STILI MIGRATI DA style-home.css
   Solo stili unici che non creano conflitti con lo stile attuale
   ============================================================================ */

/* Hero Section Small (per pagine interne) */
.hero-section-small {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-title-small {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    background: linear-gradient(45deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero-subtitle-small {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Content Section (per pagine interne) */
.content-section {
    padding: 50px 0 100px;
    background: #f8fafc;
    position: relative;
    min-height: 50vh;
}

.content-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Service Button con freccia animata (se non presente) */
.service-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.service-button:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.service-button::after {
    content: '→';
    transition: transform 0.3s ease;
}

.service-button:hover::after {
    transform: translateX(4px);
}

/* Animazione shine per service-icon (se non presente) */
@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Service Icon shine effect (aggiunto solo se non presente) */
.service-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.service-card:hover .service-icon::after {
    animation: shine 0.5s ease-in-out;
    opacity: 1;
}

/* Service Card top bar animation (aggiunto solo se non presente) */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* Form Cards (per pagine con form) */
.form-card {
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
}

.form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0,0,0,0.15);
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(120deg, #667eea, #764ba2, #667eea);
    background-size: 200% 200%;
    color: #fff;
    border-radius: 16px 16px 0 0;
    padding: 18px 28px 12px 24px;
    min-height: 56px;
    position: relative;
    z-index: 1;
    box-shadow: none;
}

.form-card-icon {
    font-size: 2.1rem;
    margin-right: 0;
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.13);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.07);
}

.form-card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.form-card-header p {
    font-size: 0.98rem;
    font-weight: 400;
    margin: 0 0 0 2px;
    color: #e0e7ff;
    line-height: 1.2;
}

.form-card-body {
    padding: 30px;
}

/* Modern Forms */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.label-icon {
    font-size: 1rem;
}

.form-control-modern {
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #1e293b;
}

.form-control-modern:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-control-modern::placeholder {
    color: #94a3b8;
}

.form-hint {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

/* Custom Checkbox */
.form-check-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.form-check-input-modern {
    display: none;
}

.form-check-label-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #1e293b;
    -webkit-user-select: none;
    user-select: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.form-check-input-modern:checked + .form-check-label-modern .checkmark {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.form-check-input-modern:checked + .form-check-label-modern .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Modern Buttons */
.btn-modern {
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-success-modern {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-success-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Loading States */
.loading-modern {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin-top: 20px;
    color: #64748b;
}

.spinner-modern {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.loading-content {
    background: white;
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0,0,0,0.3);
    max-width: 400px;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.loading-content p {
    color: #64748b;
    margin: 0;
}

/* Result Cards */
.result-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 25px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.result-card-large {
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    margin-top: 40px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.result-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e293b;
}

.result-header-large {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.2rem;
}

.result-icon {
    font-size: 1.2rem;
}

.result-content {
    padding: 25px;
}

.result-content-large {
    padding: 30px;
}

/* Alerts */
.alert-success-modern {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 1px solid #10b981;
    color: #065f46;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.alert-error-modern {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.alert-icon {
    font-size: 1.2rem;
}

/* Result Details */
.result-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.detail-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.image-result {
    margin: 25px 0;
    text-align: center;
}

.image-result h5 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.generated-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.summary-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 15px;
    margin-top: 25px;
}

.summary-section h5 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.error-details {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
}

.json-response {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: 30px;
    padding: 50px;
    margin-top: 50px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
    align-items: start;
}

.info-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
    color: #475569;
    line-height: 1.6;
}

.info-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.info-list strong {
    color: #1e293b;
}

.api-section {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.api-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 20px;
}

/* Service Header e Title (se non presenti) */
.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.service-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 1rem;
}

/* Status styles (se non presenti con questi stili) */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-unknown {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* Section Header e Subtitle (se non presenti) */
.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.3rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Services Section e Container (se non presenti) */
.services-section {
    padding: 100px 0;
    background: #f8fafc;
    position: relative;
}

.services-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Inline styles moved from index-light.html */
html.paint-gate body {
    opacity: 0;
    visibility: hidden;
}

.homepage-assistant-entry {
    width: 100%;
    align-self: flex-start;
    border-radius: 22px;
    border: 1px solid rgba(132, 145, 255, 0.28);
    overflow: hidden;
    background: rgba(234, 239, 247, 0.95);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

.homepage-assistant-entry .entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(120deg, rgba(194, 203, 255, 0.88), rgba(168, 139, 250, 0.88));
    color: #4f5de3;
    font-weight: 700;
    font-size: 1.02rem;
}

.homepage-assistant-entry .entry-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 14px;
}

.homepage-assistant-entry .entry-input {
    flex: 1;
    border: 0;
    border-radius: 999px;
    background: #f6f8fc;
    color: #1f2937;
    padding: 14px 18px;
    font-size: 1rem;
    outline: none;
}

.homepage-assistant-entry .entry-input:focus {
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.32);
}

.homepage-assistant-entry .entry-mic {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid #6366f1;
    background: #eef2ff;
    color: #6366f1;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.homepage-assistant-entry .entry-send {
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    min-width: 88px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #8d81ff, #7f95ff);
}

#desktop-chat-shell {
    min-height: auto !important;
    max-height: none !important;
    height: auto !important;
    align-items: flex-start !important;
}

body.desktop-chat-closed .desktop-chat-panel {
    display: flex !important;
}

/* ============================================================================
   Genspark-style Desktop Workspace — Layout pulito e compatto
   ============================================================================ */

/* Centra verticalmente il contenuto nella viewport
   gap misurato: footer=84px, gap=45px → 65+84+gap≈110px effettivi */
.desktop-section.is-visible {
    height: calc(100vh - 110px) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/*
 * Homepage: daitanone-ui avvolge il contenuto in <main style="flex:1">.
 * Con altezza fissa su #desktop, il main restava più alto del desktop e in basso
 * compariva la fascia (--bg-body) tra desktop e footer. Estendiamo il desktop con flex.
 */
body[data-page="homepage"] main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/*
 * Homepage desktop: il main (flex:1) ha già altezza = viewport − footer. Non usare min-height ~100dvh
 * sulla sezione (sopra il footer in flusso genera sempre overflow e scrollbar sulla pagina).
 * Scroll verticale solo su .desktop-container; la sezione resta overflow:hidden.
 */
body[data-page="homepage"] .desktop-section.is-visible {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    /* Sotto la toolbar fissa: clearance senza scroll su #desktop */
    padding-top: max(env(safe-area-inset-top, 0px), var(--homepage-toolbar-clearance, 60px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
}

/* Contenuto centrato in verticale nello spazio utile; scrollbar solo se il blocco eccede il main */
body[data-page="homepage"] #desktop.desktop-section.is-visible > .desktop-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    justify-content: safe center !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Toggle sfondo: fixed sopra il footer (footer ~84px + margine) */
.desktop-section.is-visible .desktop-controls {
    position: fixed !important;
    bottom: calc(84px + 1rem) !important;
    left: 1.25rem !important;
    z-index: 200 !important;
}

/* Sottotitolo spostato tra form e icone nel desktop-layout */
.desktop-layout .desktop-workspace-subtitle {
    text-align: center;
    margin: -1.5rem 0 0 0;
    font-size: 1.9rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.2px;
    text-shadow:
        -1px -1px 0 #94a3b8,
         1px -1px 0 #94a3b8,
        -1px  1px 0 #94a3b8,
         1px  1px 0 #94a3b8,
        0 0 12px rgba(148, 163, 184, 0.4);
}

.desktop-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Rimuove visivamente il desktop-surface (mantienuto nel DOM per JS)
   min-height: 0 sovrascrive il min-height: calc(90vh - 65px) originale */
.desktop-surface {
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    gap: 0 !important;
}

html[data-theme='dark'] .desktop-surface {
    background: transparent !important;
}

/* Titolo workspace centrato */
.desktop-workspace-header {
    text-align: center;
    padding: 0 1rem 0.5rem;
}

.desktop-workspace-title {
    font-size: 3.8rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1.5px;
    margin: 0 0 0.5rem;
    line-height: 1.1;
    /* Outline pulito via multi-shadow (no text-stroke → niente artefatti) */
    text-shadow:
        -1px -1px 0 #6d28d9,
         1px -1px 0 #6d28d9,
        -1px  1px 0 #6d28d9,
         1px  1px 0 #6d28d9;
}

.desktop-workspace-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary, #64748b);
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.1px;
}

html[data-theme='dark'] .desktop-workspace-subtitle {
    color: var(--gray-400, #94a3b8);
}

/* Desktop layout: flex colonna centrata invece di grid
   flex: none sovrascrive flex: 1 originale che gonfiava l'altezza */
.desktop-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2.75rem !important;
    grid-template-areas: none !important;
    flex: none !important;
    height: auto !important;
}

/* Chat panel: più largo e prominente */
.desktop-chat-panel {
    width: 100% !important;
    max-width: 920px !important;
    grid-area: unset !important;
}

.desktop-chat-shell {
    width: 100%;
}

/* Nasconde l'header viola — mantiene solo l'input bar (stile Genspark) */
.homepage-assistant-entry .entry-header {
    display: none !important;
}

/* Input bar: più alta e larga */
.homepage-assistant-entry {
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(200, 210, 255, 0.5) !important;
    box-shadow: 0 6px 32px rgba(15, 23, 42, 0.14) !important;
}

html[data-theme='dark'] .homepage-assistant-entry {
    background: rgba(30, 41, 59, 0.88) !important;
    border-color: rgba(99, 102, 241, 0.28) !important;
}

.homepage-assistant-entry .entry-body {
    padding: 20px 24px !important;
    gap: 16px !important;
}

.homepage-assistant-entry .entry-input {
    font-size: 1.15rem !important;
    padding: 16px 22px !important;
    background: transparent !important;
    color: var(--text-primary, #1f2937) !important;
    resize: none !important;
    line-height: 1.55 !important;
    min-height: 80px !important;
    align-self: stretch !important;
}

html[data-theme='dark'] .homepage-assistant-entry .entry-input {
    color: var(--gray-100, #f1f5f9) !important;
}

/* Agent shortcuts: griglia 2 righe × 5 colonne (9 agenti = 5+4) */
.desktop-main {
    display: grid !important;
    grid-template-columns: repeat(5, 100px) !important;
    grid-template-rows: auto auto !important;
    justify-content: center !important;
    align-items: start !important;
    gap: 2rem 2.5rem !important;
    padding: 0 1rem 2.5rem !important;
    grid-area: unset !important;
    min-height: unset !important;
    width: 100% !important;
}

/* Compact icon shortcut card */
.agent-icon-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none !important;
    color: var(--text-secondary, #6b7280);
    width: 100px;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.agent-icon-shortcut:hover {
    transform: translateY(-5px);
    color: var(--primary, #6366f1);
    text-decoration: none !important;
}

/* Rounded-square icon — stile Genspark con colori per agente */
.agent-icon-square {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: var(--icon-bg, #eef2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: var(--icon-color, #6366f1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.agent-icon-shortcut:hover .agent-icon-square {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    transform: scale(1.1);
    filter: brightness(0.96);
}

/* Fallback: mantiene .agent-icon-circle per eventuali agent tracciati senza faIcon */
.agent-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.70rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.09);
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.agent-icon-shortcut:hover .agent-icon-circle {
    box-shadow: 0 8px 26px rgba(99, 102, 241, 0.24);
    transform: scale(1.1);
}

.agent-icon-label {
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    color: var(--text-primary, #374151);
    max-width: 100px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dark mode icon circles */
html[data-theme='dark'] .agent-icon-circle {
    background: rgba(30, 41, 59, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme='dark'] .agent-icon-shortcut:hover .agent-icon-circle {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.5);
}

html[data-theme='dark'] .agent-icon-label {
    color: var(--gray-300, #cbd5e1);
}

html[data-theme='dark'] .agent-icon-square {
    filter: brightness(0.82) saturate(1.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

html[data-theme='dark'] .agent-icon-shortcut:hover .agent-icon-square {
    filter: brightness(0.92) saturate(1.15);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme='dark'] .desktop-workspace-title {
    text-shadow:
        -1px -1px 0 #7c3aed,
         1px -1px 0 #7c3aed,
        -1px  1px 0 #7c3aed,
         1px  1px 0 #7c3aed;
}

/* Responsive: tablet (≤ 768px) → 3 colonne */
@media (max-width: 768px) {
    .desktop-workspace-title {
        font-size: 2rem;
    }

    .desktop-workspace-header {
        padding: 0 1rem 0.5rem;
    }

    .desktop-main {
        grid-template-columns: repeat(3, 90px) !important;
        gap: 1.5rem 2rem !important;
    }

    .agent-icon-shortcut {
        width: 90px;
    }
}

/* Responsive: mobile (≤ 480px) → 3 colonne strette */
@media (max-width: 480px) {
    .desktop-workspace-title {
        font-size: 1.6rem;
        letter-spacing: -0.5px;
    }

    .desktop-workspace-header {
        padding: 0 1rem 0.25rem;
    }

    .desktop-main {
        grid-template-columns: repeat(3, 76px) !important;
        gap: 1.25rem 1.5rem !important;
    }

    .agent-icon-circle {
        width: 54px;
        height: 54px;
        font-size: 1.55rem;
    }

    .agent-icon-shortcut {
        width: 76px;
    }

    .agent-icon-label {
        font-size: 0.76rem;
        max-width: 76px;
    }
}

/* ============================================================================
   Viewport BASSA in altezza (laptop 13–14", finestre non massimizzate, barre browser)
   Riduce padding tipografico così titolo + CTA restano più vicini senza scroll eccessivo.
   ============================================================================ */
@media (max-height: 880px) {
    body[data-page="homepage"] .hero-content {
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 1rem;
    }

    body[data-page="homepage"] .hero-title {
        font-size: clamp(1.35rem, 4vw, 2.85rem);
        margin-bottom: 0.5rem;
        gap: 0.2rem;
    }

    body[data-page="homepage"] .hero-subtitle {
        font-size: clamp(0.88rem, 2.1vw, 1.35rem);
        margin-bottom: 1rem;
        line-height: 1.32;
    }

    body[data-page="homepage"] .btn-hero-prova {
        margin-top: 1rem;
        padding: 11px 26px;
        font-size: 1.05rem;
    }
}

/* ============================================================================
   MOBILE RESPONSIVE OPTIMIZATION
   Breakpoints: 768px (tablet), 480px (mobile stretto)
   ============================================================================ */

/* --- Hero Section mobile --- */
@media (max-width: 768px) {
    .hero-section {
        padding: 0 var(--space-3, 12px);
    }

    .hero-content {
        max-width: 100%;
        padding: 0 8px;
    }

    .hero-title {
        font-size: clamp(1.6rem, 7vw, 3rem);
        gap: 0.2rem;
    }

    .hero-subtitle {
        font-size: clamp(0.95rem, 2.5vw, 1.3rem);
        margin-bottom: 1.5rem;
    }

    .btn-hero-prova {
        font-size: 1rem;
        padding: 12px 24px;
        margin-top: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.3rem, 6vw, 2rem);
    }

    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .btn-hero-prova {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}

/* --- Auth Status Section mobile --- */
@media (max-width: 768px) {
    .auth-status-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .auth-status-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .auth-status-actions .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .auth-status-text h4 {
        font-size: 1rem;
    }

    .auth-status-text p {
        font-size: 0.85rem;
    }
}

/* --- Desktop Section & Workspace mobile --- */
@media (max-width: 768px) {
    .desktop-section.is-visible {
        height: auto !important;
        min-height: calc(100vh - 110px);
        min-height: calc(100dvh - 110px);
    }

    /* Homepage: stesso layout flex del desktop — niente min-height ~100dvh sopra il footer */
    body[data-page="homepage"] .desktop-section.is-visible {
        min-height: 0 !important;
    }

    .desktop-container {
        padding: var(--space-2, 0.5rem) !important;
    }

    .desktop-layout .desktop-workspace-subtitle {
        font-size: 1.2rem;
        margin-top: -0.5rem;
    }
}

@media (max-width: 480px) {
    .desktop-layout .desktop-workspace-subtitle {
        font-size: 1rem;
    }
}

/* --- Homepage Assistant Entry mobile --- */
@media (max-width: 768px) {
    .homepage-assistant-entry .entry-body {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 10px 12px;
    }

    .homepage-assistant-entry .entry-input {
        width: 100%;
        flex: 1 1 100%;
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .homepage-assistant-entry .entry-mic {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .homepage-assistant-entry .entry-send {
        flex: 1;
        min-width: 70px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .desktop-chat-panel {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .homepage-assistant-entry .entry-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .homepage-assistant-entry .entry-send {
        min-width: 60px;
        padding: 9px 12px;
        font-size: 0.85rem;
    }
}

/* --- Desktop Controls mobile: nascondi personalizzazione sfondo --- */
@media (max-width: 768px) {
    .desktop-controls {
        bottom: 0.5rem !important;
        left: 0.5rem !important;
    }

    .desktop-control-panel {
        max-width: calc(100vw - 2rem);
    }
}

/* --- Floating Elements: riduce su mobile per performance --- */
@media (max-width: 768px) {
    .floating-elements .floating-element:nth-child(n+4) {
        display: none;
    }
}
