/* --- 1. VARIABILI & RESET --- */
:root {
    --primary: #6366F1; /* Indigo */
    --primary-dark: #4F46E5;
    --secondary: #14B8A6; /* Teal */
    --dark: #0F172A;
    --light: #F8FAFC;
    --glass: rgba(255, 255, 255, 0.85);
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

h1, h2, h3, .logo { font-family: 'Poppins', sans-serif; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- 2. UTILITY --- */
.container {
    max-width: 1200px;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

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

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

.gradient-text, .gradient-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: inline-block;
}

/* Bottoni */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Section Header */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px auto !important;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 15px;
    letter-spacing: -1px;
    line-height: 1.2;
}

.section-header p {
    color: #64748B;
    font-size: 1.1rem;
}

/* --- 3. NAVBAR --- */
.navbar {
    position: fixed; top: 0; width: 100%; padding: 15px 0;
    background: rgba(255, 255, 255, 0.95); /* Più solido per il menu mobile */
    backdrop-filter: blur(12px);
    z-index: 1000; border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-content {
    display: flex; justify-content: space-between; align-items: center;
    position: relative; /* Importante per il posizionamento mobile */
    width: 100%;
}

.logo {
    font-size: 1.4rem; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 10px; z-index: 1001;
}

/* Menu Container (Desktop) */
.nav-menu {
    display: flex; align-items: center; gap: 30px;
}

.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links li { list-style: none; }
.nav-links a { font-weight: 500; color: var(--dark); opacity: 0.8; }
.nav-links a:hover { color: var(--primary); opacity: 1; }

/* Hamburger Icon (Nascosto su Desktop) */
.hamburger {
    display: none; font-size: 1.5rem; color: var(--dark); cursor: pointer; z-index: 1001;
}

/* --- 4. HERO SECTION --- */
.hero {
    padding: 160px 0 100px; /* Padding top alto per navbar */
    position: relative;
    overflow: hidden; /* Previene overflow del blob */
}

.blob-bg {
    position: absolute;
    top: -10%; 
    right: -5%; 
    width: min(600px, 50vw); 
    height: min(600px, 50vw);
    background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, rgba(20,184,166,0.1) 100%);
    border-radius: 50%; 
    filter: blur(80px); 
    z-index: -1;
    animation: pulse 8s infinite alternate;
}
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.1); } }

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    font-size: 1.1rem;
    color: #64748B;
    margin-bottom: 30px;
    max-width: 90%;
}

.hero-image { position: relative; }

.mockup-card {
    background: white; border-radius: 20px; padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1); border: 1px solid rgba(0,0,0,0.05); position: relative; z-index: 1;
}
.mockup-header { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #ddd; }
.dot.red { background: #ff5f56; } .dot.yellow { background: #ffbd2e; } .dot.green { background: #27c93f; }
.mockup-body .line { height: 10px; background: #F1F5F9; margin-bottom: 10px; border-radius: 5px; }
.line.w-80 { width: 80%; } .line.w-60 { width: 60%; } .line.w-40 { width: 40%; }

.floating-badge {
    position: absolute; bottom: -20px; left: -20px; background: white;
    padding: 15px 25px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex; align-items: center; gap: 10px; font-weight: 600; z-index: 2;
}

/* --- 5. STATS SECTION --- */
.stats-section {
    padding: 60px 0;
    background: linear-gradient(to bottom, #F8FAFC, #FFFFFF);
    position: relative; z-index: 10; margin-top: -50px;
}
/* Su mobile il margine negativo si toglie nelle media queries */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 40px; border-radius: 24px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.05);
}

.stat-item {
    display: flex; flex-direction: column; align-items: center; text-align: center; position: relative;
}
.stat-item:not(:last-child)::after {
    content: ''; position: absolute; right: -15px; top: 20%; height: 60%; width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1), transparent);
}
.icon-circle {
    width: 50px; height: 50px; background: rgba(99, 102, 241, 0.1);
    color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 15px;
}
.stat-number-wrapper {
    font-size: 2.5rem; font-weight: 800; font-family: 'Poppins', sans-serif; line-height: 1; margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.plus, .symbol { font-size: 2rem; background: none; -webkit-text-fill-color: var(--primary); }
.stat-item p { color: #64748B; font-weight: 500; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; }

/* --- 6. ABOUT SECTION --- */
.about-section {
    padding: 120px 0; position: relative; overflow: hidden;
    background-color: #F8FAFC;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 30px 30px;
}
.section-blob {
    position: absolute; 
    left: -50px; 
    top: 20%; 
    width: min(500px, 40vw); 
    height: min(500px, 40vw);
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, rgba(20,184,166,0.05) 70%);
    border-radius: 50%; 
    filter: blur(80px); 
    z-index: 0;
}
.glass-card {
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border-radius: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.1); border-color: rgba(99, 102, 241, 0.3); }

