/* Shared visual defaults for public form controls. Keep plugin layout and behavior. */
body.stk-form-controls {
    --stk-form-font: 'Manrope', Arial, sans-serif;
    --stk-form-surface: rgba(255, 255, 255, .82);
    --stk-form-text: #191b21;
    --stk-form-muted: #737780;
    --stk-form-border: #cbd0d3;
    --stk-form-radius: 8px;
    --stk-form-accent: #e62d2c;
    --stk-form-height: 44px;
    --stk-form-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%23555b65' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5'/%3E%3C/svg%3E");
}

body.stk-form-controls :is(
    input:not([type]), input[type='text'], input[type='email'],
    input[type='password'], input[type='tel'], input[type='url'],
    input[type='search'], input[type='number'], input[type='date'],
    input[type='datetime-local'], input[type='time'], input[type='month'],
    input[type='week'], textarea, select:not(.select2-hidden-accessible)
) {
    box-sizing: border-box;
    max-width: 100%;
    min-height: var(--stk-form-height);
    padding: 10px 14px !important;
    border: 1px solid var(--stk-form-border) !important;
    border-radius: var(--stk-form-radius) !important;
    background-color: var(--stk-form-surface) !important;
    color: var(--stk-form-text) !important;
    font-family: var(--stk-form-font) !important;
    font-size: 14px !important;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

body.stk-form-controls :is(input, textarea)::placeholder {
    color: var(--stk-form-muted);
    opacity: 1;
}

body.stk-form-controls textarea {
    min-height: 120px !important;
    resize: vertical;
}

body.stk-form-controls select:not(.select2-hidden-accessible):not([multiple]),
body.stk-form-controls #mefs_form select:not(.select2-hidden-accessible):not([multiple]) {
    -webkit-appearance: none !important;
    appearance: none !important;
    padding-right: 40px !important;
    background-image: var(--stk-form-select-arrow) !important;
    background-position: right 12px center !important;
    background-size: 20px 20px !important;
    background-repeat: no-repeat !important;
    cursor: pointer;
}

body.stk-form-controls select[multiple] {
    min-height: 120px;
    background-image: none;
}

/* The shared select arrow replaces Elementor's decorative arrow. */
body.stk-form-controls .elementor-select-wrapper::before,
body.stk-form-controls .elementor-select-wrapper .select-caret-down-wrapper {
    display: none;
}

body.stk-form-controls :is(input, textarea, select):not([type='hidden']):focus-visible,
body.stk-form-controls .select2-container:is(.select2-container--focus, .select2-container--open) .select2-selection {
    border-color: var(--stk-form-accent) !important;
    outline: 2px solid rgba(230, 45, 44, .25);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(230, 45, 44, .08) !important;
}

body.stk-form-controls :is(input, textarea, select)[aria-invalid='true'],
body.stk-form-controls .woocommerce-invalid :is(input, select, textarea),
body.stk-form-controls .wpcf7-not-valid {
    border-color: #c62828 !important;
    background-color: #fff7f5 !important;
}

body.stk-form-controls :is(input, textarea, select):disabled {
    color: #656a73 !important;
    background-color: #eceef0 !important;
    border-color: #d8dce0 !important;
    cursor: not-allowed;
    opacity: 1;
}

body.stk-form-controls :is(input, textarea)[readonly] {
    background-color: #f3f4f5 !important;
}

body.stk-form-controls :is(input[type='checkbox'], input[type='radio']) {
    accent-color: var(--stk-form-accent);
    cursor: pointer;
    vertical-align: middle;
}

body.stk-form-controls input[type='range'] {
    accent-color: var(--stk-form-accent);
}

body.stk-form-controls input[type='file'] {
    max-width: 100%;
    font-family: var(--stk-form-font);
    font-size: 14px;
    color: var(--stk-form-text);
}

body.stk-form-controls input[type='file']::file-selector-button {
    margin-right: 12px;
    padding: 10px 14px;
    background: #f3f4f5;
    border: 1px solid var(--stk-form-border);
    border-radius: var(--stk-form-radius);
    color: var(--stk-form-text);
    font: inherit;
    cursor: pointer;
}

/* Primary actions; preserve the widths chosen by each form. */
body.stk-form-controls :is(button[type='submit'], input[type='submit'], input[type='button']) {
    min-height: var(--stk-form-height);
    padding: 12px 20px;
    border: 1px solid var(--stk-form-accent) !important;
    border-radius: var(--stk-form-radius) !important;
    background: linear-gradient(110deg, #f0312d, #e62d2c) !important;
    color: #fff !important;
    font-family: var(--stk-form-font) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s;
}

body.stk-form-controls :is(button[type='submit'], input[type='submit'], input[type='button']):not(:disabled):not(.disabled):hover {
    background: #cc2424 !important;
    border-color: #cc2424 !important;
    box-shadow: 0 3px 10px rgba(230, 45, 44, .16);
}

body.stk-form-controls :is(button[type='submit'], input[type='submit'], input[type='button']):is(:disabled, .disabled) {
    background: #b14c46 !important;
    border-color: #b14c46 !important;
    color: #fff !important;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 1;
}

body.stk-form-controls :is(button[type='submit'], input[type='submit'], input[type='button']):focus-visible {
    outline: 2px solid var(--stk-form-accent);
    outline-offset: 3px;
}

/* SelectWoo/Select2 keep their native search, selection and accessibility behavior. */
body.stk-form-controls .select2-container .select2-selection {
    box-sizing: border-box;
    min-height: var(--stk-form-height);
    border: 1px solid var(--stk-form-border) !important;
    border-radius: var(--stk-form-radius) !important;
    background-color: var(--stk-form-surface) !important;
    color: var(--stk-form-text);
    font-family: var(--stk-form-font);
    font-size: 14px;
}

body.stk-form-controls .select2-container .select2-selection--single {
    height: var(--stk-form-height);
    background-image: var(--stk-form-select-arrow) !important;
    background-position: right 12px center !important;
    background-size: 20px 20px !important;
    background-repeat: no-repeat !important;
}

body.stk-form-controls .select2-container .select2-selection--single .select2-selection__rendered {
    padding-left: 14px;
    padding-right: 36px;
    color: var(--stk-form-text);
    line-height: calc(var(--stk-form-height) - 2px);
}

body.stk-form-controls .select2-container .select2-selection--single .select2-selection__arrow {
    display: none;
}

body.stk-form-controls .select2-container .select2-selection--multiple {
    padding: 4px 8px;
}

body.stk-form-controls .select2-container.select2-container--disabled .select2-selection {
    background-color: #eceef0 !important;
    border-color: #d8dce0 !important;
    cursor: not-allowed;
}

body.stk-form-controls .select2-container.select2-container--disabled .select2-selection__rendered {
    color: #656a73;
}

body.stk-form-controls .select2-dropdown {
    border: 1px solid var(--stk-form-border);
    border-radius: var(--stk-form-radius);
    background: #fff;
    color: var(--stk-form-text);
    font-family: var(--stk-form-font);
    box-shadow: 0 8px 24px rgba(25, 27, 33, .12);
}

body.stk-form-controls .select2-results__option--highlighted[aria-selected],
body.stk-form-controls .select2-results__option--highlighted[aria-selected='true'] {
    background-color: var(--stk-form-accent);
    color: #fff;
}

/* Search fields inside Select2 are compact and never replace the hidden select. */
body.stk-form-controls .select2-search--inline input.select2-search__field {
    min-height: 30px;
    padding: 2px 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.stk-form-controls input[type='search']::-webkit-search-cancel-button {
    cursor: pointer;
}

@media (max-width: 767px) {
    body.stk-form-controls :is(input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='url'], input[type='search'], input[type='number'], input[type='date'], input[type='datetime-local'], input[type='time'], input[type='month'], input[type='week'], textarea, select:not(.select2-hidden-accessible)) {
        font-size: 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.stk-form-controls :is(input, textarea, select, button) {
        transition: none !important;
    }
}
