/* UX-007: scoped to CF7 140 and 1223. */
.wpcf7 .tq-lead-form {
    --tq-label: #172b3a;
    --tq-primary: #0065a8;
    --tq-error: #a51d2d;
    color: var(--tq-label);
    font-size: 16px;
    line-height: 1.5;
}
@media (max-width: 480px) {
    /* Keep the native Turnstile minimum width inside the Contacto form panel. */
    .elementor-widget-container:has(> .contacto-normal .tq-lead-form) { padding: 8px !important; }
}
.tq-lead-form .tq-form-intro { margin-bottom: 20px; }
.tq-lead-form .tq-form-intro h2 {
    color: inherit;
    font-family: inherit;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: normal;
    margin: 0 0 10px;
}
.tq-lead-form .tq-form-intro p { color: inherit; margin: 0; line-height: 1.5; }
.tq-lead-form .tq-form-fields { display: grid; gap: 16px; }
.tq-lead-form .tq-form-field { min-width: 0; }
.tq-lead-form .tq-form-field label {
    display: block;
    margin: 0 0 6px;
    color: var(--tq-label);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}
.tq-lead-form .tq-form-field p { margin: 0; }
.tq-lead-form .tq-form-field br { display: none; }
.wpcf7 .tq-lead-form input.wpcf7-form-control:not([type=submit]),
.wpcf7 .tq-lead-form textarea.wpcf7-form-control {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid #b7c4cd;
    border-radius: 6px;
    background: #fff;
    color: #172b3a;
    font: inherit;
    line-height: 1.5;
}
.wpcf7 .tq-lead-form textarea.wpcf7-form-control { height: 116px; resize: vertical; }
.tq-lead-form .tq-form-turnstile { margin: 18px 0 12px; min-width: 0; }
.tq-lead-form .tq-form-privacy { margin: 0 0 16px; color: inherit; font-size: 13px; line-height: 1.5; }
.tq-lead-form .tq-form-privacy a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.tq-lead-form .tq-form-actions,
.tq-lead-form .tq-form-actions p { margin: 0; text-align: left; }
.wpcf7 .tq-lead-form input.wpcf7-submit {
    box-sizing: border-box;
    min-height: 50px !important;
    height: 50px !important;
    float: none !important;
    text-align: center !important;
    max-width: 100%;
    padding: 12px 20px !important;
    margin: 0;
    border: 1px solid var(--tq-primary) !important;
    border-radius: 6px !important;
    background: var(--tq-primary) !important;
    color: #fff !important;
    font: inherit !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    cursor: pointer;
}
.wpcf7 .tq-lead-form :is(input, textarea, a):focus-visible {
    outline: 3px solid var(--tq-primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px #fff;
}
.wpcf7 .tq-lead-form input.wpcf7-submit:hover { filter: brightness(.92); }
.wpcf7 .tq-lead-form .wpcf7-not-valid { border-color: var(--tq-error); }
.wpcf7 .tq-lead-form .wpcf7-not-valid-tip { color: var(--tq-error); font-size: 14px; line-height: 1.4; margin-top: 6px; }
.wpcf7 .tq-lead-form .wpcf7-response-output {
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0 0;
    font-size: 15px;
    line-height: 1.5;
    background: #fff;
    color: #172b3a;
}
.wpcf7 .tq-lead-form.sent .wpcf7-response-output { border-color: #257b48; }
#pum-817 .tq-lead-form { --tq-label: #fff; --tq-error: #fff; }
#pum-817 .tq-lead-form input.wpcf7-submit { background: #fff !important; color: var(--tq-primary) !important; border-color: #fff !important; }
#pum-817 .tq-lead-form :is(input, textarea, a):focus-visible { outline-color: #fff; box-shadow: 0 0 0 2px var(--tq-primary); }
/* Reserve the real scrollbar gutter; Popup Maker's fixed mode avoids its 15px overlay compensation. */
html.tq-quote-ready { scrollbar-gutter: stable; }
html.tq-quote-lock { overflow: hidden !important; scroll-behavior: auto !important; }
#pum-817.pum-overlay { overflow: hidden !important; overscroll-behavior: none; }
#pum-817 .pum-container {
    box-sizing: border-box; position: fixed !important;
    top: 50% !important; left: 50% !important; margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); max-height: calc(100dvh - 32px);
    max-width: calc(100% - 24px); padding: 44px 18px 14px;
    display: flex !important; flex-direction: column; overflow: hidden;
}
#pum-817 .pum-content {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 4px 6px; scrollbar-gutter: stable;
}
#pum-817 .tq-form-intro { margin-bottom: 14px; }
#pum-817 .tq-form-fields { gap: 12px; }
#pum-817 .tq-form-turnstile { margin: 12px 0; }
#pum-817 .tq-form-privacy { margin-bottom: 12px; }
#pum-817 .tq-lead-form textarea.wpcf7-form-control { height: 88px; }
#pum-817 .pum-close {
    position: absolute; top: 2px !important; right: 2px !important;
    min-width: 44px; min-height: 44px; z-index: 2;
}
#pum-817 .pum-close:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
@media (max-width: 600px) {
    #pum-817 .pum-container { width: calc(100% - 24px) !important; padding: 44px 6px 12px; }
    #pum-817 .tq-form-intro h2 { padding-right: 12px; }
    .wpcf7 .tq-lead-form input.wpcf7-submit { width: 100%; }
}

/* Desktop/tablet only: keep the final action visible within the single scroller. */
@media (min-width: 768px) {
    #pum-817 .pum-container { padding: 44px 18px 10px; }
    #pum-817 .pum-content {
        scroll-padding-block: 8px 82px;
    }
    #pum-817 .tq-form-intro { margin-bottom: 10px; }
    #pum-817 .tq-form-intro h2 { margin-bottom: 6px; }
    #pum-817 .tq-form-fields { gap: 10px; }
    #pum-817 .tq-lead-form textarea.wpcf7-form-control { height: 72px; }
    #pum-817 .tq-form-turnstile { margin: 10px 0 8px; }
    #pum-817 .tq-form-privacy { margin-bottom: 8px; }
    #pum-817 .tq-form-actions {
        position: sticky; bottom: -4px; z-index: 2;
        background: var(--tq-primary); padding: 8px 0;
        border-top: 1px solid rgba(255, 255, 255, .25);
        /* Remains in normal flow: the last fields and privacy can scroll fully above it. */
    }
    #pum-817 .tq-form-actions,
    #pum-817 .tq-form-actions p {
        display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
        margin: 0;
    }
    #pum-817 .tq-form-actions input.wpcf7-submit { margin: 0 !important; }
    #pum-817 .tq-form-actions .wpcf7-spinner { margin: 0; }
}
