:root {
    --primary-green: #2E7D32;
    --neon-green: #00E676;
    --primary-blue: #2962FF;
    --neon-purple: #D500F9;
    --dark-bg: #0B0F19;
    --white: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: #F8FAFC;
    color: #1E293B;
    overflow-x: hidden;
    position: relative;
}

/* SFONDI FLUTTUANTI */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    animation: float-blob 15s infinite alternate ease-in-out;
}
.blob-1 { width: 400px; height: 400px; background: var(--neon-green); top: -100px; left: -100px; }
.blob-2 { width: 500px; height: 500px; background: var(--primary-blue); top: 20%; right: -200px; animation-delay: -5s; }
.blob-3 { width: 350px; height: 350px; background: var(--neon-purple); bottom: 10%; left: 20%; animation-delay: -10s; }

@keyframes float-blob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* GLASSMORPHISM UTILITIES */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-glass);
}
.dark-glass {
    background: rgba(15, 23, 42, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* TESTO GRADIENTE */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* NAVBAR */
.glass-nav {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 15px 5%;
    transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}
/* Stato "scrollata": piu solida, compatta e con ombra */
.glass-nav.scrolled {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 10px 5%;
}
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.logo img { width: 40px; border-radius: 10px; }
.nav-links { list-style: none; display: flex; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: #475569; font-weight: 600; transition: 0.3s; }
.nav-links a:hover { color: var(--primary-blue); }

/* BOTTONI PREMIUM */
.btn-primary-small, .btn-primary {
    background: #1E293B;
    color: var(--white) !important;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}
.glow-effect:hover {
    box-shadow: 0 0 20px rgba(30, 41, 59, 0.4);
    transform: translateY(-2px);
}

/* HERO SECTION */
.hero-section {
    padding: 180px 5% 100px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
}
.hero-content { flex: 1.2; }
.badge-update { display: inline-block; padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 700; margin-bottom: 24px; color: var(--primary-green); }
.hero-content h1 { font-size: 64px; line-height: 1.1; letter-spacing: -2px; margin-bottom: 24px; min-height: 2.2em; }
.hero-content p { font-size: 20px; color: #475569; margin-bottom: 40px; max-width: 500px; line-height: 1.6; }

/* Riga di posizionamento "progetto indipendente" nell'hero */
.hero-independent {
    font-size: 14px !important;
    color: #64748B !important;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 500px;
    margin-bottom: 32px !important;
    margin-top: -20px;
}
.hero-independent ion-icon { font-size: 18px; color: var(--primary-green); flex-shrink: 0; }

/* TYPEWRITER CURSOR */
.typewriter::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--primary-green);
}
@keyframes blink { 50% { opacity: 0; } }

.store-buttons { display: flex; gap: 15px; }
.glass-btn {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #0F172A; padding: 12px 24px; border-radius: 16px;
    text-decoration: none; border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.hover-scale { transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.hover-scale:hover { transform: scale(1.05); }
.glass-btn ion-icon { font-size: 32px; }
.btn-text span { font-size: 11px; display: block; }
.btn-text strong { font-size: 16px; }

/* TELEFONO ANIMATO 3D TILT */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.smartphone-mockup {
    width: 320px;
    height: 650px;
    background: #0F172A;
    border-radius: 48px;
    padding: 12px;
    border: 4px solid #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    will-change: transform; /* prepara il layer in anticipo: tilt piu fluido */
}

.smartphone-mockup::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: shine 6s infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 36px;
    overflow: hidden;
    position: relative;
}

.real-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 36px;
}

/* NOTIFICA GLASS ANIMATA DENTRO IL TELEFONO */
.phone-notification {
    position: absolute;
    top: 90px; /* sotto la barra di stato / notch dello screenshot: tara sul tuo screenshot */
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    /* Vetro scuro per staccare bene sopra qualsiasi screenshot */
    background: rgba(20, 25, 40, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: #fff;
    z-index: 5;
    /* Stato iniziale: nascosta sopra */
    opacity: 0;
    transform: translateY(-20px);
    /* Loop: appare, resta, sparisce */
    animation: notif-cycle 6s ease-in-out 2s infinite;
}

.notif-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
}

.notif-text { display: flex; flex-direction: column; line-height: 1.3; }
.notif-text strong { font-size: 14px; font-weight: 700; }
.notif-text span { font-size: 12px; opacity: 0.85; }
.notif-text b { font-weight: 700; opacity: 1; }

@keyframes notif-cycle {
    0%   { opacity: 0; transform: translateY(-20px); }  /* entra */
    10%  { opacity: 1; transform: translateY(0); }
    75%  { opacity: 1; transform: translateY(0); }       /* resta visibile */
    90%  { opacity: 0; transform: translateY(-20px); }   /* esce */
    100% { opacity: 0; transform: translateY(-20px); }
}

/* SEZIONE NUMERI */
.stats-section {
    max-width: 1000px; margin: -40px auto 80px;
    display: flex; justify-content: space-around; padding: 40px;
    position: relative; z-index: 10;
}
.stat-box { text-align: center; }
.stat-box h2, .stat-box span { font-size: 56px; font-weight: 800; color: var(--primary-blue); display: inline-block; letter-spacing: -2px; }
.stat-box p { font-size: 18px; color: #64748B; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* SEZIONE BENTO GRID (Con Glow Effect) */
.vision-section { max-width: 1200px; margin: 100px auto; padding: 0 5%; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 48px; margin-bottom: 15px; letter-spacing: -1px; }
.section-title p { font-size: 20px; color: #64748B; }

.bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(300px, auto); gap: 30px; }

.bento-item {
    position: relative;
    overflow: hidden;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.bento-large { grid-column: span 2; }

/* Glow effect base e hover */
.bento-item::before {
    content: "";
    position: absolute;
    top: var(--mouse-y, 0);
    left: var(--mouse-x, 0);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(41, 98, 255, 0.15) 0%, rgba(255,255,255,0) 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.bento-item:hover::before { opacity: 1; }

.bento-content { position: relative; z-index: 2; pointer-events: none; }
.bento-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: white; margin-bottom: 24px; }
.green-icon { background: linear-gradient(135deg, #2E7D32, #4CAF50); }
.blue-icon { background: linear-gradient(135deg, #2962FF, #40C4FF); }
.purple-icon { background: linear-gradient(135deg, #6200EA, #B388FF); }
.bento-item h3 { font-size: 28px; margin-bottom: 16px; color: #0F172A; letter-spacing: -0.5px; }
.bento-item p { font-size: 16px; color: #475569; line-height: 1.8; }
.bento-list { list-style: none; margin-top: 10px; }
.bento-list li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; font-size: 16px; color: #475569; line-height: 1.6; }
.bento-list ion-icon { font-size: 24px; color: var(--primary-blue); flex-shrink: 0; margin-top: 2px; }

/* FUNZIONALITÀ GRID */
.features-section { max-width: 1200px; margin: 100px auto; padding: 0 5%; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.feature-item { padding: 40px 30px; transition: 0.3s; }
.hover-glow:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(41, 98, 255, 0.15); }
.icon-wrapper { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 20px; color: white; }
.gradient-green { background: linear-gradient(135deg, #2E7D32, #4CAF50); }
.gradient-purple { background: linear-gradient(135deg, #6200EA, #B388FF); }
.gradient-blue { background: linear-gradient(135deg, #2962FF, #40C4FF); }
.feature-item h3 { font-size: 20px; margin-bottom: 12px; }
.feature-item p { color: #475569; font-size: 15px; }

/* SEZIONE VIDEO (Carosello Dinamico) */
.video-section { max-width: 1200px; margin: 100px auto; padding: 0 5%; }
.carousel-wrapper { position: relative; max-width: 1200px; margin: 0 auto; }

.video-carousel {
    display: flex; gap: 30px; overflow-x: auto; padding-bottom: 40px; padding-top: 20px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.video-carousel::-webkit-scrollbar { display: none; }

.video-card {
    min-width: 320px; max-width: 320px; flex-shrink: 0; scroll-snap-align: start;
    overflow: hidden; padding: 0; cursor: pointer; text-decoration: none;
    color: inherit; display: flex; flex-direction: column;
}
.video-thumbnail { position: relative; height: 500px; width: 100%; overflow: hidden; }
.video-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.hover-glow:hover .video-thumbnail img { transform: scale(1.05); }
.video-thumbnail ion-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 60px; color: rgba(255,255,255,0.9); z-index: 2; transition: 0.3s; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.hover-glow:hover .video-thumbnail ion-icon { transform: translate(-50%, -50%) scale(1.1); color: #FFF; }
.video-info { padding: 20px; background: rgba(255,255,255,0.8); flex-grow: 1; border-top: 1px solid rgba(0,0,0,0.05); }
.video-info h3 { font-size: 18px; margin-bottom: 0; line-height: 1.4; color: #0F172A; }

/* Frecce Carosello */
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.9);
    border: none; width: 50px; height: 50px; border-radius: 50%; font-size: 24px; color: #0F172A;
    cursor: pointer; z-index: 10; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.carousel-btn:hover { background: var(--primary-blue); color: white; transform: translateY(-50%) scale(1.1); }
.prev-btn { left: -25px; }
.next-btn { right: -25px; }

/* MODALE POPUP VIDEO */
.video-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000; align-items: center; justify-content: center; }
.video-modal.active { display: flex; }
.modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(8px); }
.modal-content { position: relative; width: 90%; max-width: 400px; z-index: 2001; background: #000; border-radius: 24px; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.1); }
.close-modal { position: absolute; top: 15px; right: 15px; background: rgba(0, 0, 0, 0.6); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.close-modal:hover { background: #EF4444; }
.iframe-container { position: relative; width: 100%; padding-top: 177.77%; }
.iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* SEZIONE AZIENDE B2B */
.b2b-section { padding: 100px 5%; margin-top: 50px; }
.b2b-container { max-width: 1200px; margin: 0 auto; display: flex; padding: 60px; gap: 60px; align-items: center; }
.badge-premium { background: rgba(255,215,0,0.2); color: #FFD700; padding: 8px 16px; border-radius: 20px; display: inline-block; font-weight: 700; font-size: 14px; margin-bottom: 20px; }
.b2b-text h2 { font-size: 42px; margin-bottom: 20px; line-height: 1.2; letter-spacing: -1px; }
.b2b-text p { font-size: 18px; color: #CBD5E1; margin-bottom: 30px; }
.b2b-visual { flex: 0.8; display: flex; justify-content: center; }
.qr-mockup { width: 250px; height: 350px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; padding: 30px; backdrop-filter: blur(10px); }
.qr-mockup ion-icon { font-size: 120px; margin-bottom: 20px; color: var(--neon-green); }
/* QR reale: riquadro bianco per garantire il contrasto e la leggibilita in scansione */
.qr-image {
    width: 170px;
    height: 170px;
    margin-bottom: 20px;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: block;
}

/* FOOTER */
.glass-footer { padding: 80px 5% 40px; margin-top: 100px; border-top: 1px solid rgba(0,0,0,0.05); background: rgba(255,255,255,0.5); backdrop-filter: blur(20px); }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-contact h4 { font-size: 20px; margin-bottom: 20px; }
.footer-contact p { display: flex; align-items: center; gap: 10px; color: #475569; }
.social-icons { margin-top: 20px; display: flex; gap: 15px; font-size: 24px; }
/* IL TEAM: le persone dietro il progetto */
.team-header { text-align: center; margin: 80px 0 40px; }
.team-header h3 { font-size: 32px; margin-bottom: 12px; color: #0F172A; letter-spacing: -0.5px; }
.team-header p { font-size: 18px; color: #64748B; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}
.team-card {
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: 0.3s;
}
.team-photo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 20px;
    padding: 4px;
    overflow: hidden;
}
.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}
/* Cornice colorata coerente coi ruoli */
.team-photo-blue { background: linear-gradient(135deg, #2962FF, #40C4FF); }
.team-photo-orange { background: linear-gradient(135deg, #F59E0B, #FBBF24); }

.team-info h4 { font-size: 20px; color: #0F172A; margin-bottom: 8px; letter-spacing: -0.3px; }
.team-role {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}
.role-blue { background: rgba(41, 98, 255, 0.12); color: var(--primary-blue); }
.role-orange { background: rgba(245, 158, 11, 0.15); color: #D97706; }
.team-info p { font-size: 14px; color: #475569; line-height: 1.6; }

/* RIQUADRO TRASPARENZA (disclaimer + privacy in evidenza) */
.transparency-section { max-width: 1200px; margin: 100px auto 0; padding: 0 5%; }
.transparency-box {
    display: flex;
    gap: 24px;
    padding: 40px;
    align-items: flex-start;
}
.transparency-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
}
.transparency-content h3 { font-size: 22px; color: #0F172A; margin-bottom: 12px; letter-spacing: -0.3px; }
.transparency-content p { font-size: 14px; line-height: 1.7; color: #64748B; margin-bottom: 20px; }
.transparency-content strong { color: #334155; }
.transparency-links { display: flex; gap: 16px; flex-wrap: wrap; }
.transparency-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(41, 98, 255, 0.08);
    transition: 0.3s;
}
.transparency-links a:hover { background: rgba(41, 98, 255, 0.15); transform: translateY(-2px); }
.transparency-links ion-icon { font-size: 18px; }

.footer-legal-links { margin-top: 12px; font-size: 14px; }
.footer-legal-links a { color: var(--primary-blue); text-decoration: none; font-weight: 600; }
.footer-legal-links a:hover { text-decoration: underline; }
.footer-contact a { color: inherit; text-decoration: none; }
.footer-contact a:hover { color: var(--primary-blue); }

.footer-bottom { text-align: center; color: #64748B; padding-top: 30px; border-top: 1px solid rgba(0,0,0,0.1); }

/* ANIMAZIONI SCORRIMENTO E FLOATING LENTO */
.floating-slow { animation: float-up-down 6s ease-in-out infinite; }
@keyframes float-up-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

.fade-in-up { opacity: 0; transform: translateY(40px); transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); }
.fade-in-up.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* MEDIA QUERIES PER SMARTPHONE E TABLET */
@media (max-width: 992px) {
    .hero-section { flex-direction: column; text-align: center; padding-top: 130px; }
    .hero-content h1 { font-size: 48px; min-height: auto; } /* niente buco fisso in mobile */
    .hero-content p { margin: 0 auto 40px; }
    .store-buttons { justify-content: center; }
    .b2b-container { flex-direction: column; padding: 40px 20px; }
    .nav-links { display: none; }
    .stats-section { flex-direction: column; gap: 40px; }
    .carousel-btn { display: none; }
}
@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; }
    .bento-large { grid-column: span 1; }
    .team-grid { grid-template-columns: 1fr; }
    .team-card { flex-direction: column; text-align: center; }
    .transparency-box { flex-direction: column; align-items: center; text-align: center; }
    .transparency-links { justify-content: center; }
}

/* ACCESSIBILITÀ: rispetta chi ha ridotto le animazioni nel sistema operativo */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .blob { animation: none; }
    .smartphone-mockup::after { animation: none; } /* disattiva l'effetto shine */
    .fade-in-up { opacity: 1; transform: none; } /* contenuto subito visibile */
}
