/*
 * Tailwind, confined to the form. This stylesheet loads on theme pages and
 * in the block editor, so nothing in it may reach outside .epicforms: the
 * preflight reset is a scoped copy (scripts/scope-preflight.mjs) and the
 * utilities are nested under the form root, where generic names such as
 * .container, .hidden or .collapse cannot collide with theme markup.
 */
@layer theme, base, components, utilities;
@import "tailwindcss/theme.css" layer(theme);
@import "./preflight.scoped.css" layer(base);

@layer utilities {
    :where(.epicforms) {
        @tailwind utilities;
    }
}

/*
 * Defaults only: zero specificity so the block's inline style and
 * Elementor's "{{WRAPPER}} .epicforms" rules always win, and nothing is
 * declared on :root where these generic names could clash with a theme's.
 */
:where(.epicforms) {
    --font-size-small: 12px;
    --font-size-medium: 14px;
    --font-size-large: 16px;

    --hint-size-small: 12px;
    --hint-size-medium: 14px;
    --hint-size-large: 16px;

    --label-size-small: 14px;
    --label-size-medium: 16px;
    --label-size-large: 18px;

    --button-size-small: 15px;
    --button-size-medium: 17px;
    --button-size-large: 19px;

    --subtitle-size-small: 16px;
    --subtitle-size-medium: 18px;
    --subtitle-size-large: 20px;

    --title-size-small: 18px;
    --title-size-medium: 22px;
    --title-size-large: 24px;

    --block-shadow-none: none;
    --block-shadow-small: 0px 3px 5px 0px rgba(0, 0, 0, 0.1);
    --block-shadow-medium: 0px 10px 20px 0px rgba(0, 0, 0, 0.1);
    --block-shadow-large: 0px 30px 50px -10px rgba(0, 0, 0, 0.15);

    --font-size: 14px;
    --hint-size: 14px;
    --title-size: 20px;
    --subtitle-size: 18px;

    --input-border-style: solid;
    --input-border-width: 1px;
    --input-border-radius: 0px;

    --input-background-color: #FFFFFF;
    --input-border-color: #000000;
    --input-text-color: #000000;
    --input-placeholder-color: #999999;

    --label-size: 16px;
    --label-text-color: #000000;
    --text-color: #000000;
    --hint-text-color: #888888;
    --error-text-color: #D00D00;

    --button-size: 17px;
    --button-border-style: solid;
    --button-border-width: 1px;
    --button-border-radius: 0px;

    --button-background-color: #FFFFFF;
    --button-border-color: #000000;
    --button-text-color: #000000;

    --block-padding: 0px;
    --block-border-style: solid;
    --block-border-width: 0px;
    --block-border-radius: 0px;
    --block-shadow: none;
    --block-background-color: transparent;
    --block-border-color: #000000;
}

