/* Contact Form Popup */
#contactPopup {
    position: fixed;
    bottom: 55px;
    left: 20px;
    width: 400px;
    max-height: 85vh;
    background: lightgrey;
    border: 2px solid #000;
    padding: 1.5em;
    z-index: 99998;
    opacity: 0;
    transform: translateY(30px); /* Animazione più fluida */
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); /* Easing più elegante */
    overflow-y: auto;
    display: none;
}

#contactPopup.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Close X button */
.contact-close-x {
    position: absolute;
    top: 0.75em;
    right: 0.75em;
    background: lightgray;
    border: none;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #000;
    border-radius: 0;
}


/* Form Title */
.popup-form-title {
    font-size: 21px;
    margin-bottom: 1em;
    font-weight: 500;
    letter-spacing: -0.5px;
    padding-right: 30px;
}

/* Form Styles */
.popup-form-group {
    margin-bottom: 1.25em;
}

.popup-form-label {
    font-size: 14px;
    margin-bottom: 0.4em;
    display: block;
    color: #000;
}

.popup-form-control, 
.popup-form-select {
    width: 100%;
    background: lightgray;
    border: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    padding: 0.6em 0.8em;
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.popup-form-control:focus, 
.popup-form-select:focus {
    background: lightgray
    border-bottom: 2px solid #000; /* Solo ispessimento */
    outline: none;
    box-shadow: none; /* Rimuovi shadow */
}

.popup-form-control::placeholder {
    color: #999;
    opacity: 1;
}

.popup-form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7em center;
    background-size: 16px;
    padding-right: 2.5em;
}

textarea.popup-form-control {
    min-height: 80px;
    resize: vertical;
}

/* Checkbox */
.popup-form-check {
    display: flex;
    align-items: flex-start;
    margin: 1em 0;
    font-size: 12px;
}

.popup-form-check-input {
    width: 16px;
    height: 16px;
    margin-right: 0.5em;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.popup-form-check-label {
    color: #666;
    line-height: 1.3;
}

.popup-form-check-label a {
    color: #000;
    text-decoration: underline;
}

/* Submit Button */
.popup-btn-submit {
    width: 100%;
    background: transparent;
    color: #000;
    border: 1px solid #000;
    border-radius: 30px;
    padding: 0.75em;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5em;
}

.popup-btn-submit:hover {
    background: #000;
    color: #fff;
    transform: scale(1.02);
}

.popup-btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Alert Messages */
.popup-alert {
    padding: 0.6em;
    border-radius: 0;
    font-size: 12px;
    margin-top: 0.5em;
    text-align: center;
    display: none;
}

.popup-alert.show {
    display: block;
}

.popup-alert-success {
    background: rgba(0, 200, 81, 0.1);
    color: #00C851;
    border: 1px solid rgba(0, 200, 81, 0.2);
}

.popup-alert-error {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.popup-alert-warning {
    background: rgba(255, 187, 51, 0.1);
    color: #ffbb33;
    border: 1px solid rgba(255, 187, 51, 0.2);
}

/* Floating Trigger Button */
.contact-trigger-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 99997;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: none; /* Nascosto di default */
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.contact-trigger-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.contact-trigger-btn:hover {
    transform: scale(1.1);
    background: #333;
}

.contact-trigger-btn.hide {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

/* ===== THANK YOU PAGE STYLES ===== */

.thank-you-page {
    text-align: center;
    padding: 2em 0;
}

.thank-you-title {
    font-size: 36px;
    text-transform: uppercase;
    margin-bottom: 1em;
    font-weight: 400;
}

.thank-you-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 2em;
}

.thank-you-close {
    background: transparent;
    color: #000;
    border: 1px solid #000;
    border-radius: 30px;
    padding: 0.75em 2em;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.thank-you-close:hover {
    background: #000;
    color: #fff;
    transform: scale(1.02);
}

/* Mobile Responsive */
@media (max-width: 768px) {

    #contactPopup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 85vh;
        border-radius: 0;
        padding: 1.25em;
        transform: translateY(100%);
        transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    }
    
    #contactPopup.show {
        transform: translateY(0);
    }
    
    .popup-form-title {
        font-size: 21px;
    }
    
    .popup-form-control, .popup-form-select {
        font-size: 13px;
        padding: 0.6em 1em;
    }

    .popup-btn-submit {
        font-size: 13px;
        padding: 0.6em 1em;
    }
}

@media (max-width: 480px) {
    #contactPopup {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
}