.sxs-fcon {
    --feedbackImgSize: 0px;
    --feedbackItems: 0;
    --fcontrolXPadding: #{$fcontrolXPadding};
    --fcontrolFeedSpacing: #{$fcontrolFeedSpacing};
    --fcontrolPaddingTop: 0px;
    --controlSize: #{$text-body};
    --iconSize: 0px;
    --controlColor: #{$duller};

    &.frame {
        --frameHeight: calc(30px + 1rem);

        &>.sxs-fbox {
            min-height: var(--frameHeight);

            &::before {
                top: calc(var(--frameHeight) / 2);
                right: var(--fcontrolXPadding);
                transform: scale(0) translateY(-50%);
                transform-origin: top;
            }

            &:focus-visible {
                outline: 1px solid $secondaryClear;
            }
        }

        &.sxs-fcon {

            &--v1,
            &--card-number,
            &--card-cvc {
                background-color: #FFF;
                border-radius: 2px;
                outline: 1px solid $secondaryClear;
            }

            &--v2 {
                background-color: #FFF;
                border-radius: 9999px;
            }

            &--v3 {
                font-weight: 300;
                outline: 1px solid #858585;
                border-radius: 9999px;
                background-color: transparent;
                --controlColor: #858585;

                .sxs-fcontrol {
                    font-weight: 300;
                }
            }
        }
    }

    &.radio-group {
        margin-left: -10px;
        margin-right: -10px;

        &>.sxs-fbox {
            flex-wrap: wrap;

            &::before {
                margin-right: 10px;
                right: 0;
            }
        }
    }

    &.t-input-radio {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        width: auto;
        padding: 1.5rem 10px;

        .sxs-fcontrol {
            height: auto;
            min-height: auto;
            width: auto;
            cursor: pointer;
        }
    }

    &.t-input-checkbox .sxs-fcontrol {
        &:checked~.sxs-checkbox__label .sxs-checkbox__box {
            background-color: $primaryClear;
            border-color: transparent;

            .icon {
                transform: scale(1);
            }
        }

        &~.sxs-checkbox__label {
            flex: 1 1 0;
            display: flex;
            align-items: center;
            min-height: 30px;
            cursor: pointer;

            .sxs-checkbox {
                &__box {
                    flex: 0 0 1em;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    width: 1em;
                    max-width: 1em;
                    height: 1em;
                    margin-right: .5rem;
                    font-size: 1.5rem;
                    border: 1px solid $duller;
                    border-radius: 2px;
                    transition: border-color 400ms cubic-bezier(.16, 1, .33, 1);

                    .icon {
                        font-size: .6em;
                        transform: scale(0);
                        transition: transform 400ms cubic-bezier(.16, 1, .33, 1);
                    }
                }

                &__text {
                    font-size: calc(var(--controlSize) * .875);
                    font-weight: 500;
                    line-height: 1.1;
                    color: var(--controlColor);

                    a {
                        font-weight: 700;

                        &:hover {
                            text-decoration: underline;
                        }
                    }
                }
            }
        }
    }

    &.t-input-file {
        .sxs-fcontrol {
            opacity: 0;
        }

        &.sxs-fcon--has-feedback .sxs-flabel__text {
            padding-right: calc(var(--fcontrolXPadding) + var(--feedbackImgSize));
        }
    }

    &.select {
        --iconSize: #{$text-14};
        --feedbackItems: 2;

        &.frame .sxs-fcontrol {
            // min padding + padding x2 + icon size:
            padding-right: calc(var(--fcontrolFeedSpacing) + (var(--fcontrolXPadding) * 2) + var(--iconSize));
        }

        .sxs-fcontrol {
            // transform: translateX(-5px);

            &~.sxs-flabel .sxs-flabel__text {
                color: transparent;
            }

            &:focus~.sxs-flabel .sxs-flabel__text {
                color: inherit;
            }
        }

        .icon {
            position: absolute;
            right: var(--fcontrolXPadding);
            font-size: var(--iconSize);
            color: var(--controlColor);
        }
    }

    &.textarea .sxs-fcontrol {
        min-height: calc(70px + 4rem);
        max-height: calc(70px + 10rem);
        padding-top: calc(10px + .75rem + var(--fcontrolPaddingTop)) !important;
        padding-bottom: calc(10px + .75rem);

        &~.sxs-flabel {
            align-items: flex-start;
            padding-top: calc(10px + .75rem);
        }
    }

    &--card-number,
    &--card-cvc {
        display: flex;

        .sxs-fbox {
            &::before {
                content: none !important;
            }

            &__med {
                flex-shrink: 0;
                display: flex;
                align-items: center;
                flex-wrap: nowrap;
                padding-right: var(--fcontrolXPadding);
                pointer-events: none;

                &-con0 {
                    display: flex;
                    align-items: center;
                    flex-wrap: nowrap;
                    gap: calc(var(--controlSize) * .25);
                }

                img {
                    height: calc(var(--controlSize) * 2);
                    width: calc(var(--controlSize) * 2);
                }
            }
        }

        &.sxs-fcon--has-errors {
            svg {
                fill: #df1b41;
            }
        }
    }

    &--card-number {
        .sxs-fbox__med {
            @include sm-wmax {
                img {
                    position: absolute;
                    top: 0;
                    left: 0;
                    opacity: 0;
                    transform: scale(.5);
                    transition: opacity 1200ms, transform 1200ms;

                    &.active {
                        position: relative;
                        opacity: 1;
                        transform: scale(1);
                    }
                }
            }
        }
    }

    &--has-feedback>.sxs-fbox::before {
        content: "";
    }

    &--has-errors,
    &--has-errors.frame {
        &>.sxs-fbox {
            &::before {
                background-image: url("/images/form-error.webp");
                border-color: #df1b41;
                transform: scale(1);
            }

            &>.sxs-fcontrol,
            &>.sxs-checkbox__label {
                // (min padding * amount of items) + (padding * amount of items) + feedback img size + icon size [if available]:
                padding-right: calc((var(--fcontrolFeedSpacing) * var(--feedbackItems)) + (var(--fcontrolXPadding) * (var(--feedbackItems))) + var(--feedbackImgSize) + var(--iconSize));
            }
        }

        &.frame {
            outline-color: #df1b41;

            &>.sxs-fbox {
                &::before {
                    transform: scale(1) translateY(-50%);
                }

                &>.sxs-fcontrol,
                &>.sxs-checkbox__label {
                    // (min padding * amount of items) + (padding * (1 + amount of items)) + feedback img size + icon size [if available]:
                    padding-right: calc((var(--fcontrolFeedSpacing) * (var(--feedbackItems))) + (var(--fcontrolXPadding) * (1 + var(--feedbackItems))) + var(--feedbackImgSize) + var(--iconSize));
                }
            }

            &.select .icon.icon {
                // feedback img size + min padding + (padding * amount of items):
                right: calc(var(--feedbackImgSize) + var(--fcontrolFeedSpacing) + (var(--fcontrolXPadding) * var(--feedbackItems)));
            }
        }
    }

    &--is-filled,
    &--is-filled.frame {
        &:not(.sxs-fcon--has-errors)>.sxs-fbox::before {
            background-image: url("/images/form-success.webp");
            border-color: $primaryClear;
        }

        &>.sxs-fbox {
            &::before {
                transform: scale(1);
            }

            &>.sxs-fcontrol,
            &>.sxs-checkbox__label {
                // (min padding * amount of items) + (padding * amount of items) + feedback img size + icon size [if available]:
                padding-right: calc((var(--fcontrolFeedSpacing) * var(--feedbackItems)) + (var(--fcontrolXPadding) * (var(--feedbackItems))) + var(--feedbackImgSize) + var(--iconSize));
            }
        }

        &.frame {
            &>.sxs-fbox {
                &::before {
                    transform: scale(1) translateY(-50%);
                }

                &>.sxs-fcontrol,
                &>.sxs-checkbox__label {
                    // (min padding * amount of items) + (padding * (1 + amount of items)) + feedback img size + icon size [if available]:
                    padding-right: calc((var(--fcontrolFeedSpacing) * (var(--feedbackItems))) + (var(--fcontrolXPadding) * (1 + var(--feedbackItems))) + var(--feedbackImgSize) + var(--iconSize));
                }
            }

            &.select .icon.icon {
                // feedback img size + min padding + (padding * amount of items):
                right: calc(var(--feedbackImgSize) + var(--fcontrolFeedSpacing) + (var(--fcontrolXPadding) * var(--feedbackItems)));
            }
        }
    }

    &--has-feedback {
        --feedbackImgSize: 20px;
        --feedbackItems: 1;
    }
}

