/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a1a;
    background: #f5f5f5;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container {
    flex: 1;
}

a { color: #003C71; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== BANNER ===== */
.banner {
    max-width: 720px;
    width: 100%;
    margin: 1.5rem auto 0;
    padding: 0 1rem;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

h1 {
    font-size: 1.8rem;
    text-align: center;
    color: #003C71;
}

.sottotitolo {
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 0.5rem;
}

/* ===== HERO CARD ===== */
.hero {
    text-align: center;
    background: #fff;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-top: 3px solid #003C71;
}

.hero h1 {
    margin-bottom: 0.3rem;
}

.hero-luogo {
    font-size: 1.05rem;
    color: #555;
    font-weight: 500;
}

.hero-divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1rem auto;
    max-width: 120px;
}

.hero-slogan {
    font-size: 1.15rem;
    font-weight: 700;
    color: #003C71;
    margin-bottom: 0.5rem;
}

.hero-testo {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.7;
}

.nota-obbligatori {
    background: #e8f0f8;
    border-left: 3px solid #003C71;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: #003C71;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1.5rem;
}

/* ===== TOPBAR PAGINE INTERNE ===== */
.topbar {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1rem 0;
}

.btn-torna {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #003C71;
    color: #fff;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-torna:hover {
    background: #002a52;
    text-decoration: none;
}

/* ===== PAGINE TESTO ===== */
.pagina-testo p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.pagina-testo p:last-child {
    margin-bottom: 0;
}

/* ===== SEZIONI FORM ===== */
.form-section {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-section h2 {
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #003C71;
}

/* ===== CAMPI FORM ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #003C71;
    box-shadow: 0 0 0 2px rgba(0, 60, 113, 0.15);
}

.form-group input.errore,
.form-group select.errore {
    border-color: #c0392b;
}

.errore-campo {
    display: block;
    font-size: 0.78rem;
    color: #c0392b;
    margin-top: 0.2rem;
    min-height: 1rem;
}

/* ===== CALENDARIO ===== */
.calendario {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.giorno {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.7rem 0.3rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.giorno:hover {
    border-color: #003C71;
    background: #e8f0f8;
}

.giorno.attivo {
    border-color: #003C71;
    background: #003C71;
    color: #fff;
}

.giorno-nome {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.7;
}

.giorno-numero {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.giorno-mese {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.6;
}

/* ===== SLOT ORARI ===== */
.slot-orari {
    margin-top: 0.5rem;
}

.slot-titolo {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.slot-griglia {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.slot {
    padding: 0.6rem 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.slot:hover {
    border-color: #003C71;
    background: #e8f0f8;
}

.slot.attivo {
    border-color: #003C71;
    background: #003C71;
    color: #fff;
}

.slot.esaurito {
    background: #e0e0e0;
    color: #888;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.slot.esaurito:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.slot .esaurito-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-top: 0.2rem;
    color: #999;
}

/* ===== CHECKBOX ===== */
.checkbox-group {
    margin-bottom: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
}

.checkbox-group.errore .checkbox-label {
    color: #c0392b;
}

.checkbox-group.errore .checkbox-label input[type="checkbox"] {
    outline: 2px solid #c0392b;
    outline-offset: 1px;
    border-radius: 2px;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #003C71;
}

/* ===== BOTTONE REGISTRA ===== */
.btn-registra {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-registra:hover {
    background: #a93226;
}

.btn-registra:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* ===== MESSAGGIO FEEDBACK ===== */
.messaggio-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 600;
}

.messaggio-feedback.ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.messaggio-feedback.errore {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== VIDEO RICORDO ===== */
.video-ricordo {
    background: #fff;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.video-ricordo h2 {
    font-size: 1.3rem;
    color: #003C71;
    text-align: center;
    margin-bottom: 2rem;
}

.video-giorno {
    margin-bottom: 2rem;
}

.video-giorno:last-child {
    margin-bottom: 0;
}

.video-giorno h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #003C71;
}

.video-giorno iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: none;
    border-radius: 8px;
}

/* ===== FOOTER ===== */
.footer {
    background: #003C71;
    color: #fff;
    padding: 2.5rem 1rem 1.5rem;
    margin-top: 2rem;
}

.footer-container {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.footer-titolo {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
    letter-spacing: 0.5px;
}

.footer-campagne {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}

.footer-campagne a {
    color: #b8d4f0;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-campagne a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-contatti {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}

.btn-email {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}

.btn-email:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.footer-link {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-link a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link a:hover {
    color: #fff;
}

/* ===== RESPONSIVE — TABLET ===== */
@media (max-width: 768px) {
    .calendario {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.3rem;
    }

    .slot-griglia {
        grid-template-columns: repeat(2, 1fr);
    }

    .giorno-numero {
        font-size: 1.2rem;
    }
}

/* ===== RESPONSIVE — SMARTPHONE ===== */
@media (max-width: 480px) {
    .banner {
        padding: 0 0.75rem;
    }

    .container {
        padding: 1rem 0.75rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .calendario {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
    }

    .slot-griglia {
        grid-template-columns: 1fr 1fr;
    }

    .footer-campagne {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }

    .footer-contatti {
        flex-direction: column;
        align-items: center;
    }

    .footer-link {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
}
