/* Reset e Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(to bottom, #ffffff 0%, #f0f4f8 50%, #e2edf7 100%);
    background-attachment: fixed;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding-top: 100px; /* Spazio per l'header fisso */
}

/* Header e Layout */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: #ffffff;
    padding: 20px 50px;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    transition: padding 0.3s ease;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.brand-group {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.logo {
    height: 70px;
}

.tagline {
    padding-bottom: 5px;
    font-size: 0.85rem;
    color: #666;
}

/* Navigazione Desktop */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #005bb5;
}

.nav-login {
    background-color: #005bb5;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.nav-login:hover {
    background-color: #00458f;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #333;
    border-radius: 2px;
}

/* Container Principale */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 50px 20px 70px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 2.2rem;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-section p {
    font-size: 1.15rem;
    color: #555;
    line-height: 1.7;
}

/* Tipografia Principale */
h2.section-title {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 30px;
    border-bottom: 2px solid #005bb5;
    display: inline-block;
}

/* Macro-Aree */
.macro-area {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.macro-area-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.macro-area-text h3 {
    color: #005bb5;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.macro-area-text p {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.6;
}

.macro-area-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Sotto-servizi: Griglia di card compatte */
.sub-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.sub-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.08);
    border-color: #005bb5;
}

.sub-card h4 {
    font-size: 1rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.sub-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* Footer */
.footer-bar {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
    background-color: #ffffff;
}

/* Responsive Media Query */
@media screen and (max-width: 768px) {
    .main-header {
        padding: 10px 20px;
    }

    .tagline {
        display: none !important;
    }

    .logo {
        height: 40px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        border-bottom: 1px solid #e0e0e0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        gap: 15px;
    }
    
    /* Si attiva quando premi l'hamburger grazie allo script JS */
    .nav-menu.active {
        display: flex;
    }

    /* Layout Macro-Area su Smartphone: impilato a colonna singola */
    .macro-area {
        padding: 1.5rem;
    }

    .macro-area-content {
        grid-template-columns: 1fr; /* Una sola colonna */
        gap: 1.5rem;
    }

    .macro-area-text h3 {
        font-size: 1.3rem;
    }
    
    .hero-section h1 {
        font-size: 1.7rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }

    /* Griglia sotto-card su mobile: adatta lo spazio */
    .sub-cards-grid {
        grid-template-columns: 1fr; /* Sotto-card a colonna singola per leggibilità ottimale */
    }
}