/* ==========================================================
   CONTACT FORM
   ========================================================== */

.contact-section { 
    position: relative;
    overflow: hidden;
}

/*.contact-section::before {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    top: -250px;
    left: -250px;
    border-radius: 50%;
    background: rgba(18, 82, 135, 0.04);
    pointer-events: none;
}*/

.contact-wrapper {
    position: relative;
    z-index: 0;
}


/* ==========================================================
   HEADER
   ========================================================== */

.contact-eyebrow {
    padding: .55rem .9rem;
    border-radius: 50rem;
    background: rgba(18, 82, 135, .08);
    color: #125287;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.contact-title {
    margin-top: 0 !important;
}

.contact-subtitle {
    max-width: 650px;
    line-height: 1.6;
}


/* ==========================================================
   CARD
   ========================================================== */

.contact-card {
    border-radius: 1.5rem;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(16, 24, 40, .03),
        0 8px 24px rgba(16, 24, 40, .06),
        0 24px 48px rgba(16, 24, 40, .06);
}


/* ==========================================================
   STEP HEADER
   ========================================================== */

/*.contact-step-header {
    background:
        linear-gradient(
            180deg,
            rgba(18, 82, 135, .04) 0%,
            rgba(18, 82, 135, 0) 100%
        );
}*/

.contact-step-label {
    color: #212529;
    font-size: 1rem;
}

.contact-step-counter {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    min-width: 58px;
    padding: .5rem .75rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 50rem;
    font-size: .85rem;
}

.contact-step-counter-current {
    color: #125287;
    font-weight: 700;
    font-size: 1rem;
}


/* ==========================================================
   PROGRESS
   ========================================================== */

.contact-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    width: 100%;
}

.contact-progress span {
    display: block;
    height: 5px;
    border-radius: 50rem;
    background: #e9ecef;
    transition:
        background-color .3s ease,
        transform .3s ease;
}

.contact-progress span.is-active {
    background: #125287;
}


/* ==========================================================
   FORM
   ========================================================== */

.contact-form-content {
    min-height: 360px;
}

.contact-step {
    animation: contactStepIn .3s ease;
}

@keyframes contactStepIn {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.contact-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    border-radius: 14px;

    background: rgba(18, 82, 135, .08);
    color: #125287;

    font-size: 1.3rem;
}

.contact-legend {
    float: none;
    width: auto;
    padding: 0;
    margin: 0;

    font-size: clamp(1.4rem, 2vw, 1.8rem);
    line-height: 1.2;
    font-weight: 600;
    color: #16181b;
}


/* ==========================================================
   SERVICE CARDS
   ========================================================== */

.contact-service-option {
    position: relative;
}

.contact-service-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.contact-service-card {
    position: relative;

    display: flex;
    align-items: flex-start;
    gap: 1rem;

    padding: 1.25rem;

    border: 1px solid #e6e8eb;
    border-radius: 1rem;

    background: #fff;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.contact-service-card:hover {
    border-color: rgba(18, 82, 135, .35);
    box-shadow: 0 10px 30px rgba(16, 24, 40, .07);
    transform: translateY(-2px);
}

.contact-service-icon {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    border-radius: 12px;

    background: #f4f6f8;
    color: #125287;

    font-size: 1.2rem;
    line-height: 1;

    transition:
        color .2s ease,
        background-color .2s ease;
}

.contact-service-content {
    display: flex;
    flex-direction: column;
    gap: .15rem;

    padding-right: 1.75rem;
}

