:root {
    --brand-navy: #0b192c;
    /* Navy profondo per sezioni scure */
    --brand-primary: #0f5eb4;
    /* Blu Istituzionale */
    --brand-success: #07c282;
    /* Verde Accento */
    --brand-cyan: #0dcaf0;
    /* Cyan per dettagli */
    --text-dark: #1e2229;
    /* Grigio scuro per testi */
    --text-muted: #626e7f;
    /* Grigio intermedio */
    --bg-neutral: #f4f7fa;
    /* Fondo alternato grigio-azzurro */
    --border-color: #e2e8f0;
    /* Bordi sottili */
    --navbar-height: 76px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- NAVBAR --- */
.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    z-index: 1060;
    height: var(--navbar-height);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-dark) !important;
    font-size: 1.35rem;
}

.navbar-brand span {
    color: var(--brand-primary);
}

.navbar-nav .nav-link {
    color: var(--text-muted) !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1.2rem !important;
    transition: color 0.2s ease, font-weight 0.2s ease;
    position: relative;
}

/* Classe active iniettata dal nostro script custom */
.navbar-nav .nav-link.active {
    color: var(--brand-primary) !important;
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 1.2rem;
    right: 1.2rem;
    height: 2px;
    background-color: var(--brand-primary);
}

/* --- RWD FULL SCREEN MENU --- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--brand-navy);
        z-index: 1050;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .navbar-collapse.show {
        opacity: 0.98;
        visibility: visible;
        display: flex !important;
    }

    .navbar-nav {
        text-align: center;
    }

    .navbar-nav .nav-link {
        font-size: 1.75rem;
        font-weight: 600;
        padding: 1rem !important;
        color: rgba(255, 255, 255, 0.7) !important;
    }

    .navbar-nav .nav-link.active {
        color: var(--brand-cyan) !important;
    }

    .navbar-nav .nav-link.active::after {
        display: none;
    }

    .navbar-toggler {
        z-index: 1100;
        position: relative;
    }
}

/* --- HERO SECTION --- */
.hero-section {
    padding: 140px 0 110px;
    /* Inserito gradiente di overlay scuro per garantire il contrasto del testo + immagine di background */
    background: linear-gradient(135deg, rgba(11, 25, 44, 0.92) 0%, rgba(12, 35, 64, 0.55) 100%), url('../img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffffff;
}

.hero-section h1 {
    font-weight: 800;
    font-size: 3rem;
    line-height: 1.2;
    letter-spacing: -1px;
    color: #ffffff;
}

.hero-section .lead {
    color: #cbd5e1;
    font-size: 1.2rem;
}

.hero-subtext {
    color: #c1d0e4;
    font-size: 1rem;
    border-left: 3px solid var(--brand-primary);
    padding-left: 1.5rem;
}

.btn-premium-primary {
    background-color: var(--brand-primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 2.2rem;
    border-radius: 6px;
    border: none;
    transition: all 0.2s ease;
}

.btn-premium-primary:hover {
    background-color: #136fdf;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-premium-outline {
    background-color: transparent;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 2.2rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.btn-premium-outline:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #ffffff;
    color: #ffffff;
}

/* --- SEZIONI E RITMO --- */
section {
    padding: 110px 0;
}

.bg-section-alternated {
    background-color: var(--bg-neutral);
    background: linear-gradient(135deg, rgba(5, 11, 20, 0.92) 0%, rgba(3, 23, 48, 0.89) 100%), url('../img/chi-siamo-1.jpg');
    .section-title {
        color: #ffffff;
    }
    h4, .text-secondary, h5, .list-unstyled li{
        color: #ffffff!important;
    }
}
.project-container {
    h4, .text-secondary, h5, .list-unstyled li{
        color: #212529!important;
    }
}
.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand-primary);
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-weight: 700;
    font-size: 2.25rem;
    letter-spacing: -0.5px;
    color: var(--text-dark);
    margin-bottom: 35px;
}

/* --- IMAGE CARDS SECTION SUPPORT --- */
.image-card {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 8px;
    height: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.image-card .card-img {
    object-fit: cover;
    height: 100%;
    width: 100%;
    transition: transform 0.3s ease;
}

.image-card .card-img-overlay {
    background: linear-gradient(to top, rgba(11, 25, 44, 0.85) 0%, rgba(15, 94, 180, 0.4) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.25rem;
    transition: background 0.3s ease;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(11, 25, 44, 0.15);
}

.image-card:hover .card-img {
    transform: scale(1.06);
}

.image-card:hover .card-img-overlay {
    background: linear-gradient(to top, rgba(11, 25, 44, 0.95) 0%, rgba(15, 94, 180, 0.5) 100%);
}

.image-card .card-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.3px;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* --- CORPORATE CARDS --- */
.corporate-card {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 2.2rem 2rem;
    height: 100%;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.corporate-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
}

.corporate-card .icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 22px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* Tessere colorate soft */
.card-c1 {
    background-color: #edf5fd;
}

.card-c1 i {
    color: #0f5eb4;
}

.card-c2 {
    background-color: #e6f9f2;
}

.card-c2 i {
    color: #07c282;
}

.card-c3 {
    background-color: #e6faff;
}

.card-c3 i {
    color: #0dcaf0;
}

.card-c4 {
    background-color: #fff9e6;
}

.card-c4 i {
    color: #ffb000;
}

.card-c5 {
    background-color: #fdf0f6;
}

.card-c5 i {
    color: #e83e8c;
}

.card-c6 {
    background-color: #f3effa;
}

.card-c6 i {
    color: #6f42c1;
}

.card-c7 {
    background-color: #fff2eb;
}

.card-c7 i {
    color: #fd7e14;
}

.card-c8 {
    background-color: #e9f8f5;
}

.card-c8 i {
    color: #20c997;
}

/* --- PROGETTO Focus --- */
.project-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.03);
}

.project-meta-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.75rem 2.5rem;
}

.project-body {
    padding: 3.5rem 2.5rem;
}

.partner-tag {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-primary);
    background: rgba(15, 94, 180, 0.06);
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid rgba(15, 94, 180, 0.1);
}

/* --- QUADRO ISTITUZIONALE --- */
.institutional-banner {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    padding: 2.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
}

.inst-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

/* --- CONTATTI --- */
.contact-section {
    background-color: var(--brand-navy);
    color: #ffffff;
    border-top: 3px solid var(--brand-primary);
}

.contact-section .section-title {
    color: #ffffff;
}

.info-block {
    border-left: 3px solid var(--brand-primary);
    padding-left: 1.75rem;
}

/* --- UTILITIES --- */
.italic-quote {
    font-style: italic;
    color: var(--text-dark);
    font-weight: 500;
    border-left: 4px solid var(--brand-cyan);
    padding-left: 1.5rem;
}

#btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    z-index: 1000;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    background-color: var(--brand-primary);
    color: white;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(15, 94, 180, 0.3);
}

#btn-back-to-top:hover {
    background-color: #136fdf;
    transform: translateY(-2px);
}

@media (max-width: 991.98px) {
    section {
        padding: 80px 0;
    }

    .hero-section {
        padding: 120px 0 80px;
    }

    .hero-section h1 {
        font-size: 2.3rem;
    }

    .project-body {
        padding: 2.5rem 1.5rem;
    }

    .project-meta-header {
        padding: 1.5rem;
    }
}