/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; color: #1e293b; background: white; line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

:root {
    --blu: #0B2B5E;
    --azzurro: #2D6A9F;
    --argento: #C0C0C0;
    --grigio: #F5F7FA;
    --verde: #25D366;
}

/* ===== NAVBAR ===== */
.navbar { background: white; padding: 15px 0; position: fixed; width: 100%; top: 0; z-index: 1000; box-shadow: 0 2px 20px rgba(0,0,0,0.1); }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo h1 { color: white; font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.logo span { color: var(--argento); font-size: 11px; display: block; }
.nav-links { list-style: none; display: flex; gap: 30px; }
.nav-links a { color: var(--blu); text-decoration: none; font-weight: 500; font-size: 15px; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--azzurro); }
.nav-buttons { display: flex; gap: 10px; align-items: center; }
.btn-phone { background: var(--azzurro); color: white; padding: 8px 16px; border-radius: 40px; text-decoration: none; font-size: 14px; font-weight: 500; }
.btn-phone:hover { background: #245a8a; }
.btn-whatsapp { background: var(--verde); color: white; padding: 8px 16px; border-radius: 40px; text-decoration: none; font-size: 14px; font-weight: 500; }
.btn-whatsapp:hover { background: #1da851; }
.menu-toggle { display: none; font-size: 24px; cursor: pointer; color: var(--blu); }

/* ===== BUTTONS ===== */
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: white; color: var(--blu); padding: 14px 28px; border-radius: 40px; text-decoration: none; font-weight: 700; border: none; cursor: pointer; font-size: 16px; transition: all 0.2s; }
.btn-primary:hover { background: var(--argento); transform: translateY(-2px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 2px solid var(--blu); color: var(--blu); padding: 12px 26px; border-radius: 40px; text-decoration: none; font-weight: 600; transition: all 0.2s; }
.btn-secondary:hover { background: var(--blu); color: white; }
.btn-outline { display: inline-flex; align-items: center; gap: 8px; border: 2px solid rgba(255,255,255,0.6); color: white; padding: 12px 28px; border-radius: 40px; text-decoration: none; font-weight: 600; transition: all 0.2s; }
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.15); }
.btn-submit { background: var(--blu); color: white; padding: 14px 30px; border: none; border-radius: 40px; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.2s; }
.btn-submit:hover { background: var(--azzurro); }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, var(--blu), var(--azzurro)); color: white; padding: 150px 0 80px; }
.hero-content h1 { font-size: 52px; font-weight: 800; margin-bottom: 20px; line-height: 1.2; }
.highlight { color: var(--argento); }
.hero-content p { font-size: 18px; margin-bottom: 32px; opacity: 0.9; }
.hero-buttons { display: flex; gap: 16px; margin-bottom: 48px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 48px; flex-wrap: wrap; }
.stat-number { font-size: 32px; font-weight: 800; display: block; }
.hero-stats > div { font-size: 14px; opacity: 0.8; }

/* ===== SEZIONI ===== */
section { padding: 80px 0; }
.section-title { text-align: center; font-size: 34px; font-weight: 700; margin-bottom: 48px; color: var(--blu); }
.section-title:after { content: ''; display: block; width: 60px; height: 3px; background: var(--argento); margin: 14px auto 0; }

/* ===== PAGE HEADER (pagine interne) ===== */
.page-header { background: linear-gradient(135deg, var(--blu), var(--azzurro)); color: white; padding: 130px 0 60px; text-align: center; }
.page-header h1 { font-size: 48px; font-weight: 800; margin-bottom: 16px; }
.page-header p { font-size: 18px; opacity: 0.85; }

