/*
 * Reboot Elementor Addons - WPForms Styler
 * Structural reset - minimal approach to maintain WPForms layout integrity.
 * All visual styling is handled by Elementor controls or preset classes.
 */

/* Make the OUTER Elementor widget div fill its column.
   Elementor outputs the widget as .elementor-widget-reboot-wpforms-styler
   with a max-width but no width, so it shrink-wraps instead of stretching to
   the parent container. Pin width:100% to fill the column; keep max-width so
   any intentional Elementor cap still applies. Mirrors the CF7 styler fix. */
.elementor-widget-reboot-wpforms-styler {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Inner wrapper + form fill the (now full-width) outer widget */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Neutralise WPForms CSS variables inside our widget so our direct
   Elementor color/font-size/line-height properties always win.
   WPForms uses these variables on labels, sublabels, and hints with
   high specificity (0,4,1+), which beats any direct property we set
   unless we also nullify the variable source. */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget {
    --wpforms-label-color: unset;
    --wpforms-label-sublabel-color: unset;
    --wpforms-label-size-sublabel-font-size: unset;
    --wpforms-label-size-sublabel-line-height: unset;
    --wpforms-label-description-color: unset;
    --wpforms-label-description-font-size: unset;
    --wpforms-label-description-line-height: unset;
}

/* Force WPForms internals transparent so our wrapper controls the look */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-form,
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-form p {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* Field spacing: apply margin to <p> wrappers so each field block is evenly spaced */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-form p {
    margin-bottom: 16px;
}

/* Remove margin from last <p> to avoid trailing gap */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-form p:last-child {
    margin-bottom: 0;
}

/* Reset fieldset but allow theme styles to show */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget fieldset {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 16px;
    margin: 0 0 16px 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget fieldset legend {
    padding: 0 0 8px 0;
    margin-bottom: 12px;
}

/* Form controls: full width, block display */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field input[type="text"],
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field input[type="email"],
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field input[type="url"],
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field input[type="tel"],
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field input[type="number"],
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field input[type="date"],
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field textarea,
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field select {
    width: 100%;
    box-sizing: border-box;
    display: block;
}

/* ===== CHECKBOX GROUP SPACING ===== */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field-checkbox .wpforms-field-item {
    display: block;
    margin-bottom: 8px;
    margin-right: 0;
}

/* ===== RADIO GROUP SPACING ===== */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field-radio .wpforms-field-item {
    display: block;
    margin-bottom: 8px;
    margin-right: 0;
}

/* Checkbox/radio input alignment within field item */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field-checkbox .wpforms-field-item label,
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field-radio .wpforms-field-item label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

/* Smooth transitions on interactive elements */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input:not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget textarea,
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget select {
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* Number Slider (input[type="range"]) — make the Background control visible.
   Range inputs paint a native track that hides the element background, so we
   forward the input's background-color onto the track pseudos in both engines.
   The thumb keeps a default look; users wanting thumb styling can add CSS. */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    padding: 0;
}
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
    background: inherit;
}
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: inherit;
}
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #666;
    margin-top: -5px;
    cursor: pointer;
}
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #666;
    cursor: pointer;
}

/* Checkbox & Radio — larger, square, and aligned */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="checkbox"],
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin: 0 6px 0 0;
    appearance: auto;
    -webkit-appearance: auto;
    cursor: pointer;
}

/* Radio button radius */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget input[type="radio"] {
    border-radius: 50%;
}

/* Submit button */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-submit {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    outline: none;
    margin-top: 8px;
    box-sizing: border-box;
    /* line-height: 1 keeps text vertically centered when custom padding is added,
       otherwise the inherited large line-height pushes text below center. */
    line-height: 1;
}

/* Center the submit button inside WPForms' wrapper so the Alignment control works.
   Modern WPForms wraps the submit in .wpforms-submit-container. */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-submit-container {
    text-align: left;
}

/* Visibility helpers */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget.hide-title h3 {
    display: none;
}

.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget.hide-description .wpforms-description {
    display: none;
}

/* Keep <select> readable across ALL presets.
   Select elements have native browser rendering quirks: large padding values and
   min-height push text off-center because the OS controls the internal layout. We
   must use small top/bottom padding that scales with font-size (1em), normal height,
   and explicit line-height so text stays vertically centered regardless of font size. */

/* Base scope */
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget .wpforms-field select,
.elementor-widget-reboot-wpforms-styler .reboot-wpforms-widget select {
    padding: 0.5em 2.5em 0.5em 1em !important;
    padding-right: 2.5em !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Preset scope: one class deeper to beat preset specificity (0,5,0 > 0,4,0) */
[class*="elementor-widget-reboot-wpforms-styler"][class*="reboot-wpforms-preset-"] .reboot-wpforms-widget .wpforms-field select,
[class*="elementor-widget-reboot-wpforms-styler"][class*="reboot-wpforms-preset-"] .reboot-wpforms-widget select {
    padding: 0.5em 2.5em 0.5em 1em !important;
    padding-right: 2.5em !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Elementor inline CSS scope - beat data-attr + wrapper specificity.
   When the user sets Input Height, it generates: [data-v5e1e..] .elementor-element-xxx
   .reboot-wpforms-widget .wpforms-field select { min-height: 60px !important; }
   We counter that with height: auto + proper padding so the select grows naturally. */
[data-id*=""] [class*="elementor-element"] .reboot-wpforms-widget .wpforms-field select,
[data-id*=""] [class*="elementor-element"] .reboot-wpforms-widget select {
    height: auto !important;
    min-height: 0 !important;
}
