.input-field {
    position: relative;
    margin-top: $input-margin-top;

    // General Styles

    .input-wider-text-box {
        width: 400px;
        margin: auto;
    }

    > input,
    > textarea,
    .input-wrapper > input {
        position: relative;
        z-index: 1;
        width: 100%;
        height: $input-height;
        padding: $input-padding;
        font-size: $input-font-size;
        background-color: transparent;
        border: 0;
        border-bottom: $input-border;
        border-radius: 0;
        outline: 0;
        box-shadow: none;
        transition: $input-transition;

        &:focus:not([readonly]),
        &:valid,
        &:disabled {
            color: var(--deprecated-dark-grey);
            border-bottom: 1px solid var(--deprecated-lynch);

            @include placeholder(var(--deprecated-lynch));

            & + label,
            & + span {
                @extend .active;
            }

            &:focus:not([readonly]) {
                color: var(--deprecated-lynch);
                border-bottom-color: var(--deprecated-azure);

                & + label,
                & + span {
                    color: var(--deprecated-azure);
                }
            }
        }

        &:disabled,
        &[readonly='readonly'] {
            color: var(--deprecated-dark-grey);
            border-bottom-color: transparent;

            &:not(.disabled-input) {
                @include placeholder(var(--deprecated-dark-grey));

                -webkit-text-fill-color: var(--deprecated-dark-grey);
            }

            &.disabled-input {
                margin-left: 1 * $spacing;
                background-color: transparent;

                &::placeholder {
                    color: var(--critical-70);
                    font-size: 12px;
                }
            }

            & + label {
                color: var(--grey-60);
            }
        }
    }

    > label,
    > span,
    .input-wrapper > label,
    .input-wrapper > span,
    &.input-wrapper > label,
    &.input-wrapper > span {
        position: absolute;
        top: 10px;
        left: 0;
        z-index: 0;
        box-sizing: content-box;
        height: 100%;
        color: var(--title-text-color);
        font-size: $input-font-size;
        transition: $input-transition;

        &.active {
            top: -1 * $input-margin-top;
            padding-bottom: $input-margin-top;
            color: var(--title-text-color);
            font-size: $form-control-label-font-size;
        }
    }

    > input,
    .input-wrapper > input {
        padding: $input-vertical-padding 0;
        color: transparent; // Make the input text color transparent when input is invalid (closed).
        font-size: $input-font-size;
        background-color: transparent;
        box-shadow: none; // Remove firefox invalid input box shadow.
        transition: $input-color-transition;

        @include placeholder(transparent);
    }

    > textarea {
        min-height: $input-height;
        padding: 5px 0 2px;
        -ms-overflow-y: hidden !important;
        overflow-y: hidden; // ie
        transition: height ease 0.2s;
        resize: none;

        @include placeholder(transparent);
    }

    &.mod-resizeable textarea {
        resize: vertical;
    }

    &.mod-fixed-width {
        max-width: $input-max-width;
    }

    // Validation feedback
    &.validate > input,
    &.validate .input-wrapper > input,
    .validate > input,
    &.validate > textarea,
    .validate > textarea,
    &.validate .input {
        transition:
            0.2s margin-bottom ease,
            0.2s color ease;

        &.valid,
        &.invalid {
            margin-bottom: 20px;
        }

        &.valid {
            border-bottom-color: var(--bright-turquoise-40);

            & + label::after {
                color: var(--bright-turquoise-40);
                opacity: 1;
                content: attr(data-valid-message);
            }
        }

        &.invalid {
            border-bottom-color: var(--critical-70);
        }

        &.invalid + label::after {
            color: var(--critical-70);
            opacity: 1;
            content: attr(data-invalid-message);
        }

        & + label {
            width: 100%;

            &::after {
                position: absolute;
                top: 100%;
                left: 0;
                display: block;
                margin-top: $input-message-position;
                font-size: 12px;
                transition: 0.2s all ease;
            }

            &.active {
                &::after {
                    margin-top: $input-message-position * 0.5;
                }
            }
        }

        &.input + label {
            top: $input-height;
        }
    }

    // For multiline input validation feedback
    .input-wrapper.validate > input {
        & + label {
            &::after {
                margin-top: $input-message-position * 1.5;
            }

            &.active {
                &::after {
                    margin-top: $input-message-position;
                }
            }
        }
    }

    // Temp fix for the textarea since using label:after doesn't work (because of textarea variable size)
    &.validate textarea.invalid {
        border-bottom-color: var(--critical-70);
    }

    &.validate .generic-form-error {
        display: block;

        // Make it look like the input > label:after error
        margin-top: 3px;
        margin-bottom: 0;
    }
}