.sxs-fbox {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    font-size: var(--controlSize);
    text-align: left;
    border: 0 solid transparent;

    &::before {
        content: "";
        position: absolute;
        z-index: 2;
        right: 0;
        display: block;
        width: 1em;
        height: 1em;
        font-size: var(--feedbackImgSize);
        background: #FFF no-repeat center center;
        background-size: 14px auto;
        border: 1px solid;
        border-radius: 50%;
        transform: scale(0);
        transition: transform $transitionDuration;
        transform-origin: center;
    }
}

.sxs-fcontrol {
    height: var(--frameHeight);
    // min-height: 40px;
    width: 100%;
    padding: 0 var(--fcontrolXPadding);
    font-size: var(--controlSize);
    color: var(--controlColor);
    background: none;
    border: none;
    transition: transform 100ms cubic-bezier(0.4, 0, 0.2, 1);
    font-variant-numeric: lining-nums;

    &--t-input-file {
        cursor: pointer;

        &~.sxs-flabel .icon {
            color: $secondaryClear;
        }
    }

    &--select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }

    &--card-number {
        &~.sxs-flabel {}
    }
}

.sxs-fcon--has-label .sxs-fcontrol:not(.sxs-fcontrol--t-input-file, .sxs-fcontrol--input-radio):focus~.sxs-flabel .sxs-flabel__text,
.sxs-fcon--has-label.sxs-fcon--is-filled .sxs-fcontrol:not(.sxs-fcontrol--t-input-file)+.sxs-flabel .sxs-flabel__text {
    transform: scale(.7) translateY(-150%);
    white-space: nowrap;
}

