/* =========================================================
   RESET
   STRUTTURA COMUNE A TUTTE LE PAGINE
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #f4f7fb;
    overflow-x: hidden;
}


/* =========================================================
   VARIABILI GLOBALI
========================================================= */

:root {
    --primary: #0a2540;
    --primary-blue: #004080;
    --accent: #00b4d8;
    --accent-blue: #007bff;
    --footer-blue: #0a1f44;
    --accent-red: #b30000;

    --text-soft: rgba(255, 255, 255, 0.75);
    --text-faded: rgba(255, 255, 255, 0.55);
}


/* =========================================================
   HEADER PRINCIPALE
========================================================= */

.site-header {
    position: relative;
    width: 100%;
    z-index: 1000;
}


/* =========================================================
   HEADER IMAGE
========================================================= */

.header-image {
    position: relative;
    width: 100%;
    overflow: visible;
    line-height: 0;
}

.header-image > img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}


/* =========================================================
   DESKTOP
   1024 PX IN SU
========================================================= */

@media (min-width: 1024px) {

    .header-image {
        height: 380px;
        overflow: hidden;
    }

    .header-image > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }
}


/* =========================================================
   TABLET
   768 - 1023 PX
========================================================= */

@media (min-width: 768px) and (max-width: 1023px) {

    .header-image {
        height: 330px;
        overflow: visible;
    }

    .header-image > img {
        width: 100%;
        height: 330px;
        object-fit: cover;
        object-position: center center;
    }
}


/* =========================================================
   ELEMENTI MOBILE NASCOSTI DI DEFAULT
========================================================= */

.mobile-header,
.mobile-menu-header,
.mobile-menu-logo {
    display: none;
}


/* =========================================================
   NAVIGAZIONE DESKTOP
========================================================= */

.site-header nav {
    position: relative;
    z-index: 20;

    width: 100%;
    padding: 10px 20px;

    background: rgba(5, 25, 55, 0.82);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border-top: 1px solid rgba(255, 255, 255, 0.18);

    margin: 0;
}


/* =========================================================
   MENU PRINCIPALE
========================================================= */

.site-header .menu {
    list-style: none;

    display: flex;
    justify-content: center;
    align-items: center;

    gap: 25px;

    margin: 0;
    padding: 0;
}

.site-header .menu li {
    position: relative;
}


/* =========================================================
   LINK MENU PRINCIPALE
========================================================= */

.site-header .menu > li > a {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;
    padding: 3px 2px;

    color: #fff;
    text-decoration: none;

    font-weight: 600;
    font-size: 0.86rem;

    transition: color 0.3s ease;
}

.site-header .menu > li > a:hover {
    color: var(--accent);
}


/* =========================================================
   FRECCIA SUBMENU
========================================================= */

.site-header .arrow {
    font-size: 9px;
    transition: transform 0.3s ease;
}

.site-header .has-submenu:hover > a .arrow,
.site-header .has-submenu.open > a .arrow {
    transform: rotate(180deg);
}


/* =========================================================
   SUBMENU DESKTOP
========================================================= */

.site-header .submenu {
    display: none;

    position: absolute;

    top: calc(100% + 5px);
    left: 50%;

    transform: translateX(-50%);

    min-width: 210px;

    margin: 0;
    padding: 5px 0;

    list-style: none;

    background: rgba(255, 255, 255, 0.98);

    border-radius: 8px;
    border-top: 3px solid var(--primary-blue);

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);

    z-index: 2000;
}


/* =========================================================
   PONTE INVISIBILE DESKTOP
========================================================= */

.site-header .has-submenu::after {
    content: "";

    position: absolute;

    top: 100%;
    left: 0;

    width: 100%;
    height: 8px;

    background: transparent;

    z-index: 1999;
}


/* =========================================================
   APERTURA SUBMENU CON MOUSE
========================================================= */

@media (hover: hover) and (pointer: fine) {

    .site-header .has-submenu:hover > .submenu {
        display: block;
    }
}


/* =========================================================
   APERTURA SUBMENU JAVASCRIPT
========================================================= */

.site-header .has-submenu.open > .submenu {
    display: block;
}


