/* Use the same control palette across Fundify screens and embedded public forms. */
.fundify-controls-admin #wpbody-content,
.fundify-checkbox-group,
.fundify-panel-login,
.premium-auth-wrapper #form-login-driver,
.anonymous-checkbox-wrapper {
    --fundify-control-accent: #08796d;
    --fundify-control-accent-deep: #075f57;
    --fundify-control-focus: #08796d;
    --fundify-control-surface: #fff;
    --fundify-control-edge: #82968f;
    --fundify-control-track: #778a85;
    --fundify-control-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8 3 3 6-6.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --fundify-control-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

html[data-fundify-appearance="dark"] .fundify-controls-admin #wpbody-content {
    --fundify-control-focus: #5eead4;
    --fundify-control-surface: #202e46;
    --fundify-control-edge: #899bb5;
    --fundify-control-track: #637794;
}

:is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
input[type="checkbox"]:not(:where([role="switch"], .switch *, .ios-toggle *, .ios-toggle-wrap *, .fp-email-switch *)) {
    -webkit-appearance: none;
    appearance: none;
    inline-size: 19px;
    block-size: 19px;
    min-inline-size: 19px;
    flex: 0 0 19px;
    vertical-align: middle;
    box-sizing: border-box;
    border: 1px solid var(--fundify-control-edge);
    border-radius: 6px;
    background: var(--fundify-control-surface);
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 8%);
    cursor: pointer;
    transition: background-color .16s, border-color .16s, box-shadow .16s;
}

:is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
input[type="checkbox"]:not(:where([role="switch"], .switch *, .ios-toggle *, .ios-toggle-wrap *, .fp-email-switch *))::before {
    content: none;
}

:is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
input[type="checkbox"]:not(:where([role="switch"], .switch *, .ios-toggle *, .ios-toggle-wrap *, .fp-email-switch *)):is(:checked, :indeterminate) {
    border-color: var(--fundify-control-accent-deep);
    background: var(--fundify-control-tick) center / 14px no-repeat,
        linear-gradient(150deg, var(--fundify-control-accent), var(--fundify-control-accent-deep));
}

:is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
input[type="checkbox"]:not(:where([role="switch"], .switch *, .ios-toggle *, .ios-toggle-wrap *, .fp-email-switch *)):indeterminate {
    background-image: var(--fundify-control-dash),
        linear-gradient(150deg, var(--fundify-control-accent), var(--fundify-control-accent-deep));
}

.fundify-controls-admin #wpbody-content input[type="checkbox"][role="switch"] {
    --fundify-switch-on: var(--fundify-control-accent);
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 38px;
    inline-size: 38px;
    block-size: 22px;
    min-inline-size: 38px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--fundify-control-track);
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color .16s;
}

.fundify-controls-admin #wpbody-content input[type="checkbox"][role="switch"]::before {
    content: "";
    display: block;
    margin: 0;
    float: none;
    position: absolute;
    inset-block-start: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgb(15 23 42 / 30%);
    transition: inset-inline-start .16s;
}

.fundify-controls-admin #wpbody-content input[type="checkbox"][role="switch"]:checked {
    background: var(--fundify-switch-on);
}
.fundify-controls-admin #wpbody-content input[type="checkbox"][role="switch"]:checked::before {
    inset-inline-start: 18px;
}
.fundify-controls-admin #wpbody-content input#fundify-device-block-toggle {
    --fundify-switch-on: #b91c1c;
}

:is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
input[type="checkbox"]:disabled {
    opacity: .48;
    cursor: not-allowed;
}

:is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
input[type="checkbox"]:focus-visible,
:is(.fundify-controls-admin #wpbody-content, .anonymous-checkbox-wrapper)
input[type="checkbox"]:focus-visible + :is(.slider, .ios-slider, .ios-toggle, .fp-email-slider, .fundify-toggle-switch) {
    outline: 2px solid var(--fundify-control-focus);
    outline-offset: 3px;
}

/* Existing composite toggles keep their own hit area and label behavior. */
.fundify-controls-admin #wpbody-content input[type="checkbox"]:checked + :is(.slider, .ios-slider, .ios-toggle, .fp-email-slider) {
    background-color: var(--fundify-control-accent);
}

