:root { 
    --primary-navy: #0d3173; 
    --accent-green: #008C45; 
    --accent-red: #CD212A; 
    --text-dark: #2C3E50; 
    --text-light: #596A7A; 
    --bg-light: #F4F7F6; 
    --white: #FFFFFF; 
    --font-heading: 'Playfair Display', serif; 
    --font-body: 'Montserrat', sans-serif; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: var(--font-body); 
    color: var(--text-dark); 
    line-height: 1.7; 
    background-color: var(--white); 
    -webkit-font-smoothing: antialiased; 
}

h1, h2, h3, h4, h5, h6 { 
    font-family: var(--font-heading); 
    color: var(--primary-navy); 
    margin-bottom: 15px; 
    line-height: 1.3; 
}

a { 
    text-decoration: none; 
    color: var(--primary-navy); 
    transition: all 0.3s ease; 
}

.container { 
    width: 90%; 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* Bottoni */
.btn { 
    display: inline-block; 
    padding: 14px 28px; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    border-radius: 4px; 
    font-size: 0.9rem; 
    cursor: pointer; 
    transition: 0.3s ease; 
    text-align: center; 
}
.btn-primary { 
    background-color: var(--primary-navy); 
    color: var(--white); 
    border: 2px solid var(--primary-navy); 
    box-shadow: 0 4px 6px rgba(13,49,115,0.2); 
}
.btn-primary:hover { 
    background-color: var(--white); 
    color: var(--primary-navy); 
    box-shadow: 0 6px 12px rgba(13,49,115,0.15); 
    transform: translateY(-2px); 
}
.btn-outline { 
    background-color: transparent; 
    color: var(--primary-navy); 
    border: 2px solid var(--primary-navy); 
}
.btn-outline:hover { 
    background-color: var(--primary-navy); 
    color: var(--white); 
    transform: translateY(-2px); 
    box-shadow: 0 4px 6px rgba(13,49,115,0.2); 
}

/* Header */
.main-header { 
    background: var(--white); 
    box-shadow: 0 2px 15px rgba(0,0,0,0.06); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}
.header-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 95px; 
}
.logo img { 
    max-height: 65px; 
    transition: 0.3s; 
}
.logo img:hover { 
    opacity: 0.9; 
}
.main-nav ul { 
    list-style: none; 
    display: flex; 
    gap: 25px; 
}
.main-nav a { 
    font-weight: 600; 
    font-size: 0.95rem; 
    color: var(--text-dark); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.main-nav a:hover { 
    color: var(--accent-green); 
}

/* Elementi Comuni */
.tricolor-line { 
    height: 5px; 
    background: linear-gradient(90deg, var(--accent-green) 33.3%, var(--white) 33.3%, var(--white) 66.6%, var(--accent-red) 66.6%); 
}
.section-padding { 
    padding: 90px 0; 
}
.text-center { 
    text-align: center; 
}
.section-title { 
    font-size: 2.8rem; 
    position: relative; 
    padding-bottom: 20px; 
    margin-bottom: 50px; 
    font-weight: 700; 
}
.section-title::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 70px; 
    height: 3px; 
    background-color: var(--accent-green); 
}

