@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --colore-primario: #2563eb;
    --colore-secondario: #4f46e5;
    --testo-principale: #111827;
    --testo-secondario: #4b5563;
    --sfondo-chiaro: #f9fafb;
    --sfondo-bianco: #ffffff;
    --bordo: #e5e7eb;
}

/* --- RESET GLOBALE E LAYOUT STABILE --- */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--testo-principale);
    background-color: var(--sfondo-bianco);
    overflow-x: hidden; /* Impedisce lo scorrimento orizzontale */
}
body.modal-open {
    overflow: hidden; /* Blocca lo scroll quando il modal è aperto */
}
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- HEADER --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bordo);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}
.main-header.scrolled { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.navbar { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--testo-principale); text-decoration: none; }
.nav-links a { text-decoration: none; color: var(--testo-secondario); font-weight: 500; margin-left: 1.5rem; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--colore-primario); }
.btn { padding: 0.6rem 1.2rem; border-radius: 0.375rem; text-decoration: none; font-weight: 600; transition: all 0.3s ease; border: none; cursor: pointer; }
.btn-primary { background-color: var(--colore-primario); color: white; }
.btn-primary:hover { background-color: #1d4ed8; }
.btn-secondary { background-color: var(--bordo); color: var(--testo-principale); }
.btn-secondary:hover { background-color: #d1d5db; }


/* --- SEZIONI E TESTI --- */
.section { padding: 100px 0; }
.section-title { text-align: center; margin-bottom: 4rem; }
.section-title h2 { font-size: 2.5rem; font-weight: 700; margin: 0; }
.section-title p { font-size: 1.1rem; color: var(--testo-secondario); margin-top: 0.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero { padding-top: 160px; padding-bottom: 120px; text-align: center; background: linear-gradient(180deg, var(--sfondo-chiaro) 0%, var(--sfondo-bianco) 100%); }
.hero h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.2; margin: 0 auto 1.5rem; max-width: 800px; }
.hero .highlight { background: linear-gradient(to right, var(--colore-primario), var(--colore-secondario)); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.2rem; color: var(--testo-secondario); max-width: 700px; margin: 0 auto 2.5rem; line-height: 1.6; }

/* --- SEZIONE AVVISI (RESTYLING E CORREZIONE) --- */
.alerts-section {
    background: linear-gradient(45deg, var(--colore-secondario), var(--colore-primario));
    color: white;
    padding: 80px 0;
}
.announcements-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}
.announcements-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.announcement-card {
    flex: 0 0 300px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}
.announcement-card:hover {
    transform: translateY(-5px);
}
.announcement-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: white;
}
.announcement-card .date {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 1.5rem;
}
.announcement-card .btn {
    margin-top: auto;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
}
.announcement-card .btn:hover {
    background-color: white;
    color: var(--colore-primario);
}

#proposte { background-color: var(--sfondo-bianco); }
#how-it-works { background-color: var(--sfondo-chiaro); }
.steps-container { display: grid; grid-template-columns: 1fr; gap: 3rem; }
.step { display: flex; align-items: center; gap: 3rem; }
.step:nth-child(even) .step-text { order: 2; }
.step-text { flex: 1; }
.step-number { font-size: 1.2rem; font-weight: 700; color: var(--colore-primario); margin-bottom: 0.5rem; }
.step-text h3 { font-size: 2rem; margin: 0 0 1rem 0; }
.step-text p { color: var(--testo-secondario); line-height: 1.7; }
.step-image { flex: 1; text-align: center; }
.step-image img { max-width: 100%; border-radius: 0.75rem; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.pwa-instructions { margin-top: 1.5rem; display: flex; gap: 2rem; }
.pwa-instructions div { flex: 1; background-color: var(--sfondo-bianco); padding: 1.5rem; border-radius: 0.5rem; border: 1px solid var(--bordo); }
.pwa-instructions h4 { margin: 0 0 0.5rem 0; display: flex; align-items: center; gap: 0.5rem; }
.pwa-instructions p { font-size: 0.9rem; margin: 0; }
.page-hero { padding-top: 140px; padding-bottom: 60px; background-color: var(--sfondo-chiaro); }
.offers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.offer-card { background-color: var(--sfondo-bianco); border-radius: 0.75rem; border: 1px solid var(--bordo); overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.offer-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.offer-card img { width: 100%; height: 200px; object-fit: cover; }
.offer-content { padding: 1.5rem; }
.offer-content h3 { margin: 0 0 0.5rem 0; font-size: 1.5rem; }
.offer-content .price { font-size: 1.2rem; font-weight: 700; color: var(--colore-primario); margin-bottom: 1rem; }
.offer-content p { color: var(--testo-secondario); line-height: 1.6; margin-bottom: 0; }
.cta-section { background-color: var(--colore-secondario); color: white; text-align: center; }
.main-footer { background-color: var(--testo-principale); color: #e5e7eb; padding: 40px 0; text-align: center; }
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* --- STILI PER IL MODAL (POP-UP) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: var(--sfondo-bianco);
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    width: 100%;
    max-width: 500px;
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
}
.modal-overlay.is-visible .modal-content {
    transform: scale(1) translateY(0);
}
.modal-content h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: var(--testo-principale);
}
.modal-content p {
    color: var(--testo-secondario);
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: left;
}
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.modal-actions .btn {
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .nav-links a:not(.btn) { display: none; }
    /* Mobile: show only the primary CTA (Richiedi un Preventivo) */
    .nav-links a.btn { display: none; }
    .nav-links a.btn.btn-primary { display: inline-block; }
    .step { flex-direction: column; }
    .step:nth-child(even) .step-text { order: 0; }
    .pwa-instructions { flex-direction: column; }
    .page-hero { padding-top: 120px; padding-bottom: 40px; }
    .section-title h2, .cta-section h2 { font-size: 2rem; }
    .offers-grid { grid-template-columns: 1fr; }
    .announcement-card { flex-basis: 250px; }
}