/* Rifiniture aggiunte in fase di conversione statica.
   Il foglio originale non e' stato modificato: tutto quello che segue e' sovrascrittura. */

/* --- 1. Hero delle pagine interne, stessa altezza dello slider di home --- */
.page-header {
    height: 700px;
    background-attachment: scroll;
}
.page-header:before {
    background: linear-gradient(180deg, rgba(1, 8, 15, 0.30) 0%, rgba(1, 8, 15, 0.65) 100%);
}
.page-header .ItemTitle,
.page-header .CatTitle {
    animation: heroIn 0.7s cubic-bezier(.22, .61, .36, 1) both;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
@keyframes heroIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* --- 2. Footer sempre in fondo e blocco "consultation" attaccato al footer ---
   L'originale teneva il footer con position:absolute e altezze fisse
   (body margin-bottom 270px, #footer height 280px). Qui passa a flex:
   niente sovrapposizioni quando il contenuto e' lungo, niente footer a meta'
   pagina quando e' corto. E' lo stesso approccio che mobile.css usava gia'
   sotto i 992px, esteso a tutte le larghezze. */
body {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
#wrap {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#footer {
    position: static;
    height: auto;
    flex: 0 0 auto;
}
#main,
#main > #content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
#content > .moduletable:last-child {
    margin-top: auto;
}
.ContactSection {
    min-height: 320px;
}

/* --- 3. Pagina contatti --- */
.ContactIntro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 50px;
}
.ContactIntro h2 {
    color: #262853;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: bold;
    font-size: 2.2rem;
    margin-bottom: 15px;
}
.ContactCards .col-md-4 { margin-bottom: 30px; }
.ContactCard {
    border-top: 5px solid #262853;
    background: #fff;
    padding: 35px 30px 30px;
    text-align: center;
}
.ContactCard h4 {
    color: #262853;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
}
.ContactCard address,
.ContactCard p { margin-bottom: 6px; }
.ContactCard a { color: #767676; }
.ContactCard a:hover { color: #262853; }
.ContactIcon {
    width: 62px;
    height: 62px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ContactIcon img { width: 26px; height: 26px; }
.ContactMuted { color: #9a9a9a; font-size: 14px; }
.ContactLink {
    display: inline-block;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid #ececec;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #95BF32 !important;
}
.ContactLink:hover { color: #262853 !important; }

/* --- 4. Rifiniture generali --- */
html { scroll-behavior: smooth; }
img { max-width: 100%; }

.WrapServicesItem { overflow: hidden; }
.WrapServicesImgItem { overflow: hidden; }
.WrapServicesItem img { transition: transform 0.6s cubic-bezier(.22, .61, .36, 1); }
.WrapServicesItem:hover img { transform: scale(1.06); }

.Shadow { transition: box-shadow 0.3s ease, transform 0.3s ease; }
.Shadow:hover { transform: translateY(-4px); }

.CTA a,
.btn.btn-primary.validate {
    display: inline-block;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.CTA a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.navbar .nav > li > a { transition: color 0.2s ease; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid #95BF32;
    outline-offset: 3px;
}

/* --- 5. Velo di caricamento e transizioni fra le pagine --- */
#Loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    /* dissolvenza di sicurezza: se lo script non parte, dopo 8s sparisce comunque */
    animation: loaderSafety 0.6s ease 8s forwards;
}
.LoaderInner { text-align: center; }
.LoaderInner img {
    max-width: 200px;
    height: auto;
    margin-bottom: 26px;
    animation: loaderPulse 1.8s ease-in-out infinite;
}
.LoaderBar {
    display: block;
    width: 180px;
    height: 2px;
    margin: 0 auto;
    background: #ececec;
    overflow: hidden;
    position: relative;
}
.LoaderBar:after {
    content: '';
    position: absolute;
    top: 0; left: -40%;
    width: 40%;
    height: 100%;
    background: #95BF32;
    animation: loaderSlide 1.2s cubic-bezier(.65, .05, .36, 1) infinite;
}
@keyframes loaderSlide  { to { left: 100%; } }
@keyframes loaderPulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes loaderSafety { to { opacity: 0; visibility: hidden; } }

html.is-loaded #Loader {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s ease, visibility 0s linear 0.55s;
    animation: none;
}

/* Solo opacita': un transform sul body creerebbe un blocco contenitore
   per gli elementi posizionati in assoluto e sposterebbe il footer. */
html.js body { animation: pageIn 0.4s ease both; }
@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
html.is-leaving body {
    opacity: 0;
    transition: opacity 0.2s ease;
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    html.js body,
    .page-header .ItemTitle,
    .page-header .CatTitle { animation: none !important; }
    html { scroll-behavior: auto; }
    #Loader { display: none; }
}

/* --- 6. Altri servizi in fondo alla scheda di un servizio --- */
.OtherServices {
    background: #f7f7f8;
    padding: 55px 0 60px;
}
.OtherServicesTitle {
    text-align: center;
    color: #262853;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: bold;
    font-size: 1.9rem;
    margin: 0 0 35px;
}
.OtherServices .row { margin-bottom: 0; }
.OtherServices .WrapServicesItem { background: #fff; margin-bottom: 30px; }

@media (max-width: 991px) {
    .page-header { height: 480px; }
    .ContactIntro h2 { font-size: 1.8rem; }
    .OtherServicesTitle { font-size: 1.5rem; }
}
@media (max-width: 575px) {
    .page-header { height: 320px; }
}