/* Vision Card */
.vision-card { padding: 0; overflow: hidden; margin-bottom: 50px; }
.vision-grid { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; min-height: 400px; }
.vision-image-wrapper { position: relative; height: 100%; width: 100%; min-height: 300px; }
.vision-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(20, 184, 166, 0.2)); mix-blend-mode: overlay;
}
.vision-content { padding: 40px 50px; }
.vision-content h3 { font-size: 2rem; margin-bottom: 25px; display: flex; align-items: center; gap: 15px; color: var(--dark); }
.icon-box-small {
    width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white;
    font-size: 1.2rem; box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}
.vision-stat {
    margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.05);
    display: flex; align-items: center; gap: 15px;
}
.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 0.85rem; font-weight: 600; color: #64748B; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.5px; }

/* Objectives */
.objectives-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; margin-bottom: 80px; }
.obj-card { padding: 30px; text-align: center; }
.obj-card h4 { font-size: 1.2rem; margin-bottom: 10px; color: var(--dark); }
.obj-card p { font-size: 0.95rem; color: #64748B; line-height: 1.6; }

/* Personalization */
.personalization-wrapper {
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%); border-radius: 30px; padding: 60px; color: white;
    display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center;
    position: relative; overflow: hidden; box-shadow: 0 20px 50px -10px rgba(49, 46, 129, 0.5);
}
.personalization-wrapper::before {
    content: ''; position: absolute; top: -50%; right: -20%; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 70%); pointer-events: none;
}
.personalization-content h3 { font-size: 2rem; margin-bottom: 15px; }
.pers-subtitle { color: #A5B4FC; margin-bottom: 30px; font-size: 1.1rem; }
.params-list { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.param-row {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); padding: 15px; border-radius: 12px;
    display: flex; align-items: flex-start; gap: 15px; transition: 0.3s;
}
.param-row:hover { background: rgba(255, 255, 255, 0.1); transform: translateX(5px); }
.check-icon {
    background: rgba(20, 184, 166, 0.2); color: #14B8A6; width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 0.7rem; margin-top: 2px;
}
.param-text strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.param-text span { font-size: 0.8rem; color: #CBD5E1; }
.personalization-visual {
    position: relative; height: 100%; min-height: 200px;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px;
}
.floating-ui-element {
    background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2); padding: 20px; border-radius: 16px; width: 80%;
    animation: float 6s infinite ease-in-out;
}
.floating-ui-element.delay {
    animation-delay: 3s; background: rgba(99, 102, 241, 0.2); border-color: rgba(99, 102, 241, 0.4); align-self: flex-end;
}
.floating-ui-element span { display: block; font-size: 0.8rem; color: #A5B4FC; margin-bottom: 10px; font-weight: 600; }
.bar { height: 6px; background: rgba(255, 255, 255, 0.2); border-radius: 3px; margin-bottom: 6px; }
.bar.w-75 { width: 75%; } .bar.w-50 { width: 50%; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* --- 7. TESTIMONIALS SECTION --- */
.testimonials-section {
    padding: 100px 0; position: relative; overflow: hidden;
    background: linear-gradient(to bottom, #F8FAFC, #EFF6FF);
}
.blob-bg-right {
    position: absolute; 
    top: 10%; 
    right: -50px; 
    width: min(400px, 35vw); 
    height: min(400px, 35vw);
    background: radial-gradient(circle, rgba(20, 184, 166, 0.1) 0%, transparent 70%);
    border-radius: 50%; 
    filter: blur(60px); 
    z-index: 0;
}
.carousel-wrapper { position: relative; max-width: 1100px; margin: 0 auto; padding: 0 40px; }
.reviews-track {
    display: flex; gap: 20px; overflow-x: auto; scroll-behavior: smooth;
    padding: 20px 5px 40px 5px; scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x mandatory;
}
.reviews-track::-webkit-scrollbar { display: none; }
.review-card {
    min-width: 260px; max-width: 260px; min-height: 260px; flex: 0 0 auto; padding: 25px;
    display: flex; flex-direction: column; justify-content: space-between;
    scroll-snap-align: center; background: rgba(255, 255, 255, 0.9); transition: transform 0.3s ease;
}
.review-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(99, 102, 241, 0.15); }
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.avatar { width: 45px; height: 45px; border-radius: 50%; border: 2px solid white; box-shadow: 0 3px 8px rgba(0,0,0,0.1); flex-shrink: 0; }
.user-info h4 { font-size: 0.95rem; color: var(--dark); margin-bottom: 3px; font-weight: 600; }
.user-info span { font-size: 0.75rem; color: #64748B; display: block; }
.stars { color: #F59E0B; font-size: 0.75rem; margin-bottom: 12px; display: flex; gap: 2px; }
.review-text {
    font-style: italic; color: #475569; line-height: 1.5; font-size: 0.875rem;
    flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: none;
    background: white; color: var(--primary); box-shadow: 0 4px 15px rgba(0,0,0,0.1); cursor: pointer; z-index: 10;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.nav-btn:hover { background: var(--primary); color: white; transform: translateY(-50%) scale(1.1); }
.prev-btn { left: 0; } .next-btn { right: 0; }

/* --- 8. LOGIN MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.login-box {
    background: white; padding: 40px; border-radius: 24px;
    width: 90%; max-width: 400px; text-align: center;
    position: relative; transform: scale(0.9); transition: 0.3s;
}
.modal-overlay.active .login-box { transform: scale(1); }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 1.5rem; cursor: pointer; color: #94A3B8; }
.login-box h3 { font-size: 1.8rem; margin-bottom: 10px; }
.login-box input { width: 100%; padding: 15px; margin: 20px 0; border: 2px solid #E2E8F0; border-radius: 12px; font-size: 1rem; outline: none; }
.login-box input:focus { border-color: var(--primary); }

/* --- 9. FOOTER --- */
footer { background: var(--dark); color: white; padding: 50px 0 20px; margin-top: 50px; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 30px; gap: 20px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.9rem; color: #94A3B8; }

/* --- 10. MEDIA QUERIES (RESPONSIVE OTTIMIZZATO) --- */

/* Tablet e Laptop Piccoli (fino a 1024px) */
@media (max-width: 1024px) {
    .container { padding: 0 30px; }
    .hero-text h1 { font-size: 3rem; }
    .vision-grid { grid-template-columns: 1fr; grid-template-rows: 350px auto; gap: 0; }
    .vision-image-wrapper { min-height: 350px; }
    .personalization-wrapper { padding: 40px; }
}

/* Tablet e Mobile Grandi (fino a 768px) */
@media (max-width: 768px) {
    /* Mostra l'hamburger */
    .hamburger { display: block; }

    /* Nascondi il menu di default e stilizzalo come tendina */
    .nav-menu {
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100vh;
        background: white;
        flex-direction: column; justify-content: center; align-items: center;
        gap: 40px;
        transform: translateX(-100%);
        transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
        opacity: 0;
        z-index: 999;
        padding: 20px;
        box-sizing: border-box;
    }

    /* Classe attiva per mostrare il menu */
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
    }

    .nav-links {
        flex-direction: column; text-align: center; gap: 30px; font-size: 1.2rem;
        list-style: none;
    }
    
    .nav-links li {
        list-style: none;
    }
    
    .nav-links a {
        color: var(--dark);
        font-weight: 600;
    }
    
    /* Hero: Una colonna, testo centrato */
    .hero { padding-top: 120px; padding-bottom: 60px; }
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-text h1 { font-size: 2.5rem; }
    .hero-text p { margin-left: auto; margin-right: auto; }
    .cta-group { justify-content: center; display: flex; gap: 15px; }
    .hero-image { display: none; }
    
    /* Stats Section */
    .stats-section { margin-top: 0; }
    .stats-grid { padding: 30px 20px; }
    .stat-item:not(:last-child)::after { display: none; }
    
    /* Personalization: Una colonna, nasconde la grafica a destra */
    .personalization-wrapper { grid-template-columns: 1fr; }
    .personalization-visual { display: none; }
    
    /* Testimonials: Adatta card */
    .review-card { min-width: 240px; max-width: 240px; min-height: 240px; padding: 20px; }
    .carousel-wrapper { padding: 0 10px; }
    .nav-btn { display: none; }
}

/* Mobile Piccoli (fino a 480px) */
@media (max-width: 480px) {
    .section-header h2 { font-size: 2rem; }
    .hero-text h1 { font-size: 2.5rem; }
    .btn { padding: 10px 20px; font-size: 0.9rem; }
    .params-list { grid-template-columns: 1fr; } /* Parametri in una sola colonna */
    .vision-content { padding: 30px 20px; }
    .personalization-wrapper { padding: 30px 20px; }
    .vision-stat { flex-direction: column; text-align: center; gap: 5px; }
    .footer-content { flex-direction: column; text-align: center; }
}