
:root {
    /* Palette Colori */
    --red: #b32017;
    --red-hover: #8e1912;
    --blue-aruba: #0070ba;
    --blue-hover: #005a96;
    --dark: #2c3e50;
    --text-main: #333333;
    --light: #f8f9fa;
    --border: #e9ecef;
    --white: #ffffff;

    /* Effetti */
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.08);
    --transition: 0.3s ease;
}

 /* =========================================
       NUOVO AVVISO URGENTE (STICKY BAR)
    ========================================= */
    .urgent-announcement {
        background: #e74c3c;
        color: white;
        text-align: center;
        padding: 12px 20px;
        font-weight: 700;
        position: sticky;
        top: 0;
        z-index: 9999;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        text-decoration: none;
        transition: background 0.3s ease;
        animation: pulse-red 2s infinite;
    }

    .urgent-announcement:hover {
        background: #c0392b;
    }

    .urgent-announcement i {
        font-size: 1.2rem;
    }

    .urgent-announcement .btn-info {
        background: white;
        color: #e74c3c;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 0.85rem;
        text-transform: uppercase;
        margin-left: 10px;
    }

    @keyframes pulse-red {
        0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
        70% { box-shadow: 0 0 0 15px rgba(231, 76, 60, 0); }
        100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
    }

    @media (max-width: 600px) {
        .urgent-announcement { font-size: 0.9rem; flex-direction: column; gap: 5px; }
        .urgent-announcement .btn-info { margin-left: 0; }
    }

/* =========================================
   1. RESET E IMPOSTAZIONI BASE
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--white);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main, 
.container, 
.services-section { 
    margin-top: 40px; 
}

/* =========================================
   2. HEADER E NAVIGAZIONE
========================================= */
.main-header {
    width: 100%;
    background-color: var(--white);
    border-bottom: 4px solid var(--red);
    padding: 10px 0;
    position: relative;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area img {
    height: 110px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}


.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    padding: 12px 18px;
    border-radius: 12px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: transparent;
}

.nav-link:hover {
    background: var(--light);
    border-color: #eee;
}

.btn-contact-nav:hover { color: var(--dark); border-bottom: 2px solid var(--dark); }
.btn-guide-nav:hover { color: #00897b; border-bottom: 2px solid #00897b; }
.btn-pec-nav:hover { color: var(--blue-aruba); border-bottom: 2px solid var(--blue-aruba); }
.btn-fe-nav:hover { color: var(--red); border-bottom: 2px solid var(--red); }

.contact-icon-minimal {
    display: none;
}
.menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--dark);
    cursor: pointer;
}

/* =========================================
   3. BOTTONI GLOBALI
========================================= */
.btn-quick {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px 20px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--white);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: 0.5px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-quick:focus-visible {
    outline: 3px solid var(--dark);
    outline-offset: 2px;
}

