/* --- INCOLLA TUTTO QUESTO DENTRO style.css --- */

/* --- VARIABILI & RESET --- */
:root {
    --primary: #2C5F4B;
    --primary-light: #6B9080;
    --accent: #C89F65;
    --bg-body: #FCFCFA;
    --bg-white: #FFFFFF;
    --text-main: #333333;
    --text-muted: #555555;
    --border-radius: 8px;
    --shadow: 0 4px 20px rgba(44, 95, 75, 0.08);
    --header-height: 70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background-color: var(--bg-body); color: var(--text-main); line-height: 1.7; overflow-x: hidden; -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4 { font-family: 'Lora', serif; font-weight: 500; color: var(--primary); }
p { color: var(--text-muted); margin-bottom: 1rem; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- ANIMAZIONI --- */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.2s; }
.service-card:nth-child(4) { transition-delay: 0.3s; }
.service-card:nth-child(5) { transition-delay: 0.4s; }
.service-card:nth-child(6) { transition-delay: 0.5s; }

/* --- POPUP --- */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: all 0.5s ease; }
.popup-overlay.show { opacity: 1; visibility: visible; }
.popup-content { background: white; padding: 2.5rem; border-radius: var(--border-radius); max-width: 450px; width: 90%; text-align: center; position: relative; transform: translateY(20px); transition: transform 0.5s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.2); border-top: 5px solid var(--accent); }
.popup-overlay.show .popup-content { transform: translateY(0); }
.popup-close { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; cursor: pointer; color: #aaa; transition: 0.3s; }
.popup-close:hover { color: var(--primary); }
.popup-icon { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }

/* --- COMPONENTI UI --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.btn { display: inline-block; padding: 12px 30px; border-radius: 4px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; border: none; font-size: 0.9rem; letter-spacing: 0.5px; text-transform: uppercase; text-align: center; }
.btn-primary { background-color: var(--primary); color: white; box-shadow: 0 4px 15px rgba(44, 95, 75, 0.2); }
.btn-primary:hover { background-color: #1e4234; transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: white; }
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 0.5rem; position: relative; display: inline-block; }
.section-header h2::after { content: ''; display: block; width: 60px; height: 3px; background: var(--accent); margin: 10px auto 0; }
.section-header p { font-size: 1.1rem; max-width: 600px; margin: 1.5rem auto 0; }

/* --- HEADER & NAV --- */
header { position: fixed; top: 0; width: 100%; background: rgba(255, 255, 255, 0.98); border-bottom: 1px solid rgba(0,0,0,0.05); z-index: 1000; height: var(--header-height); display: flex; align-items: center; transition: all 0.3s ease; }
nav { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 2rem; }
.logo { display: flex; align-items: center; flex-shrink: 0; height: 100%; }
.logo img { max-height: 50px; width: auto; object-fit: contain; display: block; }
.nav-menu { display: flex; gap: 2rem; align-items: center; }
.nav-link { font-weight: 500; color: var(--text-main); position: relative; font-size: 0.95rem; text-transform: uppercase; padding: 5px 0; cursor: pointer; }
.nav-link::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background-color: var(--accent); transition: width 0.3s; }
.nav-link:hover::after { width: 100%; }
.hamburger { display: none; font-size: 1.5rem; cursor: pointer; color: var(--primary); padding: 5px; }