.fundify-controls-admin #wpbody-content .fundify-payment-card-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
}
.fundify-controls-admin #wpbody-content .fundify-checkout-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fundify-controls-admin #wpbody-content #tab-checkout {
    --fundify-checkout-field: #f6f8fb;
    --fundify-checkout-edge: #d9e2e8;
    --fundify-checkout-text: #1d2939;
    --fundify-checkout-hover: #fff;
    --fundify-checkout-delete: #9f3542;
    --fundify-checkout-delete-bg: #fff3f4;
    --fundify-checkout-delete-edge: #f7d7de;
}
html[data-fundify-appearance="dark"] .fundify-controls-admin #wpbody-content #tab-checkout {
    --fundify-checkout-field: #202e46;
    --fundify-checkout-edge: #465873;
    --fundify-checkout-text: #edf2fc;
    --fundify-checkout-hover: #263650;
    --fundify-checkout-delete: #ffc2cd;
    --fundify-checkout-delete-bg: #402b3d;
    --fundify-checkout-delete-edge: #6f4457;
}
.fundify-controls-admin #wpbody-content #tab-checkout .fundify-checkout-row :is(input[type="number"], input[type="text"], select, .button),
.fundify-controls-admin #wpbody-content #tab-checkout [data-checkout-add] {
    min-height: 40px;
    border: 1px solid var(--fundify-checkout-edge);
    border-radius: 12px;
    background-color: var(--fundify-checkout-field);
    color: var(--fundify-checkout-text);
    box-shadow: none;
    transition: background-color .16s, border-color .16s;
}
.fundify-controls-admin #wpbody-content #tab-checkout .fundify-checkout-row :is(input[type="number"], input[type="text"], select) {
    padding-inline-start: 11px;
}
.fundify-controls-admin #wpbody-content #tab-checkout .fundify-checkout-provider {
    display: block;
    position: relative;
    margin-top: 4px;
}
.fundify-controls-admin #wpbody-content #tab-checkout .fundify-checkout-provider select {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-inline-start: 46px;
    text-overflow: ellipsis;
}
.fundify-controls-admin #wpbody-content #tab-checkout .fundify-checkout-provider-logo {
    position: absolute;
    z-index: 1;
    inset-inline-start: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 20px;
    padding: 2px;
    box-sizing: border-box;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    pointer-events: none;
}
.fundify-controls-admin #wpbody-content #tab-checkout .fundify-checkout-row input::placeholder {
    color: #68798a;
}
html[data-fundify-appearance="dark"] .fundify-controls-admin #wpbody-content #tab-checkout input::placeholder {
    color: #b8c5d9;
}
.fundify-controls-admin #wpbody-content #tab-checkout [data-checkout-remove] {
    color: var(--fundify-checkout-delete);
    background-color: var(--fundify-checkout-delete-bg);
    border-color: var(--fundify-checkout-delete-edge);
}
.fundify-controls-admin #wpbody-content #tab-checkout :is(input[type="number"], input[type="text"], select, .button):focus {
    border-color: var(--fundify-control-focus);
    box-shadow: none;
    outline: none;
}
.fundify-controls-admin #wpbody-content #tab-checkout :is(.button:hover, input[type="number"]:focus, input[type="text"]:focus, select:focus) {
    background-color: var(--fundify-checkout-hover);
}
.fundify-controls-admin #wpbody-content #tab-checkout :is(.button, input[type="radio"]):focus-visible,
.fundify-controls-admin #wpbody-content .fundify-checkout-nav:focus-visible {
    outline: 2px solid var(--fundify-control-focus);
    outline-offset: 2px;
}

