// ==========================================================================
// Formulate
// ==========================================================================

.field-wrapper {
    margin: 0 !important;
}

//
// Field Errors
//

[data-invalid="true"] .text {
    border-color: #EF4E4E;
}

//
// Field Labels
//

.field .field-label {
    display: flex;
    align-items: center;

    span[data-icon] {
        display: inline-flex;
        margin-left: 5px;

        &:hover {
            color: #0B69A3;
        }
    }
}

.tippy-box[data-theme~="fui-field-instructions-tooltip"] .tippy-content {
    font-size: 14px;
    line-height: 20px;
    color: #3f4d5a;
    padding: 24px;
}


//
// Input - Number
//

.field[data-type="number"] {
    -moz-appearance: textfield;

    input::-webkit-inner-spin-button, 
    input::-webkit-outer-spin-button {
        -webkit-appearance: none; 
        margin: 0; 
    }

    // Number inputs don't support `size` attribute
    @for $i from 1 to 10 {
        input[size="#{$i}"] {
            width: 1rem * $i;
        }
    }
}


//
// Input - Collapse
//

.field[data-type="collapse"] {
    .input {
        height: 100%;
    }
}


//
// Input - Prefix/Suffix
//

.fui-prefix-text {
    color: #7b8793;
    padding-right: 5px;
}

.fui-suffix-text {
    color: #7b8793;
    padding-left: 5px;
}


//
// Input - Checkbox/Radio
//

.field[data-type="checkbox"],
.field[data-type="radio"] {
    & [data-disabled] {
        opacity: 30%;
    }

    & .field-label {
        user-select: none;
        padding: 0;
        margin: 0;
    }

    & .field-wrapper {
        display: inline-flex;
        align-items: center;
    }

    & input {
        appearance: none;
        position: absolute;
        width: 0;
        height: 0;
        overflow: hidden;
        opacity: 0;
        left: -999em;

        & ~ .formkit-decorator {
            background: #fbfcfe;
            display: block;
            box-sizing: content-box;
            width: 14px;
            height: 14px;
            flex: 0 0 14px;
            border: none;
            box-shadow: 0 0 0 1px rgba(96, 125, 159, 0.4);
            border-radius: 2px;
            position: relative;
            cursor: pointer;
            margin-right: 7px;

            &::before {
                background: transparent;
                content: "";
                display: block;
                width: 84%;
                height: 50%;
                pointer-events: none;
                border-bottom: 0.26em solid transparent;
                border-left: 0.26em solid transparent;
                transform: rotate(-45deg);
                transform-origin: bottom left;
                position: absolute;
                bottom: 5%;
                left: 45%;
            }
        }

        &:checked ~ .formkit-decorator {
            box-shadow: 0 0 0 1px rgba(96, 125, 159, 0.4);

            &::before {
                border-color: #4c545c;
            }
        }

        &:focus ~ .formkit-decorator {
            box-shadow: 0 0 0 1px rgba(96, 125, 159, 0.4);
        }

        &:focus-visible ~ .formkit-decorator {
            box-shadow: 0 0 0 1px rgba(96, 125, 159, 0.4);
        }
    }

    & .formkit-options {
        padding: 0;
    }

    & .formkit-option {
        list-style-type: none;

        &:last-child {
            margin-bottom: 0;
        }
    }

    & fieldset.formkit-fieldset {
        border: var(--fk-border);
        border-radius: 2px;
    }
}