/* --- HERO SECTION --- */
.hero { height: 90vh; min-height: 600px; display: flex; align-items: center; position: relative; background: linear-gradient(to right, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.1) 100%), url('images/back_mobile.webp'); background-size: cover; background-position: center; margin-top: var(--header-height); }
.hero-content { max-width: 650px; padding-right: 20px; animation: fadeInUp 1s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero h1 { font-size: 3.2rem; line-height: 1.2; margin-bottom: 1rem; color: var(--primary); font-weight: 600; }
.hero h2 { font-size: 1.5rem; color: var(--accent); margin-bottom: 1.5rem; font-family: 'Poppins', sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: 2px; }
.hero p { font-size: 1.2rem; margin-bottom: 2.5rem; color: #4a4a4a; border-left: 4px solid var(--accent); padding-left: 15px; }

/* --- ABOUT SECTION --- */
section { padding: 5rem 0; }
.about-wrapper { display: flex; align-items: flex-start; gap: 4rem; background: white; padding: 3rem; border-radius: var(--border-radius); box-shadow: var(--shadow); }
.about-image { flex: 0.8; position: relative; }
.about-image img { width: 100%; height: auto; border-radius: var(--border-radius); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.about-text { flex: 1.2; }
.about-text h3 { font-size: 1.8rem; margin-bottom: 1.5rem; color: var(--primary); }
.about-text blockquote { font-style: italic; color: var(--primary-light); margin: 1.5rem 0; font-size: 1.1rem; border-left: 3px solid var(--accent); padding-left: 1rem; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 25px; }
.badge { background: var(--bg-body); color: var(--primary); border: 1px solid var(--primary-light); padding: 6px 14px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* --- SERVICES --- */
.bg-light { background-color: #f4f7f5; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.service-card { background: white; padding: 2.5rem; border-radius: var(--border-radius); box-shadow: var(--shadow); transition: transform 0.3s, opacity 0.8s ease-out, transform 0.8s ease-out; border-top: 4px solid var(--primary); height: 100%; }
.service-card:hover { transform: translateY(-5px) !important; }
.service-icon { font-size: 2.5rem; color: var(--accent); margin-bottom: 1.5rem; }
.service-card h3 { font-size: 1.4rem; margin-bottom: 1rem; font-family: 'Poppins', sans-serif; font-weight: 600; }

/* --- INFO BAR --- */
.info-bar { background-color: var(--primary); color: white; padding: 0.8rem 0; font-size: 0.85rem; }
.info-bar .container { display: flex; justify-content: space-between; align-items: center; }
.info-bar a { color: white; margin-left: 20px; }
.info-bar i { margin-right: 8px; color: var(--accent); }

/* --- NUOVO LAYOUT CONTATTI (SPLIT) --- */
.contact-section { background-color: white; }
.contact-split-wrapper {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

/* Colonna Sinistra (Info) */
.contact-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-box-item {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.info-box-item:not(.no-hover):hover {
    transform: translateX(10px);
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.info-box-item i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-right: 20px;
    width: 30px;
    text-align: center;
}

.info-box-item strong { display: block; color: var(--primary); text-transform: uppercase; font-size: 0.85rem; margin-bottom: 3px; }
.info-box-item p { margin: 0; color: #555; }

/* Colonna Destra (Form) */
.contact-right {
    flex: 1.2;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid #eee;
}

.form-group { margin-bottom: 15px; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    background-color: #fafafa;
    transition: 0.3s;
}

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

/* --- WHATSAPP FIX --- */
/* 8. WHATSAPP FLOTTANTE (MODIFICATO) */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    padding: 12px 24px;       /* Più spazio laterale per il testo */
    border-radius: 50px;      /* Bordo a "pillola" */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;                /* Spazio tra icona e testo */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* Animazione di entrata */
    animation: slideIn 1s ease-out forwards;
}

/* Testo del pulsante */
.whatsapp-text {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;      /* Impedisce al testo di andare a capo */
}

/* Icona */
.whatsapp-float i {
    font-size: 24px;
}

/* Effetto Hover (quando passi sopra col mouse) */
.whatsapp-float:hover {
    background-color: #1ebc57;
    transform: translateY(-5px); /* Si alza leggermente */
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Animazione all'ingresso della pagina */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(50px); /* Arriva dal basso */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE: Su cellulare torna tondo per non coprire il sito */
@media (max-width: 600px) {
    .whatsapp-float {
        padding: 15px;
        border-radius: 50%; /* Diventa un cerchio perfetto */
        width: 60px;
        height: 60px;
        justify-content: center;
    }

    .whatsapp-text {
        display: none; /* Nasconde la scritta su schermi piccoli */
    }

    .whatsapp-float i {
        margin: 0; /* Centra l'icona */
        font-size: 28px;
    }
}

/* --- FOOTER --- */
footer { background: #1a1a1a; color: #aaa; padding: 3rem 0; text-align: center; font-size: 0.9rem; }
footer a { color: white; }

/* --- MEDIA QUERIES --- */
@media (max-width: 992px) {
    :root { --header-height: 60px; }
    .hero h1 { font-size: 2.8rem; }
    .about-wrapper { gap: 2rem; padding: 2rem; }
    .info-bar { display: none; }
    .contact-split-wrapper { flex-direction: column; } /* Contatti in colonna su mobile */
    .contact-left, .contact-right { width: 100%; }

    .hamburger { display: block; }
    .nav-menu { position: fixed; top: var(--header-height); left: -100%; width: 100%; height: calc(100vh - var(--header-height)); background: white; flex-direction: column; justify-content: flex-start; padding: 2rem 30px; transition: 0.3s; border-top: 1px solid #eee; overflow-y: auto; }
    .nav-menu.active { left: 0; }
    .nav-menu li { width: 100%; text-align: left; margin-bottom: 0; border-bottom: 1px solid #f0f0f0; }
    .nav-link { display: block; padding: 1.2rem 0; font-size: 1.1rem; }
    .nav-menu .btn { width: 100%; display: block; margin-top: 2rem; text-align: center; }
}

@media (max-width: 768px) {
    .section-header h2 { font-size: 2rem; }
    .logo img { max-height: 40px; }
    .hero {
        margin-top: var(--header-height);
        min-height: 100vh; /* Tutto lo schermo */

        background:
                linear-gradient(rgba(255,255,255,0.85), rgba(255,255,255,0.85)), /* Velo bianco all'85% */
                url('images/back_mobile.webp');

        background-position: center center;
        background-size: cover;

        display: flex;
        align-items: center; /* Testo perfettamente al centro */
        text-align: center;
        padding: 2rem 0;
    }
    .hero-content { padding-right: 0; margin: 0 auto; }
    .hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
    .hero h2 { font-size: 1.1rem; margin-bottom: 1rem; }
    .hero p { border-left: none; padding-left: 0; font-size: 1rem; max-width: 90%; margin: 0 auto 2rem; }
    .hero-content div { flex-direction: column; align-items: stretch; gap: 15px; max-width: 280px; margin: 0 auto; }
    .hero-content .btn { width: 100%; }
    section { padding: 3.5rem 0; }
    .about-wrapper { flex-direction: column; padding: 1.5rem; text-align: left; }
    .about-image { width: 100%; order: -1; margin-bottom: 1rem; }
    .about-text { width: 100%; }
    .about-text h3 { font-size: 1.6rem; }
}

/* --- VALIDAZIONE FORM & MESSAGGI (AGGIORNATO) --- */

/* Importante: Rende il contenitore del form il punto di riferimento */
.contact-right {
    position: relative;
    overflow: hidden; /* Assicura che nulla esca dai bordi */
}

/* Stile base del messaggio (nascosto di default) */
#form-status {
    display: none;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
}

/* --- EFFETTO OVERLAY (SOLO PER SUCCESSO) --- */
/* Questa classe viene aggiunta via Javascript quando l'invio è OK */
.status-overlay {
    position: absolute; /* Si sgancia dal flusso e galleggia sopra */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98); /* Sfondo quasi bianco */
    z-index: 100; /* Sta sopra a tutto */

    /* Centra il testo perfettamente */
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* Icona gigante e animazione */
    font-size: 1.2rem;
    color: var(--primary);
    animation: fadeIn 0.4s ease-out;
}

.status-overlay i {
    font-size: 3.5rem; /* Icona molto grande */
    margin-bottom: 20px;
    color: #28a745; /* Verde successo */
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- MESSAGGI DI ERRORE (NON OVERLAY) --- */
/* Gli errori rimangono normali in alto */
.status-msg.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Stile Campi con Errore */
.input-error {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
}
.error-text {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
    height: 15px;
}

/* --- ANIMAZIONI --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}