/* step progressbar GENERALE*/
.root-step-value {
    position: relative;
    width: 80%;
    margin: 30px auto;
    padding-bottom: 60px;
}

.top-step-container {
    width: 100%;
    padding-top: 10px;
    position: relative;
    z-index: 1;
}

ul {
list-style-type: none;
margin: 0;
padding: 0;
}

/* first step progressbar */

.first-step-progressbar{
    counter-reset: step;
}

.first-step-progressbar li {
float: left;
width: 33%;
position: relative;
text-align: center;
}

.first-step-progressbar li:before{
    content:counter(step);
    counter-increment: step;
    width: 30px;
    height: 30px;
    border: 2px solid #bebebe;
    display: block;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    line-height: 27px;
    background: white;
    color: #bebebe;
    text-align: center;
    font-weight: bold;
}

.first-step-progressbar li:after{
content: '';
position: absolute;
width:100%;
height: 3px;
background: #979797;
top: 15px;
left: -50%;
z-index: -1;
}

.first-step-progressbar li:first-child:after{
content: none;
}

.first-step-progressbar li.active:before {
    border-color: #3aac5d;
    background-color: #3aac5d;
    color: white;
}

.first-step-progressbar li.active:after {
    background-color: #3aac5d;
}

/* Seconda step bar */
.second-step-progressbar {
    counter-reset: step2;
}

.second-step-progressbar li {
    float: left;
    width: 33%;
    position: relative;
    text-align: center;
}

.second-step-progressbar li:before {
    content: attr(data-step);
    counter-increment: none;
    width: 50px;
    height: 50px;
    border: 2px solid #bebebe;
    display: block;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    line-height: 46px;
    background: white;
    color: #bebebe;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

.second-step-progressbar li:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: #979797;
    top: 25px;
    left: -50%;
    z-index: -1;
}

.second-step-progressbar li:first-child:after {
    content: none;
}

.second-step-progressbar li:first-child:before {
    border-color: #ff6b6b;
}

.second-step-progressbar li:last-child:before {
    border-color: #3aac5d;
}

.second-step-progressbar li.active:before {
    border-color: #3aac5d;
    background-color: #3aac5d;
    color: white;
}

.second-step-progressbar li.active:after {
    background-color: #3aac5d;
}

.main-header {
    min-height: 12vh;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.main-content {
    min-height: 70vh;
    margin-bottom: 30px;
}

.main-footer {
    min-height: 10vh;
    /*background-color: #e0dcdc;*/
    width: 100%;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 20px 0;
}

.main-footer p {
    margin: 0;
    color: #6c757d;
    text-align: center;
}

#first-header {
    position: relative;
    z-index: 99;
    text-align: center; 
    font-size: 2rem; 
    font-weight: bold; 
    margin: 0px auto 40px;
    display: block;
}

#first-header-text {
    display: block;
    margin-top: 20px;
}

#valutazione-header {
    text-align: center; 
    font-size: 14px; 
    font-weight: bold; 
    margin: 15px auto 20px;
}

#valutazione-header .root-step {
    width: 80%;
}

#valutazione-header-text {
    font-size: 18px;
    font-weight: bold;
}

.value-title {
    font-size: 2rem;
    text-align: center;
    font-weight: bold;
}

.steps-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 0 20px;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background-color: #e0e0e0;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.step-text {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.step.active .step-number {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.step.active .step-text {
    color: #28a745;
}



.form-container {
    max-width: 600px;
    margin: -30px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1001;
}



.form-step {
    margin-bottom: 20px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 600;
}

select {
    margin-bottom: 15px;
}

.form-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.loading {
    position: relative;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-prosegui {
    width: 100%;
    padding: 12px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 500;
}

.btn-prosegui:hover {
    background-color: #34495e;
}

.btn-prosegui:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#valuta-ora {
    width: 250px;
    padding: 12px 30px;
}

.overlay-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.map-container {
    height: 180px;
    width: 100%;
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}


.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: 38px !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

#second-step-container {
    margin: 15px auto 80px;
}

/* Stili per intl-tel-input */
.iti {
    width: 100%;
}

.iti__flag {
    background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/img/flags.png");
}

.arrow-down {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 25px solid #ff0000;
    margin: 10px auto;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.cta_alert {
    color: #ff0000;
    font-weight: bold;
    font-size: 1.5em;
    text-align: center;
    margin: 15px 0;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .iti__flag {
        background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/img/flags@2x.png");
    }
}

/* mobile */
@media screen and (max-width: 768px) {
    .root-step {
        width: 100% !important;
        margin: 0 !important;
        padding-bottom: 60px !important;
    }
}

/* desktop */
@media screen and (min-width: 769px) {
    .root-step {
        position: relative;
        width: 50% !important;
        margin: 30px auto;
        padding-bottom: 60px;
    }
}