/* Hero Sections */
.hero { 
    background: #0D3173; 
    color: var(--white); 
    padding: 140px 0; 
    text-align: center; 
}
.hero h1 { 
    color: var(--white); 
    font-size: 4rem; 
    margin-bottom: 25px; 
    font-weight: 700; 
    font-style: italic; 
    line-height: 1.2; 
}
.hero p { 
    font-size: 1.3rem; 
    max-width: 750px; 
    margin: 0 auto 40px auto; 
    font-family: var(--font-body); 
    font-weight: 300; 
    opacity: 0.9; 
}
.hero .btn-primary {
    background-color: rgba(7, 24, 58, 0.42);
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.88);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.hero .btn-primary:hover {
    background-color: var(--white);
    color: var(--primary-navy);
    border-color: var(--white);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.hero .btn-outline {
    color: var(--white);
    border-color: rgba(255,255,255,0.88);
    background: rgba(7, 24, 58, 0.14);
}
.hero .btn-outline:hover {
    background-color: var(--white);
    color: var(--primary-navy);
    border-color: var(--white);
}
.inner-hero { 
    background: var(--primary-navy); 
    color: var(--white); 
    padding: 90px 0 60px; 
    text-align: center; 
}
.inner-hero h1 { 
    color: var(--white); 
    font-size: 3rem; 
    margin-bottom: 15px; 
    font-style: italic; 
}
.inner-hero p { 
    font-family: var(--font-body); 
    font-size: 1.2rem; 
    color: #e0e0e0; 
    font-weight: 300;
}

/* Griglie e Card */
.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 40px; 
}
.card-valore { 
    padding: 50px 35px; 
    background: var(--white); 
    border-radius: 8px; 
    border-bottom: 4px solid var(--primary-navy); 
    text-align: center; 
    transition: 0.4s ease; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
}
.card-valore h3 { 
    font-size: 1.6rem; 
    margin-bottom: 20px; 
}
.card-valore p { 
    color: var(--text-light); 
}
.card-valore:hover { 
    transform: translateY(-12px); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
    border-color: var(--accent-green); 
}

/* Box di Contenuto */
.content-box { 
    background: var(--white); 
    padding: 50px; 
    border-radius: 8px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    margin-bottom: 35px; 
    border: 1px solid #f0f0f0; 
}
.content-box h3 { 
    border-bottom: 2px solid var(--accent-green); 
    padding-bottom: 15px; 
    display: inline-block; 
    margin-bottom: 20px; 
    font-size: 1.8rem;
}
.check-list { 
    list-style: none; 
    margin-top: 25px; 
}
.check-list li { 
    position: relative; 
    padding-left: 35px; 
    margin-bottom: 18px; 
    font-size: 1.1rem; 
    color: var(--text-light); 
}
.check-list li::before { 
    content: '✓'; 
    position: absolute; 
    left: 0; 
    color: var(--accent-green); 
    font-weight: bold; 
    font-size: 1.2rem; 
}

/* Pricing */
.pricing-wrapper { 
    display: flex; 
    justify-content: center; 
    gap: 50px; 
    flex-wrap: wrap; 
    margin-top: 50px; 
}
.pricing-card { 
    background: var(--white); 
    border: 1px solid #eaeaea; 
    padding: 50px 40px; 
    width: 380px; 
    text-align: center; 
    border-radius: 12px; 
    transition: 0.4s; 
    position: relative; 
    overflow: hidden; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.03); 
}
.pricing-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 20px 40px rgba(0,43,91,0.1); 
    border-color: var(--primary-navy); 
}
.pricing-card.premium { 
    border: 2px solid var(--primary-navy); 
}
.pricing-card.premium::before { 
    content: 'Più Scelta'; 
    position: absolute; 
    top: 20px; 
    right: -40px; 
    background: var(--accent-red); 
    color: white; 
    padding: 8px 45px; 
    transform: rotate(45deg); 
    font-size: 0.85rem; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: 1px;
}
.price { 
    font-size: 3.5rem; 
    font-family: var(--font-heading); 
    color: var(--primary-navy); 
    font-weight: bold; 
    margin: 25px 0; 
}
.price span { 
    font-size: 1.2rem; 
    color: var(--text-light); 
    font-family: var(--font-body); 
    font-weight: normal; 
}
.pricing-card ul { 
    text-align: left; 
    margin: 30px 0; 
    border-top: 1px solid #eee; 
    padding-top: 20px; 
}