/* =========================================================
   LINK SUBMENU DESKTOP
========================================================= */

.site-header .submenu li {
    width: 100%;
    border: none;
}

.site-header .submenu li a {
    display: block;

    width: 100%;
    padding: 10px 16px;

    color: var(--primary-blue);
    background: transparent;

    text-decoration: none;

    font-size: 0.82rem;
    font-weight: 600;

    text-align: left;
    white-space: nowrap;

    transition:
        background 0.25s ease,
        color 0.25s ease;
}

.site-header .submenu li a:hover {
    background: #f1f5f9;
    color: var(--accent-blue);
}


/* =========================================================
   HAMBURGER
========================================================= */

.site-header .menu-toggle {
    display: none;

    position: relative;
    z-index: 5000;

    background: rgba(5, 25, 55, 0.88);

    border: 1px solid rgba(255, 255, 255, 0.30);

    color: #fff;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    padding: 8px 15px;

    border-radius: 8px;

    margin: 15px auto;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.site-header .menu-toggle:hover {
    background: rgba(0, 64, 128, 0.95);
    transform: scale(1.04);
}

.site-header .menu-toggle:focus,
.site-header .menu-toggle:focus-visible {
    outline: none;
}


/* =========================================================
   MENU LATERALE TABLET
   768 - 1023 PX
========================================================= */

@media (min-width: 768px) and (max-width: 1023px) {

    .site-header .menu-toggle {
        display: flex;

        align-items: center;
        justify-content: center;

        position: absolute;

        top: 20px;
        right: 20px;

        margin: 0;

        width: 52px;
        height: 52px;

        font-size: 25px;

        border-radius: 10px;
    }

    #nav {
        display: block;

        position: fixed;

        top: 0;
        left: 0;

        width: 360px;
        max-width: 85vw;
        height: 100vh;

        background: #fff;

        z-index: 10000;

        overflow-y: auto;
        overflow-x: hidden;

        transform: translateX(-100%);
        visibility: hidden;

        transition:
            transform 0.35s ease,
            visibility 0.35s ease;

        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.20);

        padding: 0;
        margin: 0;

        border: none;
    }

    #nav.active {
        transform: translateX(0);
        visibility: visible;
    }

    #nav .mobile-menu-header {
        display: flex;

        position: relative;

        width: 100%;
        height: 120px;

        align-items: center;
        justify-content: center;

        background: #fff;

        border-bottom: 3px solid transparent;

        border-image: linear-gradient(
            to right,
            #009246 0%,
            #009246 33.33%,
            #fff 33.33%,
            #fff 66.66%,
            #ce2b37 66.66%,
            #ce2b37 100%
        ) 1;
    }

    #nav .mobile-menu-logo {
        display: flex;

        align-items: center;
        justify-content: center;

        width: 100%;
        height: 100%;

        text-decoration: none;
    }

    #nav .mobile-menu-logo img {
        display: block;

        width: auto;
        height: 105px;
        max-width: 210px;

        object-fit: contain;
    }

    #nav .mobile-menu-close {
        position: absolute;

        top: 15px;
        right: 15px;

        width: 42px;
        height: 42px;

        display: flex;

        align-items: center;
        justify-content: center;

        border: none;

        background: #f3f6f9;
        color: #004080;

        border-radius: 50%;

        font-size: 21px;

        cursor: pointer;

        z-index: 10;

        transition:
            background 0.2s ease,
            color 0.2s ease,
            transform 0.2s ease;
    }

    #nav .mobile-menu-close:hover {
        background: #004080;
        color: #fff;
        transform: rotate(90deg);
    }

    #nav .mobile-menu-close:focus,
    #nav .mobile-menu-close:focus-visible {
        outline: none;
    }

    #nav .menu {
        display: flex;

        flex-direction: column;
        align-items: stretch;

        width: 100%;

        margin: 0;
        padding: 0 0 30px;

        gap: 0;
    }

    #nav .menu > li {
        width: 100%;
        margin: 0;

        border-bottom: 1px solid #edf1f5;
    }

    #nav .menu > li > a {
        display: flex;

        align-items: center;
        justify-content: space-between;

        width: 100%;
        min-height: 58px;

        padding: 16px 24px;

        color: #004080;
        background: #fff;

        text-decoration: none;

        font-size: 0.95rem;
        font-weight: 700;

        transition:
            background 0.2s ease,
            color 0.2s ease;
    }

    #nav .menu > li > a:hover {
        background: #f5f8fb;
        color: #d32f2f;
    }

    #nav .arrow {
        font-size: 11px;
        transition: transform 0.3s ease;
    }

    #nav .has-submenu.open > a .arrow {
        transform: rotate(180deg);
    }

    #nav .submenu {
        position: static;

        display: block;

        width: 100%;
        min-width: 0;

        max-height: 0;

        overflow: hidden;

        padding: 0;
        margin: 0;

        background: #f7f9fb;

        border: none;
        border-radius: 0;

        box-shadow: none;

        transform: none;

        transition: max-height 0.3s ease;
    }

    #nav .has-submenu.open .submenu {
        max-height: 500px;
    }

    #nav .submenu li {
        width: 100%;
        border-top: 1px solid #e9edf1;
    }

    #nav .submenu li a {
        display: block;

        width: 100%;

        padding: 15px 24px 15px 42px;

        color: #555;
        background: #f7f9fb;

        text-decoration: none;

        font-size: 0.85rem;
        font-weight: 600;

        white-space: normal;

        transition:
            background 0.2s ease,
            color 0.2s ease,
            padding-left 0.2s ease;
    }

    #nav .submenu li a:hover {
        background: #eef3f7;
        color: #004080;
        padding-left: 47px;
    }

    #nav .has-submenu::after {
        display: none;
    }

    #nav::after {
        content: "";

        position: fixed;

        top: 0;
        left: 100%;

        width: 100vw;
        height: 100vh;

        background: rgba(0, 0, 0, 0.40);

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        transition:
            opacity 0.35s ease,
            visibility 0.35s ease;
    }

    #nav.active::after {
        opacity: 1;
        visibility: visible;
    }
}


