/* --- common.css --- */
/* Stili condivisi tra tutte le pagine */

:root {
    --primary-color: #FDFBF5;
    /* Crema chiaro */
    --secondary-color: #2d3748;
    /* Grigio Ardesia scuro per il nuovo footer */
    --accent-color: #c5b358;
    /* Oro classico */
    --text-color: #2d3748;
    /* Grigio Ardesia scuro (per testi) */
    --text-color-light: #f8f9fa;
    /* Testo chiaro per footer */
    --text-color-muted: #adb5bd;
    /* Grigio secondario (per testi footer) */
    --bg-gradient-start: #FDFBF5;
    --bg-gradient-end: #F5F2EA;
    --border-color: rgba(255, 255, 255, 0.1);
    /* Bordi chiari per footer */
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-heading: 'Playfair Display', serif;

    /* Typography Standards */
    --h1-hero-size: 4.5rem;
    --h1-hero-size-tablet: 3.5rem;
    --h1-hero-size-mobile: 2.8rem;
    --lead-hero-size: 1.25rem;
    --lead-hero-size-mobile: 1.1rem;
    --section-title-size: 3rem;
    --section-title-size-mobile: 2.2rem;
}


/* Per Chrome, Safari, Edge */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 20px;
    border: 3px solid var(--secondary-color);
}

::-webkit-scrollbar-thumb:hover {
    background-color: #e0ca6c;
}


html {
    scroll-behavior: smooth;
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-gradient-start);
    color: var(--text-color);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.8;
    margin: 0 !important;
    padding: 0 !important;
}

/* Wrapper per il contenuto che scorre sopra l'hero */
.scroll-wrapper {
    position: relative;
    z-index: 3;
    /* Deve essere sopra l'hero */
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    overflow-x: clip;
    /* Risolve bug animazioni su mobile */
}

/* Utility: contenuto post-hero che scorre sopra la sezione hero sticky.
   Usato da ChiSiamo, Servizi e altre pagine con hero video + sezioni sottostanti. */
.page-scroll-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

.section {
    padding: 120px 0;
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 3rem;
    letter-spacing: -0.5px;
}

.section-subtitle {
    font-size: 1.1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 4rem;
}

.text-accent {
    color: var(--accent-color);
}

