/* ==============================
   1. PALETTE E VARIABILI
============================== */
:root {
    --primary-color: rgba(13, 18, 66, 0.956);
    --secondary-color: rgba(43, 43, 43, 0.703);
    --accent-color: rgb(35, 11, 124);
    --bg-light: rgb(18, 34, 72);
    --text-dark: #333333;
    --text-light: #ffffff;
    --text-muted: #a8a8a8; /* Reso un grigio chiaro invece di "green" per coerenza visiva */
    --white: #ffffff;
    --hover-color: rgba(22, 40, 207, 0.8);
    --glass-blur: rgba(38, 39, 47, 0.6);

    --radius: 20px; /* Leggermente ridotto per un look più moderno */
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 12px 25px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --container-width: 1200px;
    --gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* ==============================
   2. RESET E IMPOSTAZIONI BASE
============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-light); /* Colore base chiaro visto lo sfondo scuro */
    line-height: 1.6;
    width: 100%;
    font-size: clamp(1rem, 0.9rem + 0.25vw, 1.15rem);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* ==============================
   3. TIPOGRAFIA COMUNE
============================== */
h1, h2, h3, h4 {
    color: var(--text-light);
    line-height: 1.2;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 5%;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
    font-weight: 400;
}

/* ==============================
   4. LAYOUT & SEZIONI
============================== */
section {
    padding: 5rem 5%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 15px;
    left: 5%;
    right: 5%;
    width: 90%;
    align-items: center;
    z-index: 1000;
    background: var(--glass-blur);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    border-radius: var(--radius);
    justify-content: space-between;
    padding: 1rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
}


.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}
/* --- STILE SOLA ICONA HAMBURGER --- */
#mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 22px;
    position: relative;
    display: none;
    font-size: 0; /* Nasconde il carattere ☰ */
    padding: 0;
}

/* Linea superiore e centrale (creata con box-shadow) */
#mobile-menu-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: var(--transition);
    /* La box-shadow crea la linea in mezzo */
    box-shadow: 0 9px 0 var(--white); 
}

/* Linea inferiore */
#mobile-menu-btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

/* --- ANIMAZIONE IN "X" (Richiede classe .open aggiunta via JS) --- */
#mobile-menu-btn.open::before {
    box-shadow: none; /* Sparisce la linea centrale */
    top: 10px;
    transform: rotate(45deg);
}

#mobile-menu-btn.open::after {
    bottom: 9px;
    transform: rotate(-45deg);
}
.nav-link:hover {
    background-color: rgba(102, 102, 102, 0.25);
    color: var(--white);
}

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    background: linear-gradient(rgba(13, 16, 22, 0.602), rgba(8, 10, 15, 0.34)), url('../img/hero_photo.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
    padding-top: 100px; /* Compensa la navbar */
    max-width: 100%; /* La hero esce dal container centrale */
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-inline: auto;
    animation: fadeInUp 1s ease forwards;
    opacity: 0; /* Partenza per animazione */
}

.hero-btn {
    animation: fadeInUp 1.2s ease forwards;
    opacity: 0; /* Partenza per animazione */
}

/* ==============================
   5. COMPONENTI (Bottoni, Card, Form)
============================== */
/* Bottoni */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 50px; /* Look a pillola molto elegante */
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow);
}

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

.btn-primary:hover {
    background-color: var(--hover-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: var(--glass-blur);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--bg-light);
    transform: translateY(-3px);
}

/* Feature Cards (I miei servizi) */
.features-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.feature-card {
    display: flex;
    background-color: var(--secondary-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.services-image {
    width: 40%;
    object-fit: cover;
}

.feature-content {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.feature-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

/* Content Item (Ultimi Aggiornamenti) */
.content-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
}

.content-item {
    background-color: var(--secondary-color);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.content-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.content-title {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.about_content {
    max-width: 800px; 
    margin: 0 auto;
    text-align: center; 
    background-color: var(--secondary-color);  
    box-shadow: var(--shadow); 
    border: 1px solid rgba(255, 255, 255, 0.05);
}
/* Contact Form */
.contact-form {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--secondary-color);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--white);
}

.form-input {
    width: 100%;
    padding: 1rem;
    background-color: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 12px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(89, 0, 255, 0.2);
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ==============================
   6. ANIMAZIONI
============================== */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Applica ritardi all'animazione per le liste multiple */
.feature-card:nth-child(1) { animation-delay: 0.2s; }
.feature-card:nth-child(2) { animation-delay: 0.4s; }

/* ==============================
   7. RESPONSIVE DESIGN (Mobile)
============================== */
@media (max-width: 864px) {
    /* Navbar Hamburger */
    .navbar-toggler { display: block; }
    #mobile-menu-btn {
        display: block; /* MODIFICATO: Mostra solo su mobile */
        z-index: 1001; /* Assicura che l'icona stia sopra al menu a tendina */
    }
    
    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1.5rem;
        border-radius: var(--radius);
        margin-top: 10px;
        box-shadow: var(--shadow);
        background: var(--glass-blur);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    #nav-menu.active {
        display: flex !important;
    }

    .navbar-nav.active { display: flex; }

    /* Fix per Layout Feature Cards */
    .feature-card {
        flex-direction: column; /* Impila l'immagine sopra il testo invece di nasconderla */
    }

    .services-image {
        width: 100%;
        height: 250px; /* Immagine stile copertina su mobile */
    }

    .feature-content {
        padding: 2rem;
    }

    .contact-form {
        padding: 2rem;
    }
}