/* =========================================
   RESET E VARIABILI GLOBALI (DARK THEME LWSi)
========================================= */
:root {
    --primary-color: #3b82f6; /* Azzurro per i link e dettagli */
    --text-dark: #ffffff;     /* Il testo principale ora è bianco */
    --text-light: #94a3b8;    /* Grigio chiaro per i paragrafi (leggibilità) */
    
    /* I COLORI PRESI DALLE TUE SCHERMATE HACCP+ */
    --bg-light: #0f141e;      /* Sfondo base (Blu notte profondo) */
    --white: #1e2638;         /* Sfondo delle Card/Menu (Blu notte più chiaro) */
    --border-color: #2d3748;  /* Colore dei bordi per separare le card */
    
    /* Colori specifici per i badge (resi leggermente più luminosi per il dark) */
    --color-haccp: #10b981; 
    --color-hr: #06b6d4;    
    --color-wms: #f97316;   
    --color-cassa: #8b5cf6; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

/* =========================================
   HEADER & NAV
========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container h1 { font-size: 1.5rem; color: var(--primary-color); }
.logo-container span { font-weight: 300; color: var(--text-dark); }

nav ul { list-style: none; display: flex; gap: 2rem; align-items: center; }
nav a { text-decoration: none; color: var(--text-light); font-weight: 500; transition: color 0.3s; }
nav a:hover { color: var(--text-dark); }

/* =========================================
   HERO SECTION
========================================= */
.hero {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, var(--white) 0%, var(--bg-light) 100%);
}
.hero h2 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--text-dark); }
.hero p { font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto 2rem auto; }

.btn-primary {
    display: inline-block; padding: 0.8rem 2rem;
    background-color: var(--primary-color); color: #ffffff;
    text-decoration: none; border-radius: 50px; font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s; border: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }

/* =========================================
   MODULI (GRID & CARD)
========================================= */
.modules-section { padding: 5rem 5%; background-color: var(--bg-light); }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 { font-size: 2rem; margin-bottom: 0.5rem;}

.modules-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem;
}

.module-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px; padding: 2rem;
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex; flex-direction: column;
}
.module-card:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.3); transform: translateY(-5px); }

/* IMMAGINI NELLE CARD */
.module-card img {
    width: 100%; 
    height: 200px; /* ALTEZZA FISSA: le rende tutte alte uguali */
    object-fit: cover; /* Ritaglia l'immagine per farla entrare nel riquadro senza deformarla */
    object-position: top; /* Si assicura di mostrare la parte alta (le intestazioni) del software */
    border-radius: 8px; 
    margin-top: auto; /* Incolla l'immagine sul fondo della card */
    margin-bottom: 0;   
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    cursor: zoom-in;
}
.module-card:hover img { 
    transform: scale(1.02); 
}
.dashboard-showcase { margin: 3rem auto; max-width: 1000px; text-align: center; padding: 0 1rem; }
.dashboard-showcase img {
    width: 100%; height: auto; border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5); border: 1px solid var(--border-color);
}

/* =========================================
   BADGE / PILLOLE
========================================= */
.badge-container { display: inline-block; padding: 0.4rem 1rem; border-radius: 50px; margin-bottom: 1rem; align-self: flex-start; }
.badge-text { font-weight: bold; font-size: 0.9rem; color: #ffffff; }

.haccp-badge { background-color: var(--color-haccp); }
/* Badge per il modulo HR+ */
.hr-badge {
    background-color: rgba(245, 158, 11, 0.1); /* Sfondo arancione chiaro/dorato */
    border: 1px solid #f59e0b;
}

.hr-badge .badge-text {
    color: #f59e0b; /* Arancione solido */
}
.wms-badge { background-color: var(--color-wms); }
.cassa-badge { background-color: var(--color-cassa); }

.module-card h3 { margin-bottom: 1rem; font-size: 1.3rem; }

.module-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Fondamentale: spinge l'immagine sempre sul fondo! */
}

