﻿:root {
    --primary: #0A214A;
    --secondary: #0F3D75;
    --accent: #FF7A00;
    --light: #F5F6FA;
    --dark: #1A1A1A;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
}

header {
    background-image: url("/img/header.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    padding: 110px 20px;
    text-align: center;
}

    header h1 {
        font-size: 48px;
        font-weight: 700;
        margin-bottom: 20px;
    }

@media (min-width: 801px) {
    header p {
        padding-top: 80px;
        color: white;
        text-align: justify;
        max-width: 480px;
        margin: auto;
        font-size: 20px;
        opacity: .9;
        position: relative;
        left: -100px;
    }
}

section p {
    font-size: 1.3em;
    line-height: 1.5em;
}

.btn-primary {
    background: var(--accent);
    padding: 16px 40px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    display: inline-block;
    margin-top: 85px;
    transition: .3s;
    font-size: 18px;
    cursor: pointer;
}

    .btn-primary:hover {
        /*line-height: 1.5em;*/
        background: #e76e00;
        transform: translateY(-3px);
    }

@media (max-width: 800px) {
    header {
        background-image: url("/img/header_small.jpg");
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        padding: 110px 20px;
        text-align: center;
    }

        header p {
            padding-top: 80px;
            color: white;
            text-align: center;
            max-width: 480px;
            margin: auto;
            font-size: 20px;
            opacity: .9;
        }
}

section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: auto;
}

h1 {
    text-align: center;
}

    h1 img {
        width: 50%;
        max-width: 500px;
    }

h2 {
    font-size: 38px;
    margin-bottom: 30px;
    font-weight: 700;
}

.features {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.feature {
    cursor: pointer;
    flex: 1 1 calc(33% - 20px);
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
    transition: .3s;
    border: 1px solid #eee;
    text-align: left;
}


    .feature:hover {
        transform: translateY(-6px);
        box-shadow: 0 6px 26px rgba(0,0,0,.12);
    }

    .feature h3 {
        color: var(--primary);
        font-size: 22px;
        margin-bottom: 10px;
    }

.cta-area {
    text-align: center;
    background: var(--primary);
    color: white;
    padding: 100px 20px;
}

    .cta-area h2 {
        color: white;
    }

footer {
    text-align: center;
    padding: 35px;
    background: #111;
    color: #ccc;
    font-size: 14px;
}

    footer a,
    footer a:visited,
    footer a:active,
    footer a:focus {
        color: #ccc;
        text-decoration: underline; /* sempre sottolineato */
    }

        footer a:hover {
            color: #ccc;
            text-decoration: underline; /* niente cambiamento */
        }

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    background: #fff;
    width: 80vw; /* prende max 80% larghezza schermo */
    max-height: 80vh; /* prende max 80% altezza schermo */
    padding: 20px;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* evita overflow */
    min-height: 0; /* permette a img di rimpicciolirsi */
}

.carousel {
    flex: 1; /* l'immagine prende lo spazio principale */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#popup-image {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain; /* mantiene proporzioni */
    border-radius: 8px;
}

/* Frecce */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 40px;
    padding: 10px;
    user-select: none;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

    .prev:hover, .next:hover {
        opacity: 0.7;
    }

/* Titolo e descrizione */
#popup-title {
    margin: 0;
    font-size: 1.6rem;
    text-align: center;
}

@media (max-width: 768px) {
    #popup-description {
        max-height: 50vh; /* puoi regolare */
        height:50%;
        overflow:auto;
    }

    .carousel {
        min-height: 20vh;
    }
}   

#popup-description {
    margin-top: 0;
    /*max-height: 40vh;*/ /* la descrizione non schiaccia l'immagine */
    /*overflow-y: auto;*/ /* scroll verticale se molto lunga */
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}




.close {
    float: right;
    cursor: pointer;
    font-size: 24px;
}



/* POPUP */
.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: white;
    padding: 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 8px 26px rgba(0,0,0,.25);
    animation: pop .3s ease;
}

@keyframes pop {
    from {
        transform: scale(.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 28px;
    color: var(--primary);
}

.modal input {
    width: 90%;
    padding: 10px;
    margin: 3px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.modal button,
.modal .button {
    width: 89%;
    padding: 16px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
}

.modal .button {
    text-align: center;
    text-decoration: none;
    display: block;
}

    .modal button:hover,
    .modal .button:hover {
        background: #e76e00;
    }

.close-btn {
    margin-top: 15px;
    text-align: center;
    color: #555;
    cursor: pointer;
    display: block;
}

textarea {
    width: 88%;
    height: 110px;
    padding: 14px;
    margin: 6px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
}

.custom-checkbox {
    margin-top: 5px;
    /* Abilita il Flex Container */
    display: flex;
    /* Allinea verticalmente gli elementi al centro (opzionale, ma consigliato) */
    align-items: center;
    /* Aggiunge spazio tra l'etichetta e la checkbox (opzionale) */
    gap: 10px;
}

.error {
    color: red;
}

.success {
    color: green;
}