/* Form */
.form-group { 
    margin-bottom: 25px; 
    text-align: left; 
}
.form-group label { 
    display: block; 
    margin-bottom: 10px; 
    font-weight: 600; 
    font-size: 0.95rem; 
    color: var(--primary-navy); 
}
.form-control { 
    width: 100%; 
    padding: 14px 18px; 
    border: 1px solid #dcdcdc; 
    border-radius: 6px; 
    font-family: var(--font-body); 
    font-size: 1rem; 
    transition: 0.3s; 
    background-color: #fafafa; 
}
.form-control:focus { 
    border-color: var(--primary-navy); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(0,43,91,0.1); 
    background-color: var(--white); 
}
textarea.form-control { 
    resize: vertical; 
    min-height: 140px; 
}

/* Footer Corretto e Riallineato */
.main-footer { 
    background-color: var(--bg-light); 
    margin-top: 60px; 
}

.footer-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; /* Allinea tutto perfettamente in alto */
    flex-wrap: wrap; 
    gap: 50px; 
    padding: 70px 0 50px; /* Aumentato il respiro dal tricolore */
}

.footer-col { 
    flex: 1; 
    min-width: 250px; 
}

.footer-logo { 
    max-height: 85px; 
    margin-bottom: 25px; 
    display: block; 
}

.footer-col p { 
    color: var(--text-light); 
    font-size: 0.95rem; 
    line-height: 1.7; 
    margin-bottom: 10px; 
}

