body.wpcf7-popup-active::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* Popup container */
.wpcf7-popup-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    color: #333;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.wpcf7-popup-message.no-border-radius{
    border-radius: 0 !important;
}

/* Pulsante di chiusura */
span.wpcf7-close-popup {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}

button.wpcf7-close-popup {
    margin-top:15px;
}

span.wpcf7-close-popup:hover {
    color: #000;
}

/* Messaggio di CF7 */
.wpcf7-popup-message .wpcf7-response-output {
    margin: 1rem 0 0;
    border: none;
    background: transparent;
    font-size: 1rem;
}

/* Animazione fade-in */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

#cf7-smart-popup-show-on-success {
   display: none;
}



/**Ajax loader */

body:has(.uacf7-ajax-loader):has(.is-active),
body:has(.submitting):has(.wpcf7-spinner) {
    position: relative;
}

body:has(.uacf7-ajax-loader):has(.is-active)::after,
body:has(.submitting):has(.wpcf7-spinner)::after{
    content: "";
    position: fixed !important;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    z-index: 10;
}
.wpcf7-spinner {
    position: fixed !important;
    background-color: #a19981;
    opacity: 0.75;
    width: 44px;
    height: 44px;
    top: 30%;
    left: calc(50% - 44px);
    z-index:99;
}
.wpcf7-spinner::before{
    transform-origin: 15px 15px;
}