.btn-contact { background: var(--dark); }
.btn-contact:hover { background: #333; transform: translateY(-3px); }

.btn-pec { background: var(--blue-aruba); }
.btn-pec:hover { background: var(--blue-hover); transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.btn-fe { background: var(--red); }
.btn-fe:hover { background: var(--red-hover); transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.btn-guide { background: #00897b; }
.btn-guide:hover { background: #00695c; transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* =========================================
   4. STRUTTURA PRINCIPALE E GRIGLIA
========================================= */
.main-container {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.cards-hint {
    text-align: center;
    font-size: 13px;
    color: #888;
    margin-bottom: -15px; /* Avvicina la scritta alla griglia */
    margin-top: 20px;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.8;
}

.cards-hint i {
    font-size: 11px;
    color: var(--red); /* Usa il rosso Aruba per richiamare l'attenzione */
}
.services-grid {
    display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 40px;
    justify-content: center; /* Centra il blocco delle 4 cards nella pagina */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* =========================================
   5. COMPONENTE CARD 3D
========================================= */
.card {
    background-color: transparent;
    perspective: 1000px;
    min-height: 460px;
    transition: transform 0.3s ease;
    width: 100%;
    max-width: 350px;
    position: relative; 
    margin: 0 auto; /* Centra la card nel suo spazio di griglia */
    cursor: pointer;
    -webkit-transform: translateZ(0); /* AGGIUNGI QUESTA RIGA (Fix iOS) */
    transform: translateZ(0);
    z-index: 1;
    isolation: isolate; /* Questo crea un muro impenetrabile tra una carta e l'altra */
}

.card-inner {
    position: absolute;
    top: 0;             /* AGGIUNGI */
    left: 0;            /* AGGIUNGI */
    right: 0;           /* AGGIUNGI */
    bottom: 0;          /* AGGIUNGI */
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    -webkit-transform-style: preserve-3d; /* AGGIUNGI QUESTA RIGA */
    transform-style: preserve-3d;
}

/* Aggiunge la manina per far capire che è cliccabile */
.card-inner, .card-front, .card-back {
    cursor: pointer;
}

.card.is-flipped {
    z-index: 10; /* Assicura che la carta girata non venga coperta */
}

.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: var(--white);
    border-radius: 15px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
/* 3. Porta in primissimo piano la carta su cui passi il mouse o che clicchi */
.card:hover,
.card.is-flipped {
    z-index: 999;
}
.card:hover .card-front,
.card:hover .card-back {
    box-shadow: var(--shadow-lg);
    border-color: var(--border); /* Applica il rosso Aruba al passaggio del mouse */
}

/* FACCIA DAVANTI */
.card-front {
    padding: 0 0 30px 0;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.card-img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 20px;
    padding-top: 20px;
}

.card h3, .card-front h3 {
    font-size: 15px;
    color: var(--dark);
    text-transform: uppercase;
    margin-bottom: 15px;
    padding: 0 10px 15px;
    border-bottom: 2px solid var(--light);
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* FACCIA DIETRO */

.card-back {
    transform: rotateY(180deg);
    background: #fdfdfd;
    padding: 30px 20px;
    display: flex;          /* Assicurati che sia flex */
    flex-direction: column; /* Gli elementi vanno in verticale */
    justify-content: center;/* Centra verticalmente tutti gli elementi */
    align-items: flex-start;    /* Centra orizzontalmente tutti gli elementi */
    border-color: var(--border);
    text-align: left;     /* Centra anche il testo all'interno dei paragrafi */
}
.card-back h3 {
    color: var(--red);
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: none;
    align-self: center;      /* <-- Mantiene il titolo al centro della card */
    text-align: center;
}

.card-back p {
    font-size: 14px;
    color: #444;
    margin-bottom: 25px;
    line-height: 1.6;
    width: 100%;
    display: block;
   
}

.card-back li {
    font-size: 14px;
    margin-bottom: 8px;
    color: #444;
    display: flex;
    justify-content: flex-start;
}

.card-back li i {
    color: var(--red);
    margin-right: 10px;
    width: 15px;
}
/* Ripristina la forma del tasto "Richiedi Info" dentro le card */
.card-back .btn-dl {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    color: var(--white);
    transition: all 0.3s ease;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    align-self: center;      /* <-- Mantiene il bottone centrato */
}
/* =========================================
   6. TABELLE E AVVISI
========================================= */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    text-align: left;
}

.price-table tr {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid var(--light);
    align-items: center;
}

.price-table tr:last-child { border-bottom: none; }
.price-table td { font-size: 13px; color: #555; }
.price-table .val { color: var(--red); font-weight: 800; font-size: 14px; }

.validity-note {
    margin: auto 15px 15px 15px;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    letter-spacing: 0.5px;
    text-align: center;
}

.vat-notice {
    max-width: 1000px;
    margin: 0 auto 40px;
    text-align: center;
    background: var(--light);
    padding: 18px 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================
   7. SEZIONE DOWNLOAD
========================================= */
.download-section {
    background: var(--light);
    padding: 40px 5%;
    border-top: 1px solid var(--border);
}

.section-title { text-align: center; margin-bottom: 30px; }
.section-title h2 { font-size: 32px; color: var(--dark); text-transform: uppercase; font-weight: 900; }

.dl-container {
    display: grid;
    /* Usa esattamente la stessa logica di allineamento delle card */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1400px; /* Stesso limite del main-container */
    margin: 0 auto;
    justify-content: center;
}

.os-box {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
    
    /* Regole gemelle della classe .card */
    width: 100%;
    max-width: 350px; /* Esattamente come la .card */
    margin: 0 auto;   /* Fondamentale per allinearlo al centro della sua colonna */
    box-sizing: border-box;
}

.os-box:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}

.os-box h4 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid var(--light);
    padding-bottom: 15px;
}

.dl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid var(--light);
    transition: background-color 0.2s ease, border-radius 0.2s ease;
}

.dl-row:last-child { border-bottom: none; }
.dl-row span { font-weight: 600; font-size: 15px; color: var(--dark); }

.btn-dl {
    /* Nuove impostazioni per l'icona */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;      /* Forza la larghezza */
    height: 40px;     /* Forza l'altezza uguale alla larghezza */
    min-width: unset; /* Rimuove il vincolo precedente */
    padding: 0;       /* Rimuove il padding precedente */
    
    /* Manteniamo i bordi arrotondati o facciamoli a cerchio */
    border-radius: 8px; /* Cambia a 50% se li vuoi rotondi! */
    text-decoration: none;
    font-size: 16px; /* Ingrandisce un po' l'icona */
    color: var(--white);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-dl:hover {
    filter: brightness(0.85); /* Questa è la magia che scurisce il colore del 15% */
    box-shadow: 0 6px 12px rgba(0,0,0,0.15); /* Aumenta leggermente l'ombra per dare profondità */
    transform: translateY(-2px); /* Fa un piccolissimo "scatto" verso l'alto per far capire che è cliccabile */
}

.btn-aruba { background: var(--red); }
.btn-aruba:hover { background: var(--red-hover); }

.btn-service { background: var(--dark); }
.btn-service:hover { background: #1a252f; }

/* =========================================
   8. FOOTER
========================================= */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 5% 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-col h5 {
    border-left: 4px solid var(--red);
    padding-left: 15px;
    text-transform: uppercase;
    margin-bottom: 20px;
    font-size: 16px;
    letter-spacing: 1px;
}

.footer-col p { margin-bottom: 12px; color: #cccccc; font-size: 14px; }
.footer-col i { color: var(--red); margin-right: 10px; width: 15px; text-align: center; }
.footer-col a { color: var(--white); text-decoration: none; transition: var(--transition); }
.footer-col a:hover { color: var(--red); }

.copyright-bar {
    text-align: center;
    color: #666;
    font-size: 12px;
    background-color: #111;
    padding: 15px;
    margin-top: 40px;
}

/* =========================================
   9. RESPONSIVE DESIGN E MEDIA QUERIES
========================================= */

/* Animazione per menu mobile */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 801px) and (max-width: 1150px) {
    .logo-area img {
        height: 70px; 
    }
    .nav-link {
        padding: 8px 10px;
        font-size: 12px;
    }
    .header-container {
        padding: 0 10px;
    }
}
/* Fino a 800px: Menu Desktop diventa Menu Mobile (Hamburger) */
@media (max-width: 800px) {

    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center; /* Centra verticalmente tutto il contenuto */
        
        flex-wrap: wrap; /* Permette al menu di andare a capo sotto logo e toggle */
    }
    /* Assicuriamoci che l'area del logo non spinga via gli altri elementi */
    .logo-area {
        flex: 1;
        display: flex;
        align-items: center;
        max-width: 75%;
        
    }
    
     .logo-area img {
        height: auto;      /* Rende l'altezza flessibile */
        width: auto;       /* Mantiene le proporzioni originali */
        max-width: 100%;    /* Riduce il logo al 60% della larghezza disponibile per non toccare i tasti a destra */
        
    }

   .header-actions-mobile {
        display: flex;
        align-items: center;     /* Centra verticalmente icone e bottoni */
        max-width: 28%;   /* Occupa al massimo il 28% della larghezza totale */
        justify-content: flex-end;
        
        flex: 0 0 auto;          /* Non permette ai tasti di restringersi */
        gap: 5px; /* AGGIUNGI QUESTA RIGA: Crea uno spazio vuoto tra le icone */
    }
   /* Riduciamo la dimensione delle icone stesse in percentuale/em */
    .header-actions-mobile i {
        font-size: 1.2rem; /* Usa rem o em per una riduzione proporzionale */
    }

    .contact-icon-minimal {
        display: flex;
        font-size: 24px; /* Leggermente più grande per compensare la mancanza del bordo */
        color: var(--dark); /* Usa lo stesso colore del testo o var(--red) per risaltare */
        text-decoration: none;
        padding: 8px;
    }
    .menu-toggle { 
        display: block;
        background: none; /* Rimuove lo sfondo se presente */
        border: none;     /* Rimuove il bordo per uno stile più pulito */
        font-size: 24px;  /* Stessa dimensione dell'icona contatti */
        color: var(--dark);
        padding: 8px;
        cursor: pointer;
    }

    .nav-menu {
        
        display: none;
        flex-direction: column;
        position: relative;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 10px;
       
       
        gap: 10px;

    }

    .nav-menu.active { 
        display: flex;
        
    }

    .nav-link {
        width: 100%;
        font-size: 13px;
        padding: 15px;
        justify-content: center;
        background: var(--light);
    }
    
   
}

/* Fino a 1024px: Griglie passano a 2 colonne (Tablet / Finestre ridotte) */
@media (max-width: 1050px) {
    .services-grid {
        grid-template-columns: repeat(2, minmax(280px, 380px));
        gap: 25px;
    }
    
}

/* Fino a 768px: Tutto in una colonna (Smartphone) */
@media (max-width: 768px) {
    .services-grid { 
       grid-template-columns: 1fr;
        max-width: 400px; /* Evita che la card singola diventi gigante su smartphone larghi */
        margin-left: auto;
        margin-right: auto;
    }
    .cards-hint {
        font-size: 12px;
        margin-bottom: 0;
    }
    .card {
        min-height: 520px; /* Più altezza per testi che vanno a capo */
    }

    .quick-access { 
        grid-template-columns: 1fr; 
        gap: 15px; 
        margin-top: 15px; 
    }
    
    .btn-quick { 
        padding: 12px 15px; 
        font-size: 14px; 
    }

    .footer-grid { 
        grid-template-columns: 1fr; 
        gap: 30px; 
        text-align: center; 
    }
   

    .footer-col h5 { 
        border-left: none; 
        border-bottom: 2px solid var(--red); 
        padding-left: 0; 
        padding-bottom: 10px; 
        display: inline-block; 
    }

    /* --- INIZIO FIX SEZIONE DOWNLOAD MOBILE --- */
    .download-section {
        padding: 25px 5%;
    }
    .os-box {
        padding: 20px; /* Riduciamo l'ingombro interno della scatola */
    }

    .section-title {
        margin-bottom: 20px;
    }
    
   .dl-row { 
        flex-direction: row; /* Mantiene testo e bottone sulla stessa riga */
        align-items: center;
        gap: 10px; 
        text-align: left; 
        padding: 12px 5px;
    }
    .dl-row span {
        font-size: 13px; /* Testo leggermente più piccolo */
        line-height: 1.2;
    }
    
    .btn-dl { 
        width: auto; /* Rimuove il bottone gigante al 100% */
        padding: 8px 12px;
        font-size: 11px;
        margin-left: auto; /* Spinge il bottone tutto a destra */
    }
    /* Ripristina la centratura solo per i bottoni dentro le card */
    .card-back .btn-dl {
        margin-left: auto !important;
        margin-right: auto !important;
        display: block;
        width: fit-content;
    }

    /* Limita la spinta a destra SOLO ai bottoni della sezione download */
    .dl-row .btn-dl {
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    /* --- FINE FIX SEZIONE DOWNLOAD MOBILE --- */
}


/* Stile per la Sezione Avviso */
.notice-section {
    padding: 60px 20px;
    background-color: #fff;
}

.notice-container {
    max-width: 900px;
    margin: 0 auto;
    border: 2px solid var(--red);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.notice-header {
    background-color: var(--red);
    color: white;
    padding: 30px;
    text-align: center;
}

.notice-header i { font-size: 40px; margin-bottom: 10px; }
.notice-header h2 { font-size: 28px; margin: 0; font-weight: 900; letter-spacing: 1px; }
.notice-header .subtitle { font-size: 18px; margin-top: 10px; opacity: 0.9; font-weight: 600; }

.notice-body {
    padding: 40px;
    color: var(--dark);
    line-height: 1.8;
}

.notice-box {
    background: #f8f9fa;
    padding: 20px;
    border-left: 5px solid var(--red);
    margin: 25px 0;
    border-radius: 0 10px 10px 0;
}

.notice-box h4 {
    color: var(--red);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.requirement-box { border-left-color: var(--blue-aruba); }
.requirement-box h4 { color: var(--blue-aruba); }

.notice-body ul { list-style: none; padding-left: 0; }
.notice-body li { margin-bottom: 10px; display: flex; align-items: flex-start; gap: 10px; }
.notice-body li i { color: var(--blue-aruba); margin-top: 5px; }

.notice-footer {
    background: #eee;
    padding: 20px 40px;
    text-align: center;
    font-size: 14px;
}

/* Responsive per Smartphone */
@media (max-width: 768px) {
    .notice-header h2 { font-size: 22px; }
    .notice-header .subtitle { font-size: 16px; }
    .notice-body { padding: 20px; }
    .notice-section { padding: 30px 15px; }
}