/* =========================================================
   FOOTER
========================================================= */

footer {
    background: #343a40;
    color: #fff;
    margin-top: 60px;
}

.footer-top {
    max-width: 1200px;

    margin: auto;
    padding: 50px 20px;

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 30px;

    text-align: center;
}

.footer-top h5 {
    font-size: 1rem;
    margin-bottom: 15px;

    border-left: 3px solid var(--accent-red);

    padding-left: 10px;

    display: inline-block;
}

.footer-top ul {
    list-style: none;
}

.footer-top li {
    margin-bottom: 10px;
}

.footer-top a {
    color: var(--text-soft);

    text-decoration: none;

    font-size: 0.9rem;

    transition: color 0.3s ease;
}

.footer-top a:hover {
    color: #fff;
}

.footer-divider {
    width: 90%;
    height: 1px;

    margin: auto;

    background: rgba(255, 255, 255, 0.15);

    border: none;
}

.footer-bottom {
    max-width: 1200px;

    margin: auto;
    padding: 40px 20px;

    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 30px;

    flex-wrap: nowrap;
}

.footer-left {
    display: flex;

    align-items: center;

    gap: 20px;
}

.footer-left img {
    width: 140px;
    height: auto;
}

.footer-contact p {
    font-size: 0.9rem;

    color: var(--text-soft);

    margin: 5px 0;
}

.footer-contact a {
    color: #fff;

    text-decoration: none;

    transition: color 0.3s ease;
}

.footer-contact a:hover {
    color: var(--accent-red);
}

.footer-right {
    text-align: center;

    display: flex;

    flex-direction: column;

    gap: 10px;
}

.footer-right h5 {
    border: none;
    margin-bottom: 8px;
}

.social {
    display: flex;

    justify-content: center;

    gap: 15px;
}

.social img {
    width: 38px;
    height: 38px;

    transition: transform 0.3s ease;
}

.social img:hover {
    transform: scale(1.2);
}

.footer-legal {
    display: flex;

    justify-content: center;

    gap: 12px;
}

