/* *
 * Jet Form Builder overrides for nav-footer CTA + “expose shortcode” card.
 * Scope: .nav-footer-form-wrap, .expose-shortcode-wrap (same card; use both classes on the wrapper in HTML/PHP).
 * JFB v3 uses .jet-form-builder-row (not .jet-form-builder__row) and form.jet-form-builder. */
/* --- Default field labels (non-checkbox rows) --- */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__label-text {
    font-size: 12px !important;
    line-height: 1.2 !important;
}

/* --- Datenschutz * (row label): smaller — fields_label_tag="div" may omit __label-text --- */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) > .jet-form-builder__label {
    font-size: 10px !important;
    line-height: 1.25 !important;
    font-weight: 500;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) > .jet-form-builder__label .jet-form-builder__label-text {
    font-size: 10px !important;
    line-height: 1.25 !important;
    font-weight: 500;
}

/* --- Privacy / legal description: smaller, lighter --- */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) > .jet-form-builder__desc,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) > .jet-form-builder__desc p,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) > .jet-form-builder__desc li {
    font-size: 10px !important;
    line-height: 1.45 !important;
    font-weight: 400 !important;
    color: #71717a !important;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) > .jet-form-builder__desc a {
    color: #52525b !important;
    font-weight: 500 !important;
}

/* Generic desc (fallback) */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__desc,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__desc p,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) small {
    font-size: 12px !important;
    line-height: 1.35 !important;
}

/* --- Checkbox row layout --- */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__field-label.for-checkbox,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) label.for-checkbox {
    display: inline-flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    text-align: left !important;
}

/* Accent variables (JFB + native) */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap),
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field),
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__fields-group.checkradio-wrap,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__field-label.for-checkbox,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) label.for-checkbox {
    --jfb-accent: #9e3838 !important;
    --jfb-color-accent: #9e3838 !important;
    --jet-form-builder-accent: #9e3838 !important;
    --jfb-checkradio-input-checked-bgc: #9e3838 !important;
}

/* Native checkbox: brand red when checked (Chrome / Safari / Edge) */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder input[type="checkbox"] {
    accent-color: #9e3838 !important;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder input[type="checkbox"]:checked {
    accent-color: #9e3838 !important;
}

/* *
 * Hide native checkbox input — Jet draws a custom box on span::before.
 * Do not require .jet-form-builder__field on input (some builds omit it). */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) label.for-checkbox > input[type="checkbox"],
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) .jet-form-builder__field-label.for-checkbox input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    z-index: -1 !important;
    appearance: none !important;
}

/* Custom checkbox box (matches JFB checkbox.css structure) */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) .jet-form-builder__field-label.for-checkbox > span::before,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) label.for-checkbox > span::before {
    content: "" !important;
    display: inline-block !important;
    width: 0.95em !important;
    height: 0.95em !important;
    min-width: 12px !important;
    min-height: 12px !important;
    flex-shrink: 0 !important;
    margin-top: 0.15em !important;
    border: 1px solid #9e3838 !important;
    border-radius: 10% !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 50% 50% !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
}

/* JFB: adjacent sibling after input, plus :has() when DOM order differs */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) .jet-form-builder__field-label.for-checkbox :checked + span::before,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) label.for-checkbox :checked + span::before,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) .jet-form-builder__field-label.for-checkbox:has(input:checked) > span::before,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) label.for-checkbox:has(input:checked) > span::before {
    border-color: #9e3838 !important;
    background-color: #9e3838 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e") !important;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) .jet-form-builder__field-label.for-checkbox input:focus:not(:checked) + span::before,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) label.for-checkbox input:focus:not(:checked) + span::before {
    border-color: #9e3838 !important;
    box-shadow: 0 0 0 2px rgba(158, 56, 56, 0.25) !important;
}

/* Option label text next to box */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) .jet-form-builder__field-wrap.checkboxes-wrap label.for-checkbox > span {
    font-size: 11px !important;
    line-height: 1.35 !important;
    font-weight: 600;
    color: #3f3f46 !important;
}

/* Legacy JFB / JetEngine class names (keep if present) */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__input-check:checked + .jet-form-builder__check-mark,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) input[type="checkbox"]:checked + .jet-form-builder__check-mark,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__check-mark.is-checked {
    background: #9e3838 !important;
    background-color: #9e3838 !important;
    border-color: #9e3838 !important;
}

/* --- Submit button: centered label (Jet / theme control colors & weight) --- */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__submit-wrap {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder button.jet-form-builder__submit,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder .jet-form-builder__submit-wrap button[type="submit"],
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) button.jet-form-builder__submit,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__submit-wrap button[type="submit"],
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder button[type="submit"].jet-form-builder__submit {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background-color: #9e3838 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 1px solid #9e3838 !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder button.jet-form-builder__submit:hover,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder .jet-form-builder__submit-wrap button[type="submit"]:hover,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) button.jet-form-builder__submit:hover,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__submit-wrap button[type="submit"]:hover,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder button[type="submit"].jet-form-builder__submit:hover {
    background-color: #3f3f46 !important;
    background-image: none !important;
    border-color: #3f3f46 !important;
    color: #ffffff !important;
}

/* --- Card + fields full width --- */
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) {
    min-width: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__fields-group {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__field-wrap input:not([type="checkbox"]):not([type="radio"]),
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__field-wrap textarea,
:is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder__field-wrap select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile: name + email in WP Columns — pull rows close (stacked column gap + Jet row spacing) */
@media (max-width: 767px) {
    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .wp-block-columns.is-layout-flex,
    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .wp-block-columns {
        gap: 0.15rem !important;
        row-gap: 0.15rem !important;
        column-gap: 0.15rem !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .wp-block-columns[class*="wp-container-core-columns"] {
        gap: 0.15rem !important;
        row-gap: 0.15rem !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .wp-block-columns.is-layout-flex {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .wp-block-column {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .wp-block-column > .jet-form-builder-row,
    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .wp-block-column .jet-form-builder-row {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0.2rem !important;
        padding-bottom: 0.2rem !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) form.jet-form-builder {
        --jfb-row-mt: 0 !important;
        --jfb-row-mb: 0 !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row:is(.field-type-checkbox-field, .field-type-acceptance-field) {
        padding-top: 0.65rem !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row > .jet-form-builder__label {
        margin-top: 0 !important;
        margin-bottom: 0.2rem !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row > .jet-form-builder__label:empty {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    :is(.nav-footer-form-wrap, .expose-shortcode-wrap) .jet-form-builder-row > .jet-form-builder__desc:empty {
        display: none !important;
    }
}