.epicforms {

    text-rendering: optimizeSpeed;
    line-height: 1.4;
    font-family: "Roboto", sans-serif;

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    ul[class],
    ol[class] {
        padding: 0;
    }

    ul[class],
    ol[class] {
        list-style: none;
    }

    a:not([class]) {
        text-decoration-skip-ink: auto;
    }

    img {
        max-width: 100%;
        display: block;
    }

    input,
    button,
    textarea,
    select {
        font: inherit;
    }

    a {
        text-decoration: none;
    }

    * {
        pointer-events: fill;
    }

    form {
        @apply grid grid-cols-12 gap-6 p-4;
    }

    .required {
        position: relative;
    }

    .required:after {
        content: "";
        position: absolute;
        width: 7px;
        height: 8px;
        top: -3px;
        right: 20px;
        /*background-image: url("./images/star_input.png");*/
        background-repeat: no-repeat;
        background-position: 0 0;
        background-size: contain;
    }

    @keyframes autofill {
        to {
            color: inherit;
            background: #444962;
        }
    }

    input:-webkit-autofill {
        -webkit-animation-name: autofill;
        -webkit-animation-fill-mode: both;
    }

    /* TITLE SUBTITLE */

    .Title,
    .Subtitle {
        > h2,
        > h3 {
            @apply mb-2;
        }

        > h2,
        > h3,
        > p {
            margin-block: 0;
        }

        > hr {
            border: 0;
        }
    }

    /* END TITLE SUBTITLE */

    /* REACT SELECT v3 CSS */

    .tw-select {
        @apply w-full;
        position: relative;
        box-sizing: border-box;

        > span {
            z-index: 9999;
            border: 0px;
            clip: rect(1px, 1px, 1px, 1px);
            height: 1px;
            width: 1px;
            position: absolute;
            overflow: hidden;
            padding: 0px;
            white-space: nowrap;
        }
    }

    .tw-select__control {
        @apply w-full border px-3 py-2 focus:outline-none;
        -webkit-box-align: center;
        align-items: center;
        cursor: default;
        display: flex;
        flex-wrap: wrap;
        -webkit-box-pack: justify;
        justify-content: space-between;
        min-height: 38px;
        position: relative;
        transition: 100ms;
        box-sizing: border-box;
        outline: 0px !important;

        .tw-select__value-container {
            -webkit-box-align: center;
            align-items: center;
            display: grid;
            flex: 1 1 0%;
            flex-wrap: wrap;
            position: relative;
            overflow: hidden;
            box-sizing: border-box;

            .tw-select__single-value {
                @apply text-gray-800;

                grid-area: 1 / 1 / 2 / 3;
                max-width: 100%;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                box-sizing: border-box;
            }

            .tw-select__input-container {
                visibility: visible;
                flex: 1 1 auto;
                display: inline-grid;
                grid-area: 1 / 1 / 2 / 3;
                grid-template-columns: 0px min-content;
                box-sizing: border-box;
            }

            .tw-select__indicators {
                -webkit-box-align: center;
                align-items: center;
                align-self: stretch;
                display: flex;
                flex-shrink: 0;
                box-sizing: border-box;

                .tw-select__indicator-separator {
                    @apply hidden;
                }

                .tw-select__dropdown-indicator {
                    @apply text-gray-500;

                    display: flex;
                    transition: color 150ms;
                    box-sizing: border-box;
                }
            }
        }
    }

    .tw-select__menu {
        /* @TODO: remove color in favour of theme. */
        @apply mt-1 border bg-white z-20 text-sm;
    }

    .tw-select__option {
        /* @TODO: remove color in favour of theme. */
        @apply px-3 py-2 cursor-pointer text-gray-700;
    }

    .tw-select__option--is-focused {
        /* @TODO: remove color in favour of theme. */
        @apply bg-blue-100;
    }

    .tw-select__option--is-selected {
        /* @TODO: remove color in favour of theme. */
        @apply bg-blue-600 text-white;
    }

    .tw-select__placeholder {
        /* @TODO: remove color in favour of theme. */
        @apply text-gray-400;
    }

    /* END REACT SELECT v3 CSS */

    /* HINT */

    form {
        input[type="text"],
        textarea {
            @apply w-full border px-3 py-2 focus:outline-none;
        }

        > div {
            > p {
                /* @TODO: remove color in favour of theme. */
                @apply block text-sm text-gray-500 mt-2 mb-0;
            }

            > p.field-error {
                @apply mt-2;
                font-weight: 500;
            }
        }
    }

    /* END HINT */

    /* PARAGRAPH */

    .Paragraph {
        > label {
            @apply flex-none;
        }

        > div {
            @apply flex-auto flex flex-col;

            .ql-toolbar {
                @apply flex-none border-none;
                border-bottom-style: solid;
                border-bottom-width: 1px;

                > .ql-formats button {
                    @apply !border-none;
                }
            }

            .ql-container {
                @apply flex-auto border-none;
            }
        }

        > textarea {
            @apply flex-auto w-full px-3 py-2 focus:outline-none;
        }

        > p {
            @apply flex-none;
        }
    }

    /* END PARAGRAPH */

    /* SIGNATURE */

    .Signature {
        .constructor__component-signature {
            position: relative;
            height: 0;

            .constructor__component-signature-reset {
                position: absolute;
                top: -25px;
                right: 10px;
                font-size: 14px;
                text-decoration: underline;
            }
        }

        canvas {
            flex: auto;
            border-width: 1px;
            border-style: solid;
            overflow: auto;
        }
    }

    /* END SIGNATURE */

    /* CHECKBOX, CONFIRM, PRICING and RADIO COMMON */

    /* reset styling */

    .Checkbox input[type="checkbox"],
    .Confirm input[type="checkbox"],
    .Pricing input[type="radio"],
    .Radio input[type="radio"] {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        width: 18px;
        height: 18px;
        border-width: 2px;
        border-radius: 4px;
        cursor: pointer;
        display: inline-block;
        vertical-align: middle;
        position: relative;
        transition: all 0.2s;

        &:focus {
            outline-style: solid;
            outline-width: 2px;
        }
    }

    /* END CHECKBOX, CONFIRM, PRICING and RADIO COMMON */

    /* CHECKBOX */

    .Checkbox,
    .Confirm {
        > div > label {
            @apply inline-flex items-center gap-2;
        }

        input[type="checkbox"]:checked::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 5px;
            width: 4px;
            height: 8px;
            border-style: solid;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
    }

    /* END CHECKBOX */

    /* CONFIRM */

    .Confirm {
        > div + label {
            @apply inline-flex items-center gap-2;

            > span {
                display: inline-block;
            }
        }
    }

    /* END CONFIRM */

    /* RADIO */

    .Radio {
        > div > label {
            @apply inline-flex items-center gap-2;
        }

        input[type="radio"] {
            @apply shrink-0;
            border-radius: 50%;

            &:checked::after {
                content: "";
                position: absolute;
                top: 3px;
                left: 3px;
                width: 8px;
                height: 8px;
                border-radius: 50%;
            }
        }
    }

    /* END RADIO */

    /* PRICING */

    .Pricing {
        > div {
            &.line {
                @apply grid grid-cols-3 gap-4;
            }

            &.column {
                @apply grid grid-cols-1 gap-1.5;
            }

            > div > label {
                @apply block;

                > div:first-child {
                    @apply flex items-center gap-1.5;

                    > input[type="radio"] {
                        @apply shrink-0;
                        border-radius: 50%;

                        &:checked::after {
                            content: "";
                            position: absolute;
                            top: 3px;
                            left: 3px;
                            width: 8px;
                            height: 8px;
                            border-radius: 50%;
                        }
                    }

                    > span {
                        @apply text-base font-semibold;
                    }
                }

                > div:last-child {
                    @apply mt-2;

                    > span {
                        @apply block text-sm font-semibold;
                    }

                    > p {
                        @apply text-sm mt-2;
                        margin-block: 0;
                    }
                }
            }
        }
    }

    /* END PRICING */

    /* DATE AND TIME */

    .Date,
    .Time {
        position: relative;

        .react-datepicker-popper {
            .react-datepicker {
                @apply border focus:outline-none;

                .react-datepicker__navigation {
                    border: none;

                    .react-datepicker__navigation-icon {
                        display: flex;
                    }

                    &:focus,
                    &:hover {
                        background-color: transparent;
                    }
                }

                .react-datepicker__month-container,
                .react-datepicker__time-container {
                    .react-datepicker__header {
                        border-bottom-width: 2px;
                        border-bottom-style: solid;
                    }
                }
            }
        }
    }

    /* END DATE AND TIME */

    /* FILE */

    .File,
    .GoogleCloudStorage,
    .AWSS3Upload,
    .CloudflareR2Upload {
        > label {
            @apply flex-none;
        }

        > div {
            &:first-of-type {
                @apply flex-auto flex flex-col;

                > div.uppy-reset {
                    @apply h-full;
                    min-height: 80px;

                    > input {
                        display: none;
                    }

                    > div {
                        @apply h-full w-full border-2 border-dashed rounded-lg cursor-pointer;

                        > div {
                            @apply flex flex-col items-center justify-center h-full;

                            > p {
                                @apply p-0 m-0;
                            }
                        }
                    }
                }
            }

            &:last-of-type {
                @apply flex-none;

                > ul[data-uppy-element="files-list"] {
                    > li {
                        > div {
                            @apply flex flex-row items-center gap-2;
                            height: 32px;

                            > div {
                                width: 32px;
                                height: 32px;
                            }

                            p {
                                all: unset;
                                font-size: 12px;

                                &:first-of-type {
                                    @apply truncate;
                                }

                                &:last-of-type {
                                    /* @TODO: remove color in favour of theme. */
                                    @apply text-gray-500 tabular-nums min-w-18 text-right ml-auto;
                                }
                            }

                            > button {
                                /* @TODO: remove color in favour of theme. */
                                @apply flex rounded text-blue-500 hover:text-blue-700 bg-transparent transition-colors;
                                background: none;
                                border: none;
                                padding: 0;
                                margin: 0;
                                color: #0d6efd;
                                text-decoration: underline;
                                cursor: pointer;
                                font-size: 12px;

                                &:hover {
                                    color: #0a58ca;
                                    text-decoration: none;
                                }
                            }
                        }

                        > progress {
                            @apply w-full overflow-hidden block;
                            height: 2px;
                        }
                    }
                }

                > div[data-uppy-element="files-grid"] {
                    @apply my-2 grid gap-2 grid-cols-6;

                    > div {
                        @apply flex flex-col items-center gap-2;

                        > div[data-uppy-element="thumbnail"] {
                            /* @TODO: remove color in favour of theme. */
                            @apply relative overflow-hidden bg-gray-100 rounded-lg flex items-center justify-center;

                            > img {
                                @apply w-full h-full object-cover;
                            }
                        }

                        > div:last-of-type {
                            @apply w-full;

                            > p {
                                @apply font-medium truncate;
                                font-size: 12px;
                                margin: 0;
                                padding: 0;
                                margin-block: 0;
                            }

                            > div {
                                @apply flex items-center gap-2;

                                > p {
                                    /* @TODO: remove color in favour of theme. */
                                    @apply text-gray-500 tabular-nums;
                                    font-size: 12px;
                                    margin: 0;
                                    padding: 0;
                                    margin-block: 0;
                                }

                                > button {
                                    /* @TODO: remove color in favour of theme. */
                                    @apply flex rounded text-blue-500 hover:text-blue-700 bg-transparent transition-colors;
                                    background: none;
                                    border: none;
                                    padding: 0;
                                    margin: 0;
                                    /* @TODO: remove color in favour of theme. */
                                    color: #0d6efd;
                                    text-decoration: underline;
                                    cursor: pointer;
                                    font-size: 12px;

                                    &:hover {
                                        /* @TODO: remove color in favour of theme. */
                                        color: #0a58ca;
                                        text-decoration: none;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        > p {
            @apply flex-none;
        }
    }

    /* END FILE */

    /* STRIPE */
    .Stripe {
        > input[type="submit"]:first-of-type {
            @apply py-2 mt-4;
        }

        > input[type="submit"]:nth-of-type(2) {
            @apply py-2;
        }
    }
    /* END STRIPE */

    /* SUCCESS/FAILURE/PROCESSING MESSAGE */

    div.ProcessingMessage,
    div.SuccessMessage,
    div.FailureMessage {
        @apply p-2;

        > span {
            font-weight: 700;
        }
    }

    /* END SUCCESS/FAILURE/PROCESSING MESSAGE */

    /* NO FORM */

    .widget__no-form {
        height: 100%;
        background-color: red;
        text-align: center;

        span {
            display: block;
            text-align: center;
            color: #ffffff;
            font-size: 26px;
            font-weight: 700;
        }

        img {
            text-align: center;
            margin: 0 auto;
            margin-top: 40px;
            border: 2px dashed #efefef;
        }

        button.btn {
            margin-top: 50px;
            font-weight: 500;
        }
    }

    /* END NO FORM */

    /* BOT FORM LOCK */

    .bot-lock {
        position: fixed; /* Sit on top of the page content */
        width: 100%; /* Full width (cover the whole page) */
        height: 100%; /* Full height (cover the whole page) */
        top: 0;
        left: 0;
        z-index: 999;
        background-color: rgba(0, 0, 0, 0.8); /* Black background with opacity */

        span {
            font-size: 28px;
            display: block;
            padding: 0 50px;
            color: #FFFFFF;
            position: relative;
            top: 50%;
            text-align: center;
        }
    }

    /* END BOT FORM LOCK */
}

/* COLOR THEME */
.epicforms {
    padding-left:  var(--block-padding);
    padding-right: var(--block-padding);

    form {
        background-color: var(--block-background-color);
        border-width: var(--block-border-width);
        border-style: var(--block-border-style);
        border-color: var(--block-border-color);
        border-radius: var(--block-border-radius);
        box-shadow: var(--block-shadow);

        /* LABEL, HINT & ERROR */

        > div {
            > h2,
            > h3,
            > label {
                color: var(--label-text-color);
                font-size: var(--label-size);
            }

            label > span,
            label > div > span {
                color: var(--label-text-color);
            }

            > p {
                color: var(--hint-text-color);
                font-size: var(--hint-size);

                &.field-error {
                    color: var(--error-text-color);
                }
            }
        }

        /* END LABEL, HINT & ERROR */

        input[type="text"],
        textarea,
        select {
            color: var(--input-text-color);
            font-size: var(--font-size);
            background-color: var(--input-background-color);
            border-width: var(--input-border-width);
            border-style: var(--input-border-style);
            border-color: var(--input-border-color);
            border-radius: var(--input-border-radius);
        }

        input::placeholder,
        textarea::placeholder,
        select::placeholder {
            color: var(--input-placeholder-color);
        }

        input[type="submit"],
        input[type="button"],
        .btn {
            color: var(--button-text-color);
            font-size: var(--button-size);
            background-color: var(--button-background-color);
            border-width: var(--button-border-width);
            border-style: var(--button-border-style);
            border-color: var(--button-border-color);
            border-radius: var(--button-border-radius);
        }

        /* TITLE */

        .Title {
            > h2 {
                font-size: var(--title-size);
            }
        }

        /* END TITLE */

        /* SUBTITLE */

        .Subtitle {
            > h3 {
                font-size: var(--subtitle-size);
            }

            > hr {
                border-bottom-width: var(--input-border-width);
                border-bottom-style: var(--input-border-style);
                border-bottom-color: var(--input-border-color);
            }
        }

        /* END SUBTITLE */

        /* FREETEXT */

        .FreeText {
            > div {
                color: var(--text-color);
                font-size: var(--font-size);
            }
        }

        /* END FREETEXT */

        /* PARAGRAPH */

        .Paragraph {
            > div {
                border-width: var(--input-border-width);
                border-style: var(--input-border-style);
                border-color: var(--input-border-color);
                border-radius: var(--input-border-radius);
                background-color: var(--input-background-color);

                .ql-toolbar {
                    border-bottom-color: var(--input-border-color);

                    .ql-stroke {
                        fill: none;
                        stroke: var(--input-text-color);
                    }

                    .ql-fill,
                    .ql-stroke.ql-fill {
                        fill: var(--input-text-color);
                    }

                    .ql-picker {
                        color: var(--input-text-color);

                        &.ql-expanded .ql-picker-label,
                        &.ql-expanded .ql-picker-options {
                            color: var(--input-text-color);
                            border-color: var(--input-border-color) !important;
                            background-color: var(--input-background-color) !important;
                        }

                        .ql-picker-label.ql-active,
                        &.ql-expanded .ql-picker-label.ql-active {
                            color: var(--input-text-color);
                            border: none;
                        }

                        .ql-picker-options {
                            background-color: var(--input-background-color) !important;
                        }

                        .ql-picker-item.ql-selected {
                            color: var(--input-text-color);
                        }
                    }
                }

                .ql-container {
                    .ql-editor {
                        color: var(--input-text-color);

                        h1, h2, h3, p {
                            color: var(--input-text-color);
                        }

                        p {
                            font-size: var(--font-size);
                        }
                    }
                }
            }
        }

        /* END PARAGRAPH */

        /* SIGNATURE */

        .Signature {
            canvas {
                background-color: var(--input-background-color);
                border-width: var(--input-border-width);
                border-style: var(--input-border-style);
                border-color: var(--input-border-color);
                border-radius: var(--input-border-radius);
                /* For Signature canvas pen color. JS will take it from `color` CSS property. */
                color: var(--input-text-color);
            }
        }

        /* END SIGNATURE */

        /* REACT-DATETIME */

        .Date,
        .Time {
            .react-datepicker-popper {
                .react-datepicker {
                    background-color: var(--input-background-color);
                    border-width: var(--input-border-width);
                    border-style: solid;
                    border-color: var(--input-border-color);
                    border-radius: var(--input-border-radius);

                    button.react-datepicker__navigation {
                        > span.react-datepicker__navigation-icon {
                            &:before {
                                border-color: var(--input-text-color);
                            }
                        }
                    }

                    .react-datepicker__month-container,
                    .react-datepicker__time-container {
                        .react-datepicker__header {
                            border-top-left-radius: var(--input-border-radius);
                            border-top-right-radius: var(--input-border-radius);
                            background-color: var(--input-background-color);
                            border-bottom-color: var(--input-border-color);
                        }
                    }

                    .react-datepicker__month-container {
                        .react-datepicker__header {
                            > h2.react-datepicker__current-month {
                                color: var(--input-text-color);
                            }

                            .react-datepicker__day-names {
                                > div.react-datepicker__day-name {
                                    color: var(--input-text-color);
                                }
                            }
                        }
                        .react-datepicker__month {
                            > div.react-datepicker__week {
                                > div.react-datepicker__day {
                                    color: var(--input-text-color);
                                    font-size: var(--font-size);

                                    &:not([aria-disabled=true]):hover {
                                        background-color: color-mix(in srgb, var(--input-background-color) 90%, black);
                                    }

                                    &.react-datepicker__day--selected,
                                    &.react-datepicker__day--keyboard-selected {
                                        background-color: color-mix(in srgb, var(--input-background-color) 60%, black);
                                    }

                                    &.react-datepicker__day--selected:not([aria-disabled=true]):hover,
                                    &.react-datepicker__day--keyboard-selected:not([aria-disabled=true]):hover {
                                        background-color: color-mix(in srgb, var(--input-background-color) 80%, black);
                                    }
                                }
                            }
                        }
                    }

                    .react-datepicker__time-container {
                        > div.react-datepicker__header--time {
                            > div.react-datepicker-time__header {
                                color: var(--input-text-color);
                            }
                        }

                        > div.react-datepicker__time {
                            background-color: var(--input-background-color);
                            border-bottom-left-radius: var(--input-border-radius);
                            border-bottom-right-radius: var(--input-border-radius);

                            > div.react-datepicker__time-box {
                                border-bottom-left-radius: var(--input-border-radius);
                                border-bottom-right-radius: var(--input-border-radius);

                                > ul.react-datepicker__time-list {
                                    > li.react-datepicker__time-list-item {
                                        color: var(--input-text-color);
                                        font-size: var(--font-size);

                                        &:hover {
                                            background-color: color-mix(in srgb, var(--input-background-color) 80%, black);
                                        }

                                        &.react-datepicker__time-list-item--selected {
                                            background-color: color-mix(in srgb, var(--input-background-color) 60%, black);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        /* END REACT-DATETIME */

        /* SELECT & COUNTRY REACT-SELECT */

        .Select,
        .Country {
            .tw-select {
                .tw-select__control {
                    background-color: var(--input-background-color);
                    border-width: var(--input-border-width);
                    border-style: var(--input-border-style);
                    border-color: var(--input-border-color);
                    border-radius: var(--input-border-radius);

                    .tw-select__value-container {
                        .tw-select__single-value {
                            color: var(--input-text-color);
                            font-size: var(--font-size);
                        }
                    }

                    .tw-select__indicator {
                        &.tw-select__dropdown-indicator {
                            > svg {
                                fill: var(--input-text-color);
                                stroke: var(--input-text-color);
                            }
                        }
                    }
                }

                .tw-select__menu {
                    background-color: var(--input-background-color);
                    border-width: var(--input-border-width);
                    border-style: var(--input-border-style);
                    border-color: var(--input-border-color);
                    border-radius: var(--input-border-radius);

                    .tw-select__menu-list {
                        .tw-select__option {
                            color: var(--input-text-color);
                            font-size: var(--font-size);

                            &:first-of-type {
                                border-top-left-radius: var(--input-border-radius);
                                border-top-right-radius: var(--input-border-radius);
                            }

                            &:last-of-type {
                                border-bottom-left-radius: var(--input-border-radius);
                                border-bottom-right-radius: var(--input-border-radius);
                            }

                            &.tw-select__option--is-focused {
                                background-color: color-mix(in srgb, var(--input-background-color) 80%, black);
                            }

                            &.tw-select__option--is-selected {
                                background-color: color-mix(in srgb, var(--input-background-color) 60%, black);
                            }
                        }
                    }
                }
            }
        }

        /* END SELECT & COUNTRY REACT-SELECT */

        /* CHECKBOX, CONFIRM and RADIO */

        .Checkbox input[type="checkbox"],
        .Confirm input[type="checkbox"],
        .Radio input[type="radio"],
        .Pricing input[type="radio"] {
            background-color: var(--input-background-color);
            border-style: solid;
            border-color: var(--input-border-color);

            &:hover {
                border-color: color-mix(in srgb, var(--input-border-color) 80%, black);
            }

            &:focus {
                outline-color: var(--input-background-color);
            }
        }

        .Checkbox {
            > div > label > span {
                font-size: var(--font-size);
            }

            input[type="checkbox"]:checked::after {
                border-color: var(--input-text-color);
            }
        }

        .Radio {
            > div > label > span {
                font-size: var(--font-size);
            }

            input[type="radio"]:checked::after {
                background: var(--input-text-color);
            }
        }

        .Confirm {
            > label {
                > span {
                    font-size: var(--font-size);
                }

                > input[type="checkbox"]:checked::after {
                    border-color: var(--input-text-color);
                }
            }
        }

        /* END CHECKBOX, CONFIRM and RADIO */

        /* CONFIRM */

        .Confirm {
            > div {
                color: var(--text-color);
                font-size: var(--font-size);
            }
        }

        /* END CONFIRM */

        /* PRICING */

        .Pricing {
            > div > div > label {
                > div:first-of-type {
                    > input[type="radio"]:checked::after {
                        background: var(--input-text-color);
                    }

                    > span {
                        font-size: var(--font-size);
                        color: var(--label-text-color);
                    }
                }

                > div:last-of-type {
                    > span {
                        color: var(--label-text-color);
                    }

                    > p {
                        color: var(--text-color);
                        font-size: var(--font-size);
                    }
                }
            }
        }

        /* END PRICING */

        /* FILE */

        .File,
        .GoogleCloudStorage,
        .AWSS3Upload,
        .CloudflareR2Upload {
            > div {
                &:first-of-type {
                    > div.uppy-reset {
                        > div {
                            border-width: var(--input-border-width);
                            border-style: var(--input-border-style);
                            border-radius: var(--input-border-radius);
                            border-color: var(--input-border-color);
                            background-color: var(--input-background-color);

                            > div {
                                > p {
                                    color: var(--input-text-color);
                                    font-size: var(--font-size);
                                }
                            }
                        }
                    }
                }
            }
        }

        /* END FILE */

        /* SUBMIT */

        input[type="submit"] {
            border-width: var(--button-border-width);
            border-style: var(--button-border-style);
            border-radius: var(--button-border-radius);
            border-color: var(--button-border-color);
            background-color: var(--button-background-color);
            color: var(--button-text-color);
            font-size: var(--button-size);

            &:hover {
                background-color: color-mix(in srgb, var(--button-background-color) 80%, black);
            }

            &:active {
                background-color: color-mix(in srgb, var(--button-background-color) 50%, black);
            }
        }

        /* END SUBMIT */

        /* SUCCESS/FAILURE/PROCESSING MESSAGE */

        div.ProcessingMessage,
        div.SuccessMessage,
        div.FailureMessage {
            background-color: color-mix(in srgb, var(--block-background-color) 90%, black);

            > span {
                font-size: var(--font-size);
                color: var(--label-color);
            }
        }

        div.FailureMessage {
            > span {
                color: var(--error-text-color);
            }
        }

        /* END SUCCESS/FAILURE/PROCESSING MESSAGE */
    }
}

/* END COLOR THEME */

/* INTEGRATIONS */

/* GUTENBERG EDITOR */
.epicforms-gutenberg-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    cursor: not-allowed;
    z-index: 110;
}

.epicforms-gutenberg-editor-spacer {
    margin-top: 8px;
}

.epicforms-gutenberg-editor-panel-color-settings {
    margin-top: 8px;

    > label {
        font-size: 11px;
        font-weight: 500;
        line-height: 1.4;
        text-transform: uppercase;
        box-sizing: border-box;
        display: block;
        padding-top: 0;
        padding-bottom: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .epicforms-gutenberg-editor-panel-color-settings-picker {
        padding: 0;
        border: 0;

        > div:first-of-type {
            margin-top: 8px;
        }
    }
}

/* END GUTENBERG EDITOR */

/* END INTEGRATIONS */

/* MADE BY BADGE */
.epicforms-made-by {
    text-align: center;
    padding: 12px 0 4px;
    font-size: 12px;
}

.epicforms-made-by a {
    color: var(--label-text-color, #000);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Vertically stacked full-width buttons for add-on fields (e.g. a payment
   provider's buttons), so add-ons reuse core styling instead of shipping
   their own stylesheet. */
.ef-button-stack > * { display: block; width: 100%; }
.ef-button-stack > * + * { margin-top: 0.75rem; }