.contact-service-title {
    display: block;

    color: #202124;

    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.contact-service-description {
    display: block;

    color: #6c757d;

    font-size: .875rem;
    line-height: 1.5;
}

.contact-service-check {
    position: absolute;
    top: 1rem;
    right: 1rem;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    border: 1px solid #dee2e6;
    border-radius: 50%;

    background: #fff;
    color: transparent;

    font-size: .75rem;

    transition:
        color .2s ease,
        border-color .2s ease,
        background-color .2s ease;
}


/* SELECTED */

.contact-service-input:checked + .contact-service-card {
    border-color: #125287;
    background: rgba(18, 82, 135, .035);
    box-shadow: 0 8px 24px rgba(18, 82, 135, .08);
}

.contact-service-input:checked
+ .contact-service-card
.contact-service-icon {
    background: #125287;
    color: #fff;
}

.contact-service-input:checked
+ .contact-service-card
.contact-service-check {
    border-color: #125287;
    background: #125287;
    color: #fff;
}

.contact-service-input:focus-visible + .contact-service-card {
    outline: 3px solid rgba(13, 110, 253, .25);
    outline-offset: 2px;
}


/* ==========================================================
   INPUTS
   ========================================================== */

.contact-form .form-label {
    margin-bottom: .6rem;
    color: #343a40;
}

.contact-input-group {
    border-radius: .875rem;
    transition:
        box-shadow .2s ease,
        border-color .2s ease;
}

.contact-input-group .input-group-text {
    min-width: 52px;
    justify-content: center;

    border-color: #dee2e6;
    border-right: 0;

    background: #fff;
    color: #6c757d;

    border-radius: .875rem 0 0 .875rem;
}

.contact-input-group .form-control {
    min-height: 56px;

    border-left: 0;
    border-color: #dee2e6;

    border-radius: 0 .875rem .875rem 0;

    box-shadow: none;
}

.contact-input-group .form-control:hover {
    border-color: #dedede !important;
}

.contact-input-group:focus-within {
    box-shadow: 0 0 0 .25rem rgba(18, 82, 135, .1);
}

.contact-input-group:focus-within .input-group-text,
.contact-input-group:focus-within .form-control {
    border-color: #125287;
}

.contact-input-group:focus-within .input-group-text {
    color: #125287;
}


/* ==========================================================
   TEXTAREA
   ========================================================== */

.contact-textarea {
    min-height: 150px;

    padding: 1rem;

    border-radius: .875rem;

    resize: vertical;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.contact-textarea:focus {
    border-color: #125287;
    box-shadow: 0 0 0 .25rem rgba(18, 82, 135, .1);
}


/* ==========================================================
   PRIVACY
   ========================================================== */

.contact-privacy {
    padding: 1rem 1.15rem;

    /*border: 1px solid #e9ecef;
    border-radius: .875rem;

    background: #f8f9fa;*/
}

.contact-privacy .form-check {
    display: flex;
    gap: .75rem;
}

.contact-privacy .form-check-input {
    flex: 0 0 auto;

    width: 1.15rem;
    height: 1.15rem;

    margin-top: .15rem;
}

.contact-privacy .form-check-label {
    color: #5f6368;
    font-size: .875rem;
    line-height: 1.5;
}

.contact-privacy a {
    color: #125287;
    font-weight: 500;
}


/* ==========================================================
   FOOTER
   ========================================================== */

/*.contact-form-footer {
    border-top: 1px solid #edf0f2;
    background: #fbfbfc;
}*/

.contact-btn-next,
.contact-btn-submit,
.contact-btn-back {
    min-height: 48px;
    padding-right: 1.35rem;
    padding-left: 1.35rem;

    border-radius: .75rem;

    font-weight: 600;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.contact-btn-next:hover,
.contact-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(18, 82, 135, .18);
}


/* ==========================================================
   TRUST
   ========================================================== */

.contact-trust i {
    color: #125287;
}


/* ==========================================================
   HONEYPOT
   ========================================================== */

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}


/* ==========================================================
   VALIDATION
   ========================================================== */

.contact-form .form-control.is-invalid {
    border-color: var(--bs-danger);
}

.contact-service-input.is-invalid + .contact-service-card {
    border-color: var(--bs-danger);
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 767.98px) {

    .contact-card {
        border-radius: 1.25rem;
    }

    .contact-form-content {
        min-height: auto;
    }

    .contact-service-card {
        padding: 1rem;
    }

    .contact-service-icon {
        width: 42px;
        height: 42px;
    }

    .contact-btn-next,
    .contact-btn-submit,
    .contact-btn-back {
        width: 100%;
    }

}


@media (max-width: 575.98px) {

    .contact-step-counter {
        min-width: auto;
    }

    .contact-service-description {
        font-size: .82rem;
    }

    .contact-legend {
        font-size: 1.35rem;
    }

}


/* ==========================================================
   ACCESSIBILITY
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .contact-step,
    .contact-service-card,
    .contact-service-icon,
    .contact-service-check,
    .contact-btn-next,
    .contact-btn-submit {
        animation: none !important;
        transition: none !important;
    }

}


/* Il campo Altro e gli step nascosti
   non devono occupare spazio. */
#contact-other-service-wrapper[hidden],
.contact-step[hidden] {
    display: none !important;
}

/* Campo dinamico Altro */
#contact-other-service-wrapper {
    width: 100%;
}

#contact-other-service {
    width: 100%;
}

/* Stato di errore */
#contact-other-service.is-invalid {
    border-color: #dc3545;
}

/* Progress bar */
.contact-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    width: 100%;
}

.contact-progress [data-step-indicator] {
    display: block;
    height: 5px;
    border-radius: 50rem;
    background-color: #e9ecef;
    transition: background-color .3s ease;
}

.contact-progress [data-step-indicator].is-active {
    background-color: #125287;
}

@media (prefers-reduced-motion: reduce) {
    .contact-progress [data-step-indicator] {
        transition: none;
    }
}