/* ===== VANTAGGI ===== */
.vantaggi { background: var(--grigio); }
.vantaggi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; }
.vantaggio-card { text-align: center; padding: 32px 24px; background: white; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); transition: transform 0.3s; }
.vantaggio-card:hover { transform: translateY(-8px); }
.vantaggio-icon { width: 80px; height: 80px; background: linear-gradient(135deg, var(--blu), var(--azzurro)); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.vantaggio-icon i { font-size: 32px; color: white; }
.vantaggio-card h3 { margin-bottom: 10px; color: var(--blu); font-size: 17px; }

/* ===== AUTO GRID ===== */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.auto-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.08); transition: all 0.3s; border: 1px solid #e2e8f0; }
.auto-card:hover { transform: translateY(-6px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
.auto-image { height: 200px; background: linear-gradient(135deg, var(--grigio), #E8EDF2); display: flex; align-items: center; justify-content: center; }
.auto-image i { font-size: 80px; color: var(--blu); }
.auto-info { padding: 22px; }
.auto-info h3 { color: var(--blu); margin-bottom: 6px; font-size: 18px; }
.auto-desc { color: #64748b; font-size: 14px; margin-bottom: 4px; }
.auto-durata { color: #94a3b8; font-size: 13px; }
.auto-price { font-size: 26px; font-weight: 700; color: var(--blu); margin: 12px 0; }
.auto-price span { font-size: 14px; font-weight: 400; color: #64748b; }
.auto-btn { display: inline-block; background: var(--blu); color: white; padding: 10px 20px; border-radius: 40px; text-decoration: none; font-weight: 500; font-size: 14px; margin-top: 12px; transition: background 0.2s; }
.auto-btn:hover { background: var(--azzurro); }

/* ===== COME FUNZIONA ===== */
.come-funziona { background: var(--grigio); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; text-align: center; }
.step-number { width: 56px; height: 56px; background: var(--blu); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; margin: 0 auto 16px; }
.step-icon { font-size: 44px; color: var(--azzurro); margin-bottom: 16px; }
.steps h3 { color: var(--blu); margin-bottom: 8px; }

/* ===== CONTATTI ===== */
.contatti-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding: 60px 0; }
.contatto-card { text-align: center; padding: 40px; background: var(--grigio); border-radius: 20px; transition: transform 0.3s; }
.contatto-card:hover { transform: translateY(-5px); }
.contatto-card i { font-size: 50px; color: var(--blu); margin-bottom: 20px; display: block; }
.contatto-card h3 { margin-bottom: 12px; color: var(--blu); }
.contatto-card a { color: var(--blu); text-decoration: none; font-weight: 600; }
.contatto-card p { color: #64748b; margin-top: 6px; font-size: 14px; }

/* ===== CHI SIAMO ===== */
.content-section { padding: 60px 0; max-width: 800px; margin: 0 auto; text-align: center; }
.content-section p { font-size: 17px; line-height: 1.7; margin-bottom: 20px; color: #334155; }
.mission-box { background: var(--grigio); padding: 40px; border-radius: 20px; margin: 40px 0; border-left: 4px solid var(--blu); }
.mission-box p { font-size: 20px; font-style: italic; color: var(--blu); }
.checklist p { text-align: left; padding: 8px 0; border-bottom: 1px solid #e2e8f0; }

/* ===== FORM PREVENTIVO ===== */
.form-container { background: white; max-width: 700px; margin: 60px auto; padding: 40px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--blu); font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 10px; font-family: inherit; font-size: 15px; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blu); box-shadow: 0 0 0 3px rgba(11,43,94,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== FOOTER ===== */
footer { background: #041E42; color: #94a3b8; padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h3, .footer-col h4 { color: white; margin-bottom: 18px; font-size: 16px; }
.footer-col p { font-size: 14px; line-height: 1.7; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; font-size: 14px; }
.footer-col ul li a { color: #94a3b8; text-decoration: none; transition: color 0.2s; }
.footer-col ul li a:hover { color: white; }
.footer-col ul li i { margin-right: 8px; color: var(--argento); width: 16px; }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid #1e3a5f; font-size: 13px; }

/* ===== SUCCESS/ERROR MESSAGES ===== */
.alert { padding: 16px 20px; border-radius: 10px; margin-bottom: 20px; font-weight: 500; display: none; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links, .nav-buttons { display: none; }
    .nav-links.open, .nav-buttons.open { display: flex; flex-direction: column; position: absolute; top: 65px; left: 0; width: 100%; background: white; padding: 20px; gap: 16px; border-top: 1px solid #e2e8f0; }
    .menu-toggle { display: block; }
    .hero-content h1 { font-size: 34px; }
    .hero-buttons { flex-direction: column; }
    .hero-stats { gap: 24px; }
    .page-header h1 { font-size: 32px; }
    .contatti-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .section-title { font-size: 26px; }
    section { padding: 50px 0; }
    .form-container { margin: 30px 0; padding: 24px; }

    /* Hotfix sessione 13/05: evita sovrapposizione nav-links/nav-buttons quando entrambi .open su mobile. position:static + flex-wrap + order forza impilamento in flow normale. */
    nav.navbar .container { flex-wrap: wrap; }
    nav.navbar .nav-links.open,
    nav.navbar .nav-buttons.open {
        position: static;
        top: auto;
        left: auto;
        width: 100%;
        margin: 0;
        padding: 12px 20px;
        background: white;
        box-sizing: border-box;
    }
    nav.navbar .nav-links.open {
        order: 98;
        border-top: 1px solid #e2e8f0;
        list-style: none;
        gap: 8px;
    }
    nav.navbar .nav-links.open li { width: 100%; }
    nav.navbar .nav-links.open li a {
        display: block;
        padding: 8px 0;
    }
    nav.navbar .nav-buttons.open {
        order: 99;
        border-top: 1px solid #f1f5f9;
        gap: 8px;
    }
    nav.navbar .nav-buttons.open .btn-phone,
    nav.navbar .nav-buttons.open .btn-whatsapp {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   COOKIE BANNER + MODALE PREFERENZE (Step 3, sotto-sessione 2 cantiere #11)
   Selettori namespaced .itinera-cookie-* per evitare conflitti.
   ============================================ */

.itinera-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid var(--blu);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 9998;
    padding: 20px 24px;
    animation: itinera-cookie-slideup 0.4s ease-out;
}

@keyframes itinera-cookie-slideup {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.itinera-cookie-banner[hidden] { display: none; }

.itinera-cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.itinera-cookie-banner-title {
    color: var(--blu);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.itinera-cookie-banner-title i { margin-right: 8px; }

.itinera-cookie-banner-text {
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
}

.itinera-cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.itinera-cookie-link {
    color: var(--blu);
    text-decoration: underline;
}

.itinera-cookie-btn {
    padding: 11px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.2;
}

.itinera-cookie-btn-primary {
    background: var(--blu);
    color: white;
}

.itinera-cookie-btn-primary:hover {
    background: var(--azzurro);
}

.itinera-cookie-btn-outline {
    background: white;
    color: var(--blu);
    border: 2px solid var(--blu);
    padding: 9px 16px;
}

.itinera-cookie-btn-outline:hover {
    background: var(--blu);
    color: white;
}

.itinera-cookie-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.itinera-cookie-btn-secondary:hover {
    background: #e2e8f0;
}

.itinera-cookie-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.itinera-cookie-modal[hidden] { display: none; }

.itinera-cookie-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.itinera-cookie-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.itinera-cookie-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.itinera-cookie-modal-close:hover { color: #334155; }

.itinera-cookie-modal-title {
    color: var(--blu);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.itinera-cookie-modal-title i { margin-right: 8px; }

.itinera-cookie-modal-intro {
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
    margin-bottom: 24px;
}

.itinera-cookie-category {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.itinera-cookie-category-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.itinera-cookie-category-text { flex: 1; }

.itinera-cookie-category-title {
    color: var(--blu);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.itinera-cookie-category-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.itinera-cookie-toggle-wrap {
    flex-shrink: 0;
    text-align: center;
}

.itinera-cookie-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.itinera-cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.itinera-cookie-toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}

.itinera-cookie-toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.itinera-cookie-toggle input:checked + .itinera-cookie-toggle-slider {
    background: var(--blu);
}

.itinera-cookie-toggle input:checked + .itinera-cookie-toggle-slider:before {
    transform: translateX(20px);
}

.itinera-cookie-toggle-disabled .itinera-cookie-toggle-slider {
    background: #94a3b8;
    cursor: not-allowed;
}

.itinera-cookie-toggle-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    font-weight: 600;
}

.itinera-cookie-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .itinera-cookie-banner {
        padding: 16px;
    }
    .itinera-cookie-banner-inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .itinera-cookie-banner-actions {
        flex-wrap: wrap;
    }
    .itinera-cookie-banner-actions .itinera-cookie-btn {
        flex: 1;
        min-width: 110px;
    }
    .itinera-cookie-modal-content {
        padding: 24px 20px;
    }
}

.itinera-cookie-prefs-link {
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    opacity: 0.85;
}

.itinera-cookie-prefs-link:hover {
    opacity: 1;
}

/* ============================================
   LEGAL CONTENT (Privacy Policy + Cookie Policy)
   ============================================ */
.legal-content {
    color: #1e293b;
    font-size: 15px;
    line-height: 1.7;
}

.legal-content h2,
.legal-content .legal-section-title {
    color: var(--blu);
    font-size: 22px;
    font-weight: 700;
    margin: 36px 0 16px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.legal-content h2:first-of-type,
.legal-content .legal-section-title:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.legal-content h3 {
    color: var(--blu);
    font-size: 17px;
    font-weight: 600;
    margin: 24px 0 12px;
}

.legal-content p {
    margin-bottom: 14px;
}

.legal-content strong {
    color: #0f172a;
    font-weight: 600;
}

.legal-content a {
    color: var(--azzurro);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--blu);
}

.legal-content ul,
.legal-content ol {
    margin: 12px 0 16px 28px;
}

.legal-content li {
    margin-bottom: 6px;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 14px;
}

.legal-table th,
.legal-table td {
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.legal-table th {
    background: #f1f5f9;
    color: var(--blu);
    font-weight: 600;
}

.legal-table tr:nth-child(even) td {
    background: #fafbfc;
}

.legal-meta {
    margin-top: 40px;
    padding: 16px 20px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    color: #64748b;
    border-left: 3px solid var(--blu);
}

@media (max-width: 768px) {
    .legal-table {
        font-size: 13px;
    }
    .legal-table th,
    .legal-table td {
        padding: 8px 10px;
    }
}