/* -- Font Import -- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Roboto:wght@400;500&display=swap');

/* -- Variabili CSS -- */
:root {
    --primary-color: #0047ab;
    --secondary-color: #004080;
    --bg-color: #f4f7f9;
    --text-color-dark: #333;
    --text-color-light: #ffffff;
    --card-bg-color: #ffffff;
    --border-color: #e0e0e0;
    --hover-color: #878787;
    --transition: all 0.3s ease-in-out;
}

/* -- Reset & Global Styles -- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    color: var(--text-color-dark);
    background: var(--bg-color);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--hover-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    padding: 4rem 1rem;
}

h1, h2, h3 {
    font-family: 'Roboto', sans-serif;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* -------------------- */
/* -- Header & Navigation -- */
/* -------------------- */
.main-header { /* Utilizza la classe per compatibilità e specificità */
    background: var(--primary-color);
    color: var(--text-color-light);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Rende il link del logo bianco sullo sfondo */
.logo a {
    color: var(--text-color-light);
    font-weight: 700; /* Mantiene il grassetto del logo */
}

.main-nav a {
    color: var(--text-color-light);
    font-weight: 600;
    margin-left: 1.5rem;
    padding: 0 1rem; /* Adattato per il dropdown */
    display: inline-block;
}

.main-nav a:hover {
    opacity: 0.8;
    color: var(--text-color-light); /* Assicura che i link principali restino bianchi */
}

/* Stili per il contenitore del dropdown */
.dropdown {
    position: relative;
    display: inline-block; 
}

/* Stili per il Sottomenù (Dropdown) */
.dropdown-content {
    /* Proprietà chiave per l'apertura graduale e la professionalità */
    display: block; 
    overflow: hidden; 
    
    /* Inizialmente invisibile */
    max-height: 0;
    opacity: 0;
    
    /* Animazione: durata per un'apertura morbida */
    transition: max-height 0.5s ease-out, opacity 0.3s ease-out;

    /* Posizionamento e Design Professionale */
    position: absolute;
    background-color: rgba(255,255,255,0.9); /* Trasparente al 90% */
    min-width: 220px; /* Impostato un min-width per coerenza */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); 
    z-index: 10; 
    border-radius: 4px; 
    padding: 0; 
    left: 0; 
    top: 100%; 
    border-top: 3px solid var(--primary-color); /* Linea blu sopra */
}
/* NUOVA REGOLA DA AGGIUNGERE */
.dropdown-content.show {
    max-height: 400px; /* Valore grande per mostrare tutti i link */
    opacity: 1; 
}
/* Stili per i link all'interno del sottomenù */
.dropdown-content a {
    color: var(--text-color-dark); /* Testo grigio scuro */
    padding: 8px 12px;
    text-decoration: none;
    display: block; 
    text-align: left; 
    font-weight: 500; 
    transition: background-color 0.2s, color 0.2s;
    margin-left: 0; /* Rimuove il margine ereditato dal .main-nav a */
}

/* Effetto Hover sui link del sottomenù */
.dropdown-content a:hover {
    background-color: #f0f0f0; 
    color: var(--primary-color); 
}

/* -------------------- */
/* -- Hero Section -- */
/* -------------------- */
.hero-section {
    background: var(--secondary-color);
    color: var(--text-color-light);
    text-align: center;
    padding: 6rem 1rem;
}

.hero-section h1 {
    color: var(--text-color-light);
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    background: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background: #003a87;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* -------------------- */
/* -- Services Section -- */
/* -------------------- */
.services-section {
    background: var(--bg-color);
}

/* Service Card Grid (dal primo style.css) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Services Layout (dal secondo style.css - puoi scegliere quale usare a seconda del layout) */
.services-layout {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--card-bg-color);
    border-radius: 12px;
    margin: 2rem auto;
    max-width: 1200px;
}

.services-text {
    flex: 1;
}

.services-image {
    flex: 1;
    text-align: center;
}

.services-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* -------------------- */
/* -- About Section -- */
/* -------------------- */
.about-section {
    background: #e9f0f5;
    text-align: center;
}

.about-section p {
    max-width: 800px;
    margin: 0 auto 1rem;
}

/* -------------------- */
/* -- Contact Section -- */
/* -------------------- */
.contact-section {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--card-bg-color); /* Unificato al colore del primo file */
}

.contact-section h2 {
    color: var(--text-color-dark);
}

.contact-form {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-button {
    background: var(--primary-color);
    color: var(--text-color-light);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-button:hover {
    background: #003a87;
}

/* -------------------- */
/* -- Footer -- */
/* -------------------- */
.main-footer {
    background: var(--secondary-color);
    color: var(--text-color-light);
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.footer-content {
    /* Mantenuto flessibile per la centratura e l'adattabilità */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-name {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-color-light);
    margin: 0 0.8rem;
}

/* -- Media Queries -- */
@media(max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
    }
    .main-nav {
        margin-top: 1rem;
    }
    .main-nav a {
        margin: 0 0.5rem;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    /* Aggiunta regola per layout servizi alternativo */
    .services-layout {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }
    .services-section,
    .about-section,
    .contact-section {
        padding: 3rem 1rem;
    }
}