.sxs-fcon--has-label .sxs-fcontrol:not(.sxs-fcontrol--t-input-file, .sxs-fcontrol--select, .sxs-fcontrol--input-radio):focus,
.sxs-fcon--has-label.sxs-fcon--is-filled .sxs-fcontrol:not(.sxs-fcontrol--t-input-file, .sxs-fcontrol--select, .sxs-fcontrol--input-radio) {
    --fcontrolPaddingTop: calc(var(--frameHeight) * .1);
    padding-top: var(--fcontrolPaddingTop);
}

.sxs-fcon--is-filled .sxs-fcontrol.select~.sxs-flabel .sxs-flabel__text {
    color: inherit;
}

.sxs-flabel {
    padding: 0 var(--fcontrolXPadding);
    z-index: 2;
    position: absolute;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    color: var(--controlColor);
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    pointer-events: none;

    &__text {
        flex: 1 1 0;
        width: auto;
        max-width: 100%;
        font-size: var(--controlSize);
        transform-origin: bottom left;
        transition: transform 125ms cubic-bezier(0.4, 0, 0.2, 1);
        line-height: 1;

        &--has-icon {
            display: flex;
            align-items: center;

            .icon {
                font-size: $text-25;
            }
        }
    }
}

.sxs-radio__label {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-transform: uppercase;
    font-size: var(--controlSize);
    line-height: 1.2;

    &>.icon {
        margin-right: 1rem;
        font-size: $text-40;
    }
}