/* Titoli colonne resi moderni e allineati visivamente al logo */
.footer-col h4 { 
    font-family: var(--font-body); /* Font moderno, non graziato */
    font-weight: 700; 
    color: var(--primary-navy); 
    margin-top: 15px; /* Spinge i titoli giù per allinearli al centro del logo */
    margin-bottom: 25px; 
    font-size: 1.1rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.footer-col ul { 
    list-style: none; 
}
.footer-col ul li { 
    margin-bottom: 15px; 
}

.footer-col ul li a { 
    color: var(--text-light); 
    font-size: 0.95rem; 
    transition: 0.3s ease; 
}

.footer-col ul li a:hover { 
    color: var(--accent-green); 
    padding-left: 6px; /* Effetto slittamento elegante */
    font-weight: 600; 
}

.footer-bottom { 
    background-color: var(--primary-navy); 
    color: var(--white); 
    text-align: center; 
    padding: 20px 0; 
    font-size: 0.85rem; 
    letter-spacing: 0.5px;
}
/* =========================================
   RESPONSIVE DESIGN & MOBILE MENU
   ========================================= */

/* Impostazioni base Header CTA per Desktop */
.header-nav-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
}
.main-nav { margin-right: 30px; }
.header-cta { display: flex; align-items: center; }
.header-link-text { margin-right: 25px; font-weight: 700; font-size: 0.95rem; color: var(--primary-navy); text-transform: uppercase;}
.header-link-text.highlight { color: var(--accent-green); }
.btn-esci { border-color: #CD212A; color: #CD212A; padding: 10px 18px; }
.mobile-menu-toggle { display: none; } /* Nascosto su PC */

/* Adattamenti generici per Tablet/Smartphone */
@media (max-width: 992px) {
    /* 1. Sistemazione Griglie Generali e Testi */
    .hero h1 { font-size: 2.8rem; }
    .hero p { font-size: 1.1rem; }
    .section-title { font-size: 2.2rem; }
    .pricing-wrapper { flex-direction: column; align-items: center; }
    .pricing-card { width: 100%; max-width: 400px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group[style*="grid-column: span 2"] { grid-column: span 1 !important; }
    .grid-3 { grid-template-columns: 1fr; }

    /* 2. Hamburger Menu */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 32px;
        height: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001; /* Sopra il menu a tendina */
    }
    
    .mobile-menu-toggle span {
        width: 100%;
        height: 3px;
        background-color: var(--primary-navy);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* Animazione "X" quando è aperto */
    .mobile-menu-toggle.active span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

    /* 3. Comportamento del Menu a Tendina */
    .header-nav-wrapper {
        position: fixed;
        top: 95px; /* Sotto l'header */
        left: -100%; /* Nascosto fuori dallo schermo */
        width: 100%;
        height: calc(100vh - 95px);
        background-color: var(--white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 40px 5%;
        transition: left 0.3s ease; /* Effetto scivolamento */
        overflow-y: auto;
        box-shadow: inset 0 10px 10px -10px rgba(0,0,0,0.1);
    }

    .header-nav-wrapper.active {
        left: 0; /* Entra nello schermo */
    }

    /* Voci del menu interno */
    .main-nav { width: 100%; margin-right: 0; margin-bottom: 30px; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav a { 
        font-size: 1.2rem; 
        display: block; 
        padding: 15px 0; 
        border-bottom: 1px solid #f0f0f0; 
    }

    /* Bottoni Mobile */
    .header-cta { width: 100%; flex-direction: column; align-items: stretch; gap: 15px; }
    .header-link-text { margin-right: 0; padding: 15px 0; border-bottom: 1px solid #f0f0f0; font-size: 1.2rem; }
    .header-cta .btn { width: 100%; text-align: center; }
}

/* Fix per schermi piccolissimi */
@media (max-width: 480px) {
    .header-container { height: 80px; }
    .header-nav-wrapper { top: 80px; height: calc(100vh - 80px); }
    .logo img { max-height: 50px; }
}
/* Performance: il browser può rimandare il rendering del footer finché non entra vicino al viewport. */
@supports (content-visibility: auto) {
    .main-footer {
        content-visibility: auto;
        contain-intrinsic-size: 600px;
    }
}

/* =========================================================
   FIX HEADER / LOGO / RESPONSIVE - v5
   ========================================================= */
.main-header .header-container {
    width: min(96%, 1500px);
    max-width: 1500px;
    height: 96px;
    gap: 24px;
}
.logo {
    flex: 0 0 auto;
    line-height: 0;
}
.logo a,
.logo picture {
    display: block;
    line-height: 0;
}
.logo img {
    display: block;
    width: auto;
    height: 76px;
    max-width: 110px;
    max-height: none;
    object-fit: contain;
}
.header-nav-wrapper {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}
.main-nav {
    margin-right: clamp(18px, 2vw, 34px);
    min-width: 0;
}
.main-nav ul {
    gap: clamp(14px, 1.55vw, 28px);
    align-items: center;
}
.main-nav li,
.main-nav a,
.header-link-text,
.header-cta .btn {
    white-space: nowrap;
}
.main-nav a {
    font-size: clamp(.82rem, .82vw, .94rem);
    line-height: 1.2;
}
.header-cta {
    flex: 0 0 auto;
    gap: 18px;
}
.header-link-text {
    margin-right: 0;
    font-size: .9rem;
}
.header-cta .btn {
    padding: 13px 22px;
}
.footer-logo {
    width: auto;
    height: 88px;
    max-height: none;
    object-fit: contain;
}

/* Elementi form e stato Capitani */
.form-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.quota-box {
    background: #f4f7f6;
    padding: 20px;
    border-radius: 7px;
}
.radio-line {
    display: block !important;
    cursor: pointer;
    margin-bottom: 12px !important;
}
.radio-line:last-child { margin-bottom: 0 !important; }
.consent-box {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #d9dee3;
    border-radius: 7px;
    background: #fff;
}
.consent-box label,
.confirm-line {
    font-weight: 400 !important;
    cursor: pointer;
    font-size: .95rem;
    display: flex !important;
    align-items: flex-start;
    gap: 11px;
    color: var(--text-dark) !important;
}
.consent-box input[type="checkbox"],
.confirm-line input[type="checkbox"] {
    margin-top: 5px;
    flex: 0 0 auto;
    transform: scale(1.15);
}
.consent-divider { height: 1px; background: #e6e6e6; margin: 16px 0; }
.small-muted { font-size: .86rem; color: var(--text-light); margin-top: 5px; line-height: 1.55; }
.isc-alert {
    padding: 16px 18px;
    border-radius: 7px;
    margin-bottom: 20px;
    line-height: 1.55;
}
.isc-alert-error { background: #ffeded; color: #a61b1b; border: 1px solid #f1b7b7; }
.isc-alert-info { background: #eef6ff; color: #0d3173; border: 1px solid #bfd7ef; }
.isc-alert-success { background: #e9f6ef; color: #176d3c; border: 1px solid #b9dfca; }
.hub-candidate-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, .86fr);
    gap: 55px;
    align-items: start;
}
.existing-member-box {
    background: #f7f3e9;
    border: 1px solid #e1d3ad;
    border-left: 4px solid #B9975B;
    border-radius: 7px;
    padding: 18px;
    margin: 26px 0;
}
.upgrade-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    background: #f7f9fa;
    border: 1px solid #e3e8ec;
    border-radius: 8px;
    padding: 18px;
}
.upgrade-summary div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
}
.upgrade-summary span { font-size: .76rem; text-transform: uppercase; letter-spacing: .8px; color: var(--text-light); }
.upgrade-summary strong { color: var(--primary-navy); }

/* Passaggio al menu mobile prima che il desktop inizi a comprimersi. */
@media (max-width: 1120px) {
    .main-header .header-container {
        width: 92%;
        height: 88px;
        gap: 18px;
    }
    .logo img {
        height: 68px;
        width: auto;
        max-width: 96px;
    }
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 34px;
        height: 24px;
        padding: 0;
        margin-left: auto;
        background: transparent;
        border: 0;
        cursor: pointer;
        z-index: 1003;
        flex: 0 0 auto;
    }
    .mobile-menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--primary-navy);
        border-radius: 3px;
        transition: transform .25s ease, opacity .25s ease;
    }
    .mobile-menu-toggle.active span:nth-child(1) { transform: translateY(10.5px) rotate(45deg); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-10.5px) rotate(-45deg); }

    .header-nav-wrapper {
        position: fixed;
        top: 88px;
        right: 0;
        left: auto;
        width: min(420px, 100%);
        height: calc(100dvh - 88px);
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 28px 6% 36px;
        overflow-y: auto;
        box-shadow: -12px 16px 30px rgba(0,0,0,.13);
        transform: translateX(105%);
        transition: transform .28s ease;
        visibility: hidden;
        pointer-events: none;
    }
    .header-nav-wrapper.active {
        left: auto;
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
    .main-nav { width: 100%; margin: 0 0 24px; }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .main-nav a {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid #edf0f2;
        font-size: 1.02rem;
    }
    .header-cta {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .header-link-text {
        padding: 14px 0;
        border-bottom: 1px solid #edf0f2;
        font-size: 1rem;
    }
    .header-cta .btn { width: 100%; }
    .hub-candidate-layout { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 700px) {
    .main-header .header-container { height: 82px; width: 90%; }
    .logo img { height: 62px; max-width: 88px; }
    .header-nav-wrapper { top: 82px; height: calc(100dvh - 82px); width: 100%; padding: 24px 7% 32px; }
    .hero { padding: 80px 0 88px; }
    .hero h1 { font-size: clamp(2.35rem, 11vw, 3rem); line-height: 1.08; }
    .hero p { font-size: 1rem; line-height: 1.65; }
    .hero .btn {
        display: block;
        width: 100%;
        max-width: 340px;
        margin: 12px auto !important;
    }
    .inner-hero { padding: 64px 0 42px; }
    .inner-hero h1 { font-size: 2.25rem; }
    .section-padding { padding: 60px 0; }
    .section-title { font-size: 2rem; margin-bottom: 32px; }
    .content-box { padding: 28px 20px; }
    .grid-3 { grid-template-columns: 1fr !important; }
    .form-two-cols { grid-template-columns: 1fr; gap: 0; }
    .upgrade-summary { grid-template-columns: 1fr; }
    .footer-logo { height: 80px; width: auto; }
}