.btn-custom {
    background-color: var(--accent-color);
    border: 2px solid var(--accent-color);
    color: #FFFFFF;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-custom:hover {
    background-color: transparent;
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Allineamento con HTML: Varianti Bottoni Accessorie Globali */

.btn-gold {
    /* Alias per .btn-custom usato localmente in alcuni file React */
    background-color: var(--accent-color) !important;
    border: 2px solid var(--accent-color) !important;
    color: #FFFFFF !important;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
    line-height: 1.5;
}
.btn-gold:hover {
    background-color: transparent !important; 
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}



.btn-custom-white {
    background-color: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
}
.btn-custom-white:hover {
    background-color: #FFFFFF !important;
    color: var(--accent-color) !important;
    border-color: #FFFFFF !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-outline-custom {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 12px 35px;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}
.btn-outline-custom:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: #fff;
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* --- NAVBAR MIGLIORATA --- */
.navbar {
    background-color: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
    padding: 2rem 0;
    /* Aumentato padding iniziale */
    z-index: 10;
}

.navbar.scrolled {
    background-color: rgba(253, 251, 245, 0.85);
    /* Aumentata opacità per leggibilità */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.navbar-brand img {
    height: 70px;
    /* Aumentata altezza iniziale del logo */
    transition: height 0.4s ease;
    /* Transizione fluida */
    background-color: transparent;
    border: none;
}

.navbar.scrolled .navbar-brand img {
    height: 50px;
    /* Altezza del logo dopo lo scroll */
}

.navbar .nav-link {
    color: var(--text-color);
    font-weight: 500;
    margin: 0 1rem;
    position: relative;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.navbar .nav-link:hover {
    color: var(--accent-color);
}

/* Bug #6 fix: white nav links only on pages with dark hero.
   Pages without hero (FAQ, Contattaci, Grazie) use default dark links.
   Add class 'has-dark-hero' to <body> or use .hero-page on the root element. */
body.has-dark-hero .navbar:not(.scrolled) .nav-link,
body.has-dark-hero .navbar:not(.scrolled) .navbar-brand,
body.has-dark-hero .navbar:not(.scrolled) .nav-link.active {
    color: #ffffff !important;
}

.navbar .nav-link.active {
    color: var(--text-color);
}

body.has-dark-hero .navbar:not(.scrolled) .btn-custom-outline {
    border-color: #ffffff;
    color: #ffffff;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 100%;
}

.navbar .btn-custom {
    padding: 8px 24px;
    font-size: 0.8rem;
}

.navbar-toggler {
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Stile per l'icona del menu hamburger a forma di piramide di lingotti a 3 livelli */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpolygon points='10,9 20,9 19,5 11,5' stroke='%23c5b358' stroke-width='1.5' fill='none'/%3e%3cpolygon points='4,16 14,16 13,12 5,12' stroke='%23c5b358' stroke-width='1.5' fill='none'/%3e%3cpolygon points='16,16 26,16 25,12 17,12' stroke='%23c5b358' stroke-width='1.5' fill='none'/%3e%3cpolygon points='1,23 9,23 8,19 2,19' stroke='%23c5b358' stroke-width='1.5' fill='none'/%3e%3cpolygon points='11,23 19,23 18,19 12,19' stroke='%23c5b358' stroke-width='1.5' fill='none'/%3e%3cpolygon points='21,23 29,23 28,19 22,19' stroke='%23c5b358' stroke-width='1.5' fill='none'/%3e%3c/svg%3e") !important;
}

/* NUOVO: Stile per il pulsante Area Personale */
.navbar .btn-custom-outline {
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    background: transparent;
    text-decoration: none;
}

.navbar .btn-custom-outline:hover {
    background-color: var(--accent-color);
    color: #FFFFFF;
}


/* Navbar Scroll Progress Bar */
.progress-bar-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: transparent;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-light, #ffd700);
    transition: width 0.1s linear;
}

/* --- Sezione Hero Video unificata --- */
/* --- FOOTER PREMIUM MIGLIORATO --- */
.footer {
    background: linear-gradient(180deg, #18202d 0%, #11151c 100%);
    padding: 100px 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 10;
    border-top: 1px solid rgba(197, 179, 88, 0.2);
}

.footer.footer-black {
    background: #000000;
}

/* Effetto bagliore superiore delicato */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0.6;
}

.footer-top {
    display: grid;
    /* Struttura a 3 colonne elegante */
    grid-template-columns: 2fr 3fr 1.5fr;
    gap: 4rem;
    padding-bottom: 60px;
    align-items: start;
}

.footer-col h5 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

/* Sottolineatura oro per i titoli */
.footer-col h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.footer-col:hover h5::after {
    width: 60px;
}

.esplora-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 3rem;
}

.esplora-grid ul {
    margin-bottom: 0;
}

.esplora-grid li {
    margin-bottom: 0.8rem;
}

/* Colonna specifica per il brand */
.footer-brand p {
    max-width: 320px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

/* Logo bianco */
.footer-brand img {
    height: 45px;
    filter: brightness(0) invert(1);
    margin-bottom: 1rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-col ul li {
    margin-bottom: 1rem;
}

.footer-text-muted {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem !important;
    display: block;
}

/* Icone Social Premium */
.social-icons {
    display: flex;
    gap: 1.2rem;
    margin-top: 2rem;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.social-icons a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #FFFFFF;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(197, 179, 88, 0.2);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin: 0;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.footer-bottom a:hover {
    color: var(--accent-color);
    transform: none; /* Niente traslazione in basso */
}

/* --- Stili Checkbox Personalizzati --- */
.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-check-input:focus {
    border-color: #c5b358;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(197, 179, 88, 0.25);
}


/* --- NUOVI STILI PER LE CHICCHE --- */


/* --- CHICCA #8: Transizioni di Pagina Fluide ORIGINALI --- */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #000000;
    z-index: 10000;
    pointer-events: none;
    opacity: 1;
    /* Inizia opaco */
    transition: opacity 0.4s ease-in-out;
    /* Transizione solo sull'opacità */
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-transition-overlay .logo-loader {
    width: 200px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Quando la pagina è caricata, l'overlay diventa trasparente */
body.page-loaded .page-transition-overlay {
    opacity: 0;
}

/* Quando l'overlay è visibile, il logo appare */
body:not(.page-loaded) .page-transition-overlay .logo-loader {
    opacity: 1;
    transform: scale(1);
}

/* Duplicate scrollbar block removed (Bug #8).
   Duplicate body:not(.page-loaded) rule removed (Bug #9). */


/* --- CHICCA #7: Pulsante "Torna su" --- */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease, background-color 0.3s ease;
    z-index: 1000;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: #e0ca6c;
}

#back-to-top i {
    font-weight: bold;
}


/* --- Media Queries per Responsività --- */

@media (max-width: 991.98px) {

    /* Breakpoint LG di Bootstrap per il collasso della navbar */
    .navbar .container {
        width: 100%;
        max-width: none;
        padding: 0 1.5rem;
    }

    .navbar-collapse {
        margin-top: 1rem;
        background-color: rgba(253, 251, 245, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 12px;
        padding: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .navbar .nav-item {
        width: 100%;
    }

    .navbar .nav-link {
        margin: 0;
        padding: 0.75rem 0.5rem;
        text-align: center;
    }

    /* FIX: Force dark text on mobile menu items even when navbar is at the top (not scrolled) */
    .navbar:not(.scrolled) .navbar-collapse .nav-link,
    .navbar:not(.scrolled) .navbar-collapse .btn-custom-outline {
        color: var(--text-color) !important;
    }
    .navbar:not(.scrolled) .navbar-collapse .btn-custom-outline {
        border-color: var(--text-color) !important;
    }

    .navbar .nav-link::after {
        display: none;
    }

    .navbar .nav-link:hover,
    .navbar .nav-link.active {
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 6px;
    }

    /* Stile pulsante area personale su mobile */
    .navbar .btn-custom-outline {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        width: 100%;
        justify-content: center;
        border: none;
        background-color: rgba(0, 0, 0, 0.04);
        color: var(--text-color);
        padding: 0.75rem 0.5rem;
    }

    .navbar .btn-custom-outline:hover {
        background-color: var(--accent-color);
        color: #FFFFFF;
    }
}


@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3.5rem;
    }

    .footer-col h5::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-col:hover h5::after {
        width: 40px; /* Disabilita espansione su mobile */
    }

    .esplora-grid {
        gap: 1rem;
        text-align: left;
    }

    .footer-brand p {
        margin-left: auto;
        margin-right: auto;
    }

    .social-icons {
        justify-content: center;
    }

    .footer a:hover {
        transform: none; /* Disabilita lo shift su mobile */
        color: var(--accent-color);
    }

    .footer-bottom {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 1rem;
    }

    #back-to-top {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .btn-custom {
        padding: 10px 28px;
        font-size: 0.9rem;
    }
}