.fundify-controls-admin #wpbody-content #tab-checkout :is(input[type="number"], input[type="text"], select):focus-visible {
    box-shadow: inset 0 0 0 1px var(--fundify-control-focus);
}
.fundify-controls-admin #wpbody-content #tab-checkout [data-checkout-remove]:hover {
    background-color: var(--fundify-checkout-delete-bg);
    border-color: var(--fundify-checkout-delete);
}
.anonymous-checkbox-wrapper .fundify-toggle-switch {
    background-color: var(--fundify-control-track);
    transition: background-color .16s;
}

@media (prefers-reduced-motion: reduce) {
    :is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
    input[type="checkbox"],
    .fundify-controls-admin #wpbody-content input[type="checkbox"][role="switch"]::before,
    .fundify-controls-admin #wpbody-content #tab-checkout :is(input, select, .button),
    .anonymous-checkbox-wrapper .fundify-toggle-switch,
    .anonymous-checkbox-wrapper .fundify-toggle-switch::after,
    .fundify-controls-admin #wpbody-content :is(.switch .slider, .ios-toggle .ios-slider, .ios-toggle-wrap .ios-toggle, .fp-email-switch .fp-email-slider),
    .fundify-controls-admin #wpbody-content :is(.switch .slider, .ios-toggle .ios-slider, .ios-toggle-wrap .ios-toggle, .fp-email-switch .fp-email-slider)::before,
    .fundify-controls-admin #wpbody-content .ios-toggle-wrap .ios-toggle::after {
        transition: none !important;
    }
}

@media (forced-colors: active) {
    :is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
    input[type="checkbox"]:not(:where(.switch *, .ios-toggle *, .ios-toggle-wrap *, .fp-email-switch *)) {
        appearance: auto;
        background: revert !important;
    }
    .fundify-controls-admin #wpbody-content input[type="checkbox"][role="switch"]::before {
        content: none;
    }
    :is(.fundify-controls-admin #wpbody-content, .anonymous-checkbox-wrapper)
    input[type="checkbox"] + :is(.slider, .ios-slider, .ios-toggle, .fp-email-slider, .fundify-toggle-switch) {
        forced-color-adjust: none;
        background: Canvas;
        border: 1px solid CanvasText;
    }
    :is(.fundify-controls-admin #wpbody-content, .anonymous-checkbox-wrapper)
    input[type="checkbox"]:checked + :is(.slider, .ios-slider, .ios-toggle, .fp-email-slider, .fundify-toggle-switch) {
        background: Highlight;
    }
    :is(.fundify-controls-admin #wpbody-content, .anonymous-checkbox-wrapper)
    input[type="checkbox"] + :is(.slider, .ios-slider, .ios-toggle, .fp-email-slider, .fundify-toggle-switch)::before,
    :is(.fundify-controls-admin #wpbody-content, .anonymous-checkbox-wrapper)
    input[type="checkbox"] + :is(.ios-toggle, .fundify-toggle-switch)::after {
        background: CanvasText;
    }
    :is(.fundify-controls-admin #wpbody-content, .anonymous-checkbox-wrapper)
    input[type="checkbox"]:checked + :is(.slider, .ios-slider, .ios-toggle, .fp-email-slider, .fundify-toggle-switch)::before,
    :is(.fundify-controls-admin #wpbody-content, .anonymous-checkbox-wrapper)
    input[type="checkbox"]:checked + :is(.ios-toggle, .fundify-toggle-switch)::after {
        background: HighlightText;
    }
}

@media (hover: hover) {
    :is(.fundify-controls-admin #wpbody-content, .fundify-checkbox-group, .fundify-panel-login, .premium-auth-wrapper #form-login-driver)
    input[type="checkbox"]:not(:where([role="switch"], .switch *, .ios-toggle *, .ios-toggle-wrap *, .fp-email-switch *, :checked, :indeterminate, :disabled)):hover {
        border-color: var(--fundify-control-focus);
    }
}