.footer-legal a {
    font-size: 0.85rem;

    color: var(--text-soft);

    text-decoration: none;

    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: #fff;
}

.copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.icon-credits {
    margin-top: 2px;

    font-size: 0.65rem;

    color: rgba(255, 255, 255, 0.25);

    line-height: 1.2;

    text-align: center;
}

.icon-credits a {
    color: rgba(255, 255, 255, 0.18);
    text-decoration: none;
}

.icon-credits a:hover {
    color: rgba(255, 255, 255, 0.45);
}


/* =========================================================
   FOOTER TABLET
========================================================= */

@media (max-width: 1024px) {

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}


/* =========================================================
   HEADER + MENU MOBILE
   FINO A 767 PX
========================================================= */

@media (max-width: 767px) {

    .header-image {
        display: none;
    }

    .mobile-header {
        display: grid;

        grid-template-columns: 55px 1fr 75px;

        align-items: center;

        width: 100%;
        height: 100px;

        padding: 0 12px;

        background: #fff;

        position: relative;
        z-index: 100;

        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);

        border-bottom: 3px solid transparent;

        border-image: linear-gradient(
            to right,
            #009246 0%,
            #009246 33.33%,
            #fff 33.33%,
            #fff 66.66%,
            #ce2b37 66.66%,
            #ce2b37 100%
        ) 1;
    }

    .mobile-menu-toggle {
        width: 42px;
        height: 42px;

        display: flex;

        align-items: center;
        justify-content: center;

        border: none;

        background: transparent;
        color: #004080;

        font-size: 22px;

        cursor: pointer;

        padding: 0;

        border-radius: 8px;

        transition:
            background 0.2s ease,
            color 0.2s ease;
    }

    .mobile-menu-toggle:hover {
        background: #f2f5f8;
    }

    .mobile-menu-toggle:focus,
    .mobile-menu-toggle:focus-visible {
        outline: none;
    }

    .mobile-logo {
        display: flex;

        align-items: center;
        justify-content: center;

        width: 100%;
        height: 100%;

        text-decoration: none;
    }

    .mobile-logo img {
        display: block;

        width: auto;
        height: 100px;
        max-width: 180px;

        object-fit: contain;
    }

    .mobile-social {
        display: flex;

        align-items: center;
        justify-content: flex-end;

        gap: 8px;
    }

    .mobile-social a {
        width: 30px;
        height: 30px;

        display: flex;

        align-items: center;
        justify-content: center;

        color: #004080;
        background: #f3f6f9;

        border-radius: 50%;

        text-decoration: none;

        font-size: 14px;

        transition:
            background 0.2s ease,
            color 0.2s ease,
            transform 0.2s ease;
    }

    .mobile-social a:hover {
        background: #004080;
        color: #fff;
        transform: translateY(-2px);
    }

    #nav {
        display: block;

        position: fixed;

        top: 0;
        left: 0;

        width: 82%;
        max-width: 340px;
        height: 100vh;

        z-index: 10000;

        background: #fff;

        overflow-y: auto;
        overflow-x: hidden;

        transform: translateX(-100%);
        visibility: hidden;

        transition:
            transform 0.35s ease,
            visibility 0.35s ease;

        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);

        padding: 0;
        margin: 0;

        border: none;
    }

    #nav.active {
        transform: translateX(0);
        visibility: visible;
    }

    #nav .mobile-menu-header {
        position: relative;

        width: 100%;
        height: 100px;

        display: flex;

        align-items: center;
        justify-content: center;

        background: #fff;

        border-bottom: 3px solid transparent;

        border-image: linear-gradient(
            to right,
            #009246 0%,
            #009246 33.33%,
            #fff 33.33%,
            #fff 66.66%,
            #ce2b37 66.66%,
            #ce2b37 100%
        ) 1;
    }

    #nav .mobile-menu-logo {
        display: flex;

        align-items: center;
        justify-content: center;

        width: 100%;
        height: 100%;

        text-decoration: none;
    }

    #nav .mobile-menu-logo img {
        display: block;

        width: auto;
        height: 90px;
        max-width: 170px;

        object-fit: contain;
    }

    #nav .mobile-menu-close {
        position: absolute;

        top: 15px;
        right: 15px;

        width: 38px;
        height: 38px;

        display: flex;

        align-items: center;
        justify-content: center;

        border: none;

        background: #f3f6f9;
        color: #004080;

        border-radius: 50%;

        font-size: 20px;

        cursor: pointer;

        z-index: 10;

        transition:
            background 0.2s ease,
            color 0.2s ease,
            transform 0.2s ease;
    }

    #nav .mobile-menu-close:hover {
        background: #004080;
        color: #fff;
        transform: rotate(90deg);
    }

    #nav .mobile-menu-close:focus,
    #nav .mobile-menu-close:focus-visible {
        outline: none;
    }

    #nav .menu {
        display: flex;

        flex-direction: column;
        align-items: stretch;

        width: 100%;

        margin: 0;
        padding: 0 0 30px;

        list-style: none;

        gap: 0;
    }

    #nav .menu > li {
        width: 100%;
        margin: 0;

        border-bottom: 1px solid #edf1f5;
    }

    #nav .menu > li > a {
        display: flex;

        align-items: center;
        justify-content: space-between;

        width: 100%;
        min-height: 52px;

        padding: 15px 22px;

        color: #004080;
        background: #fff;

        text-decoration: none;

        font-size: 0.9rem;
        font-weight: 700;

        transition:
            background 0.2s ease,
            color 0.2s ease;
    }

    #nav .menu > li > a:hover {
        background: #f5f8fb;
        color: #d32f2f;
    }

    #nav .arrow {
        font-size: 11px;
        transition: transform 0.3s ease;
    }

    #nav .has-submenu.open > a .arrow {
        transform: rotate(180deg);
    }

    #nav .submenu {
        position: static;

        display: block;

        width: 100%;
        min-width: 0;

        max-height: 0;

        overflow: hidden;

        padding: 0;
        margin: 0;

        list-style: none;

        background: #f7f9fb;

        border: none;
        border-radius: 0;

        box-shadow: none;

        transform: none;

        transition: max-height 0.3s ease;
    }

    #nav .has-submenu.open .submenu {
        max-height: 500px;
    }

    #nav .submenu li {
        width: 100%;
        border-top: 1px solid #e9edf1;
    }

    #nav .submenu li a {
        display: block;

        width: 100%;

        padding: 14px 22px 14px 38px;

        color: #555;
        background: #f7f9fb;

        text-decoration: none;

        font-size: 0.82rem;
        font-weight: 600;

        border: none;

        white-space: normal;

        transition:
            background 0.2s ease,
            color 0.2s ease,
            padding-left 0.2s ease;
    }

    #nav .submenu li a:hover {
        background: #eef3f7;
        color: #004080;
        padding-left: 43px;
    }

    #nav .has-submenu::after {
        display: none;
    }

    #nav::after {
        content: "";

        position: fixed;

        top: 0;
        left: 100%;

        width: 100vw;
        height: 100vh;

        background: rgba(0, 0, 0, 0.40);

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        transition:
            opacity 0.35s ease,
            visibility 0.35s ease;
    }

    #nav.active::after {
        opacity: 1;
        visibility: visible;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-left {
        flex-direction: column;
    }

    .social img {
        width: 32px;
        height: 32px;
    }
}


/* =========================================================
   MOBILE PICCOLO
   MAX 400 PX
========================================================= */

@media (max-width: 400px) {

    .mobile-header {
        grid-template-columns: 50px 1fr 70px;

        height: 90px;

        padding: 0 8px;
    }

    .mobile-logo img {
        height: 90px;
        max-width: 170px;
    }

    .mobile-menu-toggle {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .mobile-social {
        gap: 5px;
    }

    .mobile-social a {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    #nav .mobile-menu-header {
        height: 90px;
    }

    #nav .mobile-menu-logo img {
        height: 82px;
        max-width: 160px;
    }

    #nav .mobile-menu-close {
        top: 12px;
        right: 12px;

        width: 36px;
        height: 36px;

        font-size: 19px;
    }

    #nav {
        width: 86%;
        max-width: 330px;
    }
}