/* Stile generale per il body */
body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f8;
    color: #333;
}

/* Contenitore principale per ogni step */
.step-container {
    max-width: 50%;
    margin: 30px auto;
    background: #f3f6f8;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.step-container h2 {
    font-size: 20px;
    color: #0285c7;
}

/* Titolo dello step */
/* h2 {
    text-align: center;
    font-size: 1.8rem; 
    margin-bottom: 20px;
    color: #007BFF;
} 
*/

/* Stile per il dropdown della provincia */
.dropdown {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

select {
    padding: 12px 15px;
    height: fit-content;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 8px;
    max-width: 400px;
    width: 100%;
    background: #fff;
    transition: border-color 0.3s ease;
}

.dropdown select:focus {
    border-color: #0285c7;
    outline: none;
}

/* Contenitore delle opzioni del tetto */
.roof-types {
    display: flex;
    justify-content: center;
    gap: 20px; /* Spaziatura tra le opzioni */
    flex-wrap: wrap; /* Permette il wrapping delle opzioni */
    margin-top: 30px;
}

/* Stile base per ogni opzione del tetto */
.roof-option {
    flex: 1 1 calc(30% - 20px); /* 3 per riga su desktop */
    /* max-width: calc(30% - 20px); */
    max-width: 20%;
    border: 3px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    position: relative; /* Necessario per il testo in sovraimpressione */
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    background: #f9f9f9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.roof-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Testo in sovraimpressione */
.roof-option .roof-text {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgb(2 133 199); /* Sfondo semi-trasparente */
    color: white;
    text-align: center;
    font-size: 0.6rem;
    opacity: 85%;
    line-height: 1.2; /* Altezza uniforme del testo */
    height: 1.2rem; /* Altezza fissa */
    padding: 0.2rem 0;
    box-sizing: border-box;
    overflow: hidden; /* Nasconde il testo in eccesso */
    text-overflow: ellipsis;
    white-space: nowrap; /* Impedisce che il testo vada su due righe */
}

/* Effetto hover */
.roof-option:hover {
    transform: scale(1.05); /* Ingrandimento leggero */
    border-color: #0285c7;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Stile per l'opzione selezionata */
.roof-option.selected {
    border-color: #0285c7;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    background: #eaf4ff;
}

/* Contenitore del pulsante */
.button-container {
    text-align: center;
    margin-top: 30px;
}

.button-container button {
    padding: 12px 30px;
    font-size: 18px;
    color: white;
    background-color: #0285c7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.button-container button:hover {
    background-color: #0056b3;
    transform: translateY(-2px); /* Effetto hover */
}

.button-container button:active {
    transform: translateY(0); /* Effetto click */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Media query per tablet */
@media (max-width: 768px) {
    .roof-option {
        flex: 1 1 calc(45% - 20px); /* 2 per riga su tablet */
        max-width: calc(45% - 20px);
    }

    h2 {
        font-size: 1.6rem;
    }
}

/* Media query per mobile */
@media (max-width: 480px) {
    .step-container {
        max-width: 100%;
    }
    .roof-option {
        flex: 1 1 calc(45% - 10px); /* 2 per riga su mobile */
        max-width: calc(45% - 10px);
    }

    .roof-option img {
        object-fit: cover;
    }

    h2 {
        font-size: 1.4rem;
    }
}

/* Contenitore principale dello step 3 */
#step3-container {
    max-width: 800px;
    margin: 30px auto;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Titolo */
#step3-container h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #0285c7;
}

/* Risultati */
.results p {
    font-size: 1.2rem;
    margin: 10px 0;
    line-height: 1.5;
    text-align: center;
}

.results strong {
    color: #0285c7;
}

/* Pulsante Contattaci */
.button-container {
    text-align: center;
    margin-top: 30px;
}

.button-container button {
    padding: 12px 30px;
    font-size: 18px;
    color: white;
    background-color: #0285c7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.button-container button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.button-container button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Contenitore dei risultati */
.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Box di ogni risultato */
.result-box {
    background: #f9f9f9;
    border: 2px solid #ececec;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-box:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
}

/* Testo descrittivo */
.result-box p {
    font-size: 0.8rem;
    color: #333;
    margin: 0 0 10px;
}

/* Valore calcolato */
.result-box strong {
    font-size: 1.5rem;
    color: #0563af;
    display: block;
    text-align: center;
    margin: 5px 0;
}

/* Unità di misura */
.result-box span {
    font-size: 1rem;
    display: flex;
    place-content: center;
    color: #777;
}

/* Stile per il container del preview dell'immagine */
.roof-preview {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.roof-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #ccc;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.roof-preview img:hover {
    transform: scale(1.05);
    border-color: #0285c7;
}

/* Stile per il messaggio di successo */
.success-message {
    margin: 15px 0;
    padding: 15px;
    background-color: #d4edda; /* Verde chiaro */
    color: #155724; /* Verde scuro */
    border: 1px solid #c3e6cb; /* Bordo verde chiaro */
    border-radius: 5px;
    font-size: 1rem;
    text-align: center;
    font-weight: bold;
}