.btn-module {
    display: inline-block; padding: 0.6rem 1.2rem;
    border: 2px solid var(--primary-color); color: var(--primary-color);
    text-decoration: none; border-radius: 8px; font-weight: bold; text-align: center; transition: all 0.3s;
}
.btn-module:hover { background-color: var(--primary-color); color: #ffffff; }

.btn-disabled { border-color: #475569; color: #475569; cursor: not-allowed; }
.btn-disabled:hover { background-color: transparent; color: #475569; }

/* =========================================
   FOOTER
========================================= */
footer { text-align: center; padding: 2rem; background-color: #0b0f17; color: var(--text-light); border-top: 1px solid var(--border-color);}

/* =========================================
   PRICING SECTION (SAAS WIDGETS)
========================================= */
.pricing-section {
    padding: 5rem 5%;
    background-color: var(--bg-light);
}

.pricing-grid {
    display: grid;
    /* Riduco la larghezza minima da 300px a 250px per farne entrare 4 */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 1.5rem; /* Riduco leggermente lo spazio tra le card */
    max-width: 1400px; /* Allargo il contenitore principale per farle stare tutte */
    margin: 0 auto;
}

.pricing-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.5rem; /* Ridotto il padding interno */
    text-align: center;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* La card centrale (consigliata) sarà evidenziata col colore di HACCP+ */
.pricing-card.featured {
    border: 2px solid var(--color-haccp);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.15);
}

.pricing-card.featured .badge-featured {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-haccp);
    color: #fff;
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pricing-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.pricing-price {
    font-size: 3rem;
    font-weight: bold;
    color: var(--color-haccp);
    margin-bottom: 0.5rem;
}

.pricing-price span {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: normal;
}

.pricing-features {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
    flex-grow: 1;
}

.pricing-features li {
    margin-bottom: 1rem;
    color: var(--text-light);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pricing-features li::before {
    content: "✓";
    color: var(--color-haccp);
    font-weight: bold;
}

/* =========================================
   MODAL IMMAGINI (LIGHTBOX)
========================================= */
.module-card img, .dashboard-showcase img {
    cursor: zoom-in; /* Fa capire all'utente che può cliccare */
}

.modal {
    display: none; /* Nascosto di default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 20, 30, 0.9); /* Sfondo scuro semitrasparente */
    backdrop-filter: blur(5px); /* Effetto sfocato per il sito dietro */
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    margin-top: 5vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease; /* Animazione di apertura */
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #94a3b8;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--color-haccp);
    text-decoration: none;
}

/* =========================================
   BANNER VANTAGGI COMMERCIALI (PRICING)
========================================= */
.pricing-perks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    max-width: 900px;
    margin: 3rem auto 0 auto; /* Modificato: 3rem di spazio in ALTO, 0 in basso */
    padding: 0 1rem;
}

.perk-banner {
    background-color: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 300px;
    text-align: left;
    transition: transform 0.3s, background-color 0.3s;
}

.perk-banner:hover {
    transform: translateY(-2px);
    background-color: rgba(16, 185, 129, 0.1);
}

.perk-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.perk-text strong {
    display: block;
    color: var(--color-haccp);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.perk-text p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* =========================================
   FASCIA CLIENTI (TRUST BADGE)
========================================= */
.trusted-section {
    background-color: var(--white);
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.trusted-title {
    color: var(--text-light);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.trusted-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
    opacity: 0.6;
}

/* Converte automaticamente i loghi a colori in scala di grigi luminosa per il tema scuro */
.trusted-logos img {
    max-height: 45px;
    filter: grayscale(100%) brightness(200%);
    transition: filter 0.3s, opacity 0.3s;
}

.trusted-logos img:hover {
    filter: grayscale(0%) brightness(100%);
    opacity: 1;
}

/* =========================================
   SEZIONE CHI SIAMO
========================================= */
.about-section {
    padding: 5rem 5%;
    background-color: var(--bg-light);
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
}

/* =========================================
   FAT FOOTER (INDEX PRINCIPALE)
========================================= */
.fat-footer {
    background-color: #080b12; /* Sfondo nero profondo per staccare dal resto della pagina */
    padding: 4rem 5% 1rem 5%;
    border-top: 2px solid var(--primary-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto 3rem auto;
}

.footer-brand h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-brand h2 span {
    color: var(--text-dark);
    font-weight: 300;
}

.footer-brand p {
    color: var(--text-dark);
    font-weight: bold;
    font-size: 1rem;
}

.footer-contacts {
    list-style: none;
    margin-top: 1.5rem;
}

.footer-contacts li {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer-links h4 {
    color: var(--color-haccp);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--text-dark);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: #475569;
    font-size: 0.9rem;
}

/* Adattamento in colonna per i cellulari */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   PAGINA CONTATTI (FORM E WIDGETS)
========================================= */
.contact-section { padding: 4rem 5%; background-color: var(--bg-light); min-height: 80vh; }
.contact-container { max-width: 800px; margin: 0 auto; }

.contact-form {
    background-color: var(--white);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-light); font-size: 0.95rem; }

.form-control {
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.contact-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.widget-card {
    text-align: center;
    padding: 2rem;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.widget-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* Colore verde specifico per hover su WhatsApp */
.widget-card:nth-child(1):hover { border-color: #25D366; }

.widget-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.widget-title { color: var(--text-dark); margin-bottom: 0.5rem; font-size: 1.2rem; }
.widget-text { color: var(--text-light); font-size: 0.95rem; }

/* Adattamento per i cellulari */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .contact-form { padding: 1.5rem; }
}

/* =========================================
   PAGINA PRIVACY E LEGALE
========================================= */
.legal-section { padding: 4rem 5%; background-color: var(--bg-light); }
.legal-container { max-width: 900px; margin: 0 auto; background-color: var(--white); padding: 4rem; border-radius: 12px; border: 1px solid var(--border-color); }
.legal-content h3 { color: var(--primary-color); font-size: 1.3rem; margin-top: 2rem; margin-bottom: 1rem; }
.legal-content p { color: var(--text-light); margin-bottom: 1.5rem; font-size: 1.05rem; }

@media (max-width: 768px) {
    .legal-container { padding: 2rem; }
}

/* =========================================
   DIMENSIONI LOGO (NAVBAR E FOOTER)
========================================= */
.nav-logo {
    height: 50px; /* Altezza ideale per la barra di navigazione */
    width: auto;
    object-fit: contain;
}

.footer-logo {
    height: 70px; /* Un po' più grande nel footer per dare impatto */
    width: auto;
    object-fit: contain;
    margin-bottom: 1rem; /* Spazio tra il logo e la scritta LWSi Software */
}

/* =========================================
   STILE TESTO LOGO (LWSi Software)
========================================= */
.lwsi-blue {
    color: var(--primary-color) !important;
    font-weight: bold !important;
}

.software-thin {
    color: var(--text-dark) !important;
    font-weight: 300 !important;
}

/* =========================================
   OTTIMIZZAZIONE SMARTPHONE (MOBILE)
========================================= */
@media (max-width: 768px) {
    /* 1. Sistemazione dell'Header (Barra in alto) */
    .navbar {
        flex-direction: column; /* Sposta il menu sotto il logo */
        padding: 1rem 5%;
        gap: 15px; /* Spazio tra logo e menu */
    }

    .logo-container {
        justify-content: center; /* Centra il logo al centro dello schermo */
        width: 100%;
    }

    .navbar nav ul {
        flex-wrap: wrap; /* Permette ai link di andare a capo se non ci stanno */
        justify-content: center; /* Centra i link */
        gap: 10px 20px; /* Spazio orizzontale e verticale tra i link */
        padding: 0;
    }

    .navbar nav ul li a {
        font-size: 0.95rem; /* Rende i link leggermente più compatti */
        padding: 5px;
    }

    /* 2. Ottimizzazione Testi (Hero e Sezioni) */
    .hero {
        padding: 6rem 5% 4rem 5%; /* Aggiusta gli spazi sopra e sotto */
    }

    .hero-content h2 {
        font-size: 2.2rem; /* Rimpicciolisce il titolone per evitare che esca dai bordi */
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 1rem;
        padding: 0 10px; /* Dà un po' di respiro ai lati del testo */
    }

    .section-header h2 {
        font-size: 1.8rem;
    }
}

/* =========================================
   GRIGLIA FORZATA A 3 COLONNE (Solo su PC)
========================================= */
@media (min-width: 992px) {
    .grid-3-desktop {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem;
    }
}