.d4ca-wpforms,
.d4ca-wpforms * {
    box-sizing: border-box;
}

.d4ca-wpforms .wpforms-container {
    max-width: 100%;
}

.d4ca-wpforms input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
.d4ca-wpforms select,
.d4ca-wpforms textarea {
    max-width: 100% !important;
}

.d4ca-wpforms-button-full-yes .d4ca-wpforms button.wpforms-submit {
    width: 100% !important;
}

/* Submit button icon (see widgets/class-wpforms-widget.php). An uploaded
   SVG is rendered as a mask-image pseudo-element directly on WPForms' own
   real <button> — a per-instance <style> tag sets that up, this stylesheet
   only needs to be there to size/position/colour it via the Icon
   controls — so it's genuinely part of the button, not a separate
   element, and needs none of the rules below.

   The rules below are the fallback used only for a font-library icon
   (Font Awesome etc.), which can't be expressed as a mask-image: WPForms
   gives no way to inject real markup inside its own <button>, only two
   action hooks that echo beside it, so that icon is a DOM sibling,
   absolutely positioned over the button's edge rather than truly inside
   it. It sits above the button (z-index) but ignores clicks
   (pointer-events: none) so the button underneath stays fully clickable
   through it. Only applies when an icon is actually set (the
   "has-btn-icon" modifier), so a form with no icon is completely
   unaffected. If the icon overlaps the button's own text, increase the
   button's Padding on that side (see Icon Spacing's description above) —
   there's no way to reserve that space automatically without fighting the
   Padding control. */
.d4ca-wpforms-has-btn-icon .wpforms-submit-container {
    position: relative;
    display: inline-block;
}

.d4ca-wpforms-button-full-yes.d4ca-wpforms-has-btn-icon .wpforms-submit-container {
    display: block;
    width: 100%;
}

.d4ca-wpforms-btn-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
}

.d4ca-wpforms-btn-icon-before {
    left: 16px;
}

.d4ca-wpforms-btn-icon-after {
    right: 16px;
}

.d4ca-wpforms-btn-icon i,
.d4ca-wpforms-btn-icon svg {
    display: block;
}

/* Optional fully custom checkbox/radio appearance. */
.d4ca-custom-choice-yes .d4ca-wpforms input[type="checkbox"],
.d4ca-custom-choice-yes .d4ca-wpforms input[type="radio"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    position: relative;
    display: inline-grid !important;
    place-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0 8px 0 0 !important;
    padding: 0 !important;
    border: 1px solid #b8bcc2;
    background: #fff;
    color: #fff;
    vertical-align: middle;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.d4ca-custom-choice-yes .d4ca-wpforms input[type="checkbox"] {
    border-radius: 3px;
}

.d4ca-custom-choice-yes .d4ca-wpforms input[type="checkbox"]:checked::after {
    content: "";
    width: 32%;
    height: 58%;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-5%, -8%);
    transform-origin: center;
}

.d4ca-custom-choice-yes .d4ca-wpforms input[type="radio"] {
    border-radius: 50%;
}

.d4ca-custom-choice-yes .d4ca-wpforms input[type="radio"]:checked::after {
    content: "";
    width: 44%;
    height: 44%;
    border-radius: 50%;
    background: currentColor;
}

.d4ca-custom-choice-yes .d4ca-wpforms input[type="checkbox"]:focus-visible,
.d4ca-custom-choice-yes .d4ca-wpforms input[type="radio"]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Keep WPForms honeypots inaccessible if delayed JS momentarily misses its inline style. */
.d4ca-wpforms .wpforms-field > label[aria-hidden="true"] + input[aria-hidden="true"][tabindex="-1"] {
    position: absolute !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* D4 WPForms focus compatibility.
 * Keep WPForms Modern's built-in blue focus accent from sitting over the
 * Elementor focus styles. Scoped to D4 WPForms only.
 */
.d4ca-wpforms {
    --wpforms-field-focus-color: transparent;
}

.d4ca-wpforms input:focus,
.d4ca-wpforms input:focus-visible,
.d4ca-wpforms select:focus,
.d4ca-wpforms select:focus-visible,
.d4ca-wpforms textarea:focus,
.d4ca-wpforms textarea:focus-visible {
    outline: none !important;
}
