/* =========================================================
   RESET
   ========================================================= */

   * {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: #f4f6f8;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}


/* =========================================================
   CONTENITORE
   ========================================================= */

.contenitore {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}


/* =========================================================
   HEADER
   ========================================================= */

.testata {
    background: #005b8f;
    color: #fff;
    border-bottom: 4px solid #e5a900;
}

.testata-contenuto {
    min-height: 90px;
    display: flex;
    align-items: center;
}

.testata-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.testata-logo {
    font-size: 24px;
    font-weight: bold;
    white-space: nowrap;
}

.testata-separatore {
    width: 1px;
    height: 35px;
    background: rgba(255, 255, 255, 0.5);
}

.testata-servizio {
    font-size: 20px;
}


/* =========================================================
   BARRA STEP
   ========================================================= */

.barra-step {
    background: #fff;
    border-bottom: 1px solid #d9dfe3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.barra-step .contenitore {
    padding-top: 15px;
    padding-bottom: 15px;
}

.barra-step-titolo {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 15px;
}

.barra-step-numero {
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

.barra-step-nome {
    font-size: 20px;
    font-weight: bold;
    color: #005b8f;
}


/* =========================================================
   PROGRESSIONE
   ========================================================= */

.barra-step-progressione {
    display: flex;
    width: 100%;
    gap: 4px;
}

.step {
    flex: 1;
    min-width: 0;
    position: relative;
    text-align: center;
}

.step-numero {
    width: 32px;
    height: 32px;
    margin: 0 auto 5px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 14px;
    font-weight: bold;

    background: #e3e7ea;
    color: #666;
}

.step-nome {
    display: block;

    font-size: 11px;
    line-height: 1.2;

    color: #777;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* STEP COMPLETATO */

.step.completato .step-numero {
    background: #005b8f;
    color: #fff;
}

.step.completato .step-nome {
    color: #005b8f;
}


/* STEP ATTIVO */

.step.attivo .step-numero {
    background: #e5a900;
    color: #fff;
}

.step.attivo .step-nome {
    color: #005b8f;
    font-weight: bold;
}


/* STEP FUTURO */

.step.futuro .step-numero {
    background: #e3e7ea;
    color: #777;
}


/* =========================================================
   MAIN
   ========================================================= */

main.contenitore {
    padding-top: 30px;
    padding-bottom: 40px;
}


/* =========================================================
   SCHEDA
   ========================================================= */

.scheda {
    background: #fff;

    padding: 30px;

    border: 1px solid #e0e4e7;
    border-radius: 6px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.scheda h1 {
    margin-top: 0;
    margin-bottom: 8px;

    color: #005b8f;

    font-size: 28px;
    line-height: 1.2;
}

.scheda h2 {
    margin-top: 30px;
    margin-bottom: 20px;

    color: #005b8f;

    font-size: 21px;
    line-height: 1.3;

    border-bottom: 1px solid #e1e5e8;
    padding-bottom: 8px;
}


/* =========================================================
   TESTI DI AIUTO
   ========================================================= */

.aiuto {
    margin-top: 0;
    margin-bottom: 30px;

    color: #666;
}


/* =========================================================
   CAMPI
   ========================================================= */

.campo {
    margin-bottom: 24px;
}

.titolo-campo {
    display: block;

    margin-bottom: 8px;

    font-weight: bold;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;

    padding: 11px 12px;

    border: 1px solid #b9c1c7;
    border-radius: 4px;

    background: #fff;
    color: #333;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #005b8f;

    box-shadow: 0 0 0 3px rgba(0, 91, 143, 0.12);
}

input[readonly] {
    background: #f1f3f5;
    color: #555;
}

textarea {
    resize: vertical;
    min-height: 100px;
}


/* =========================================================
   OPZIONI RADIO / CHECKBOX
   ========================================================= */

.opzioni {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opzione {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 13px 15px;

    border: 1px solid #d1d7dc;
    border-radius: 5px;

    background: #fff;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.opzione:hover {
    background: #f5f8fa;
    border-color: #8ea9b8;
}

.opzione input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.opzione span {
    flex: 1;
}


/* =========================================================
   BLOCCHI CONDIZIONALI
   ========================================================= */

.blocco-condizionale {
    margin-top: 25px;
    padding: 20px;

    background: #f8fafb;

    border-left: 4px solid #005b8f;
    border-radius: 3px;
}

.nascosto {
    display: none !important;
}


/* =========================================================
   RISULTATI AJAX
   ========================================================= */

.risultati-ajax {
    position: relative;
    z-index: 10;
}

.risultato-ajax {
    padding: 11px 12px;

    border: 1px solid #d5dadd;
    border-top: 0;

    background: #fff;

    cursor: pointer;
}

.risultato-ajax:first-child {
    border-top: 1px solid #d5dadd;
}

.risultato-ajax:hover {
    background: #eef5f8;
}


/* =========================================================
   ERRORI
   ========================================================= */

.errore {
    margin-top: 7px;

    color: #b00020;

    font-size: 14px;
    font-weight: bold;
}

.errore-campo {
    border-color: #b00020 !important;
    background: #fff8f8 !important;
}


/* =========================================================
   NAVIGAZIONE
   ========================================================= */

.navigazione {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-top: 35px;
    padding-top: 20px;

    border-top: 1px solid #e1e5e8;
}

.bottone {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 10px 22px;

    border: 1px solid transparent;
    border-radius: 4px;

    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.bottone-principale {
    background: #005b8f;
    color: #fff;
}

.bottone-principale:hover {
    background: #004a74;
}

.bottone-secondario {
    background: #fff;
    color: #005b8f;

    border-color: #005b8f;
}

.bottone-secondario:hover {
    background: #eef5f8;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    margin-top: 30px;

    background: #333;
    color: #fff;
}

.footer-contenuto {
    padding-top: 25px;
    padding-bottom: 25px;
}

.footer-comune {
    font-weight: bold;
    font-size: 17px;
}

.footer-servizio {
    margin-top: 5px;
    color: #ddd;
}

.footer-note {
    margin-top: 12px;
    color: #aaa;
    font-size: 13px;
}


/* =========================================================
   RIGHE
   ========================================================= */

.riga {
    display: flex;
    gap: 20px;
}

.riga > .campo {
    flex: 1;
}


/* =========================================================
   MESSAGGI
   ========================================================= */

.messaggio {
    padding: 14px 16px;

    margin-bottom: 20px;

    border-radius: 4px;
}

.messaggio-info {
    background: #eef5f8;
    border: 1px solid #c5dbe5;
    color: #24566b;
}

.messaggio-successo {
    background: #eef7ee;
    border: 1px solid #c9dfc9;
    color: #356035;
}

.messaggio-avviso {
    background: #fff8e5;
    border: 1px solid #ead79a;
    color: #735d00;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {

    .contenitore {
        padding-left: 15px;
        padding-right: 15px;
    }


    /* HEADER */

    .testata-contenuto {
        min-height: 75px;
    }

    .testata-brand {
        gap: 12px;
    }

    .testata-logo {
        font-size: 20px;
    }

    .testata-servizio {
        font-size: 16px;
    }

    .testata-separatore {
        height: 28px;
    }


    /* STEP */

    .barra-step .contenitore {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .barra-step-progressione {
        gap: 2px;
    }

    .step-nome {
        display: none;
    }

    .step-numero {
        width: 29px;
        height: 29px;

        font-size: 13px;
    }


    /* MAIN */

    main.contenitore {
        padding-top: 15px;
        padding-bottom: 25px;
    }


    /* SCHEDA */

    .scheda {
        padding: 20px 16px;
        border-radius: 4px;
    }

    .scheda h1 {
        font-size: 24px;
    }

    .scheda h2 {
        font-size: 19px;
    }


    /* RIGHE */

    .riga {
        flex-direction: column;
        gap: 0;
    }


    /* NAVIGAZIONE */

    .navigazione {
        margin-top: 25px;
    }

    .bottone {
        min-height: 46px;
        padding-left: 18px;
        padding-right: 18px;
    }

}


/* =========================================================
   SMARTPHONE PICCOLO
   ========================================================= */

@media (max-width: 380px) {

    body {
        font-size: 15px;
    }

    .testata-logo {
        font-size: 18px;
    }

    .testata-servizio {
        font-size: 14px;
    }

    .testata-separatore {
        display: none;
    }

    .barra-step-titolo {
        flex-direction: column;
        gap: 2px;
        margin-bottom: 10px;
    }

    .barra-step-nome {
        font-size: 18px;
    }

    .scheda {
        padding: 18px 13px;
    }

    .opzione {
        padding: 12px;
    }

}
.campo-errore {
    border-color: #b00020 !important;
}

input.campo-errore,
select.campo-errore,
textarea.campo-errore {
    border: 2px solid #b00020;
    background-color: #fff8f8;
}

.errore-campo {
    margin-top: 6px;
    color: #b00020;
    font-size: 14px;
    font-weight: 600;
}