/************ DRAWER FORM DI CONTATTO **************/
.contact-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .3s ease;
}

.contact-drawer-overlay.is-open {
    opacity: 1;
}

.contact-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    width: min(460px, 100%);
    padding: 28px;
    overflow-y: auto;
    background: #fff;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .2);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
}

.contact-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s ease, visibility 0s;
}

.contact-drawer:focus {
    outline: none;
}

body.contact-drawer-lock {
    overflow: hidden;
}

.contact-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.contact-drawer-head h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
}

.contact-drawer-head p {
    margin: 0;
    color: #5b6b85;
    font-size: 15px;
}

.contact-drawer-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid var(--main-color);
    border-radius: 0;
    background: #fff;
    color: var(--main-color);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.contact-drawer-close:hover,
.contact-drawer-close:focus-visible {
    background: var(--main-color);
    color: #fff;
}

/* campi */
.cd-field {
    margin-bottom: 18px;
}

.cd-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.cd-field label span {
    font-weight: 300;
    color: #5b6b85;
}

.cd-field input[type="text"],
.cd-field input[type="email"],
.cd-field input[type="tel"],
.cd-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #cfd8e3;
    border-radius: 0;
    background: #fff;
    font: inherit;
    font-size: 16px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.cd-field textarea {
    resize: vertical;
}

.cd-field input:focus,
.cd-field textarea:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(6, 175, 175, .2);
}

.cd-field.has-error input,
.cd-field.has-error textarea {
    border-color: #dc2626;
}

.cd-error {
    display: none;
    margin: 6px 0 0;
    color: #dc2626;
    font-size: 13px;
}

.cd-field.has-error .cd-error {
    display: block;
}

.cd-consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.45;
}

.cd-consent input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--main-color);
}

.cd-consent a {
    color: var(--main-color);
}

/* honeypot fuori schermo (non display:none, così i bot lo compilano) */
.cd-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cd-status {
    display: none;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-left: 4px solid #dc2626;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
}

.cd-status.is-visible {
    display: block;
}

.cd-submit {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border: 0;
    border-radius: 0;
    background: var(--main-color);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background-color .2s ease, opacity .2s ease;
}

.cd-submit:hover {
    background: #049595;
}

.cd-submit:focus-visible {
    outline: 3px solid var(--main-color);
    outline-offset: 2px;
}

.cd-submit:disabled {
    opacity: .6;
    cursor: wait;
}

/* conferma di invio */
.contact-drawer-done {
    margin: auto 0;
    text-align: center;
}

.contact-drawer-done i {
    margin-bottom: 14px;
    color: var(--main-color);
    font-size: 56px;
}

.contact-drawer-done h3 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
}

.contact-drawer-done p {
    margin: 0 0 24px;
    color: #5b6b85;
}

@media (max-width: 575px) {
    .contact-drawer {
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-drawer,
    .contact-drawer-overlay {
        transition: none;
    }
}

/* riepilogo precompilato (sola lettura) */
.cd-summary {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--main-color);
    background: var(--light-color);
    font-size: 14px;
}

.cd-summary-title {
    margin: 0 0 6px;
    font-weight: 600;
}

.cd-summary ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
