html {
    .has-error {
        &.list-button-horizontal,
        &.list-button,
        &.list-button.list-group,
        &.list-card {
            position: relative;

            .button-content {
                border: none;
            }

            &:hover {
                @include box-shadow-hover($red-200);
                z-index: 5;
            }

            input[type="radio"]:focus + .list-button-content {
                box-shadow: 0 0 0 2.5px $red;
            }

            .list-button-content,
            .list-button-horizontal-content {
                border: 1px solid $red;
            }

            input[type="radio"]:focus + .list-button-horizontal-content {
                z-index: 5;
                box-shadow: 0 0 0 2.5px $red;
            }

            input[type="radio"]:hover + .list-button-content,
            input[type="radio"]:hover + .list-button-horizontal-content {
                z-index: 5;
                box-shadow: none;
            }
        }

        &.list-card {
            border: 1px solid $red;
        }

        &.ui-radio {
            &:hover {
                input[type="radio"],
                input[type="checkbox"] {
                    @include box-shadow-hover($red-200);
                }
            }
        }
        .form-check-input {
            &:focus {
                box-shadow: 0 0 0 2.5px $red;
            }
        }

        &.list-button,
        &.list-card {
            color: $red;

            input[type="checkbox"]:focus + label,
            input[type="radio"]:focus + label {
                box-shadow: 0 0 0 2.5px $red;
            }
            input[type="checkbox"]:checked + label {
                box-shadow: 0 0 0 1px $red;
            }
            &:hover {
                border-radius: 0.5rem;
            }
        }
        &.list-button-horizontal {
            color: $red;
            input[type="checkbox"]:focus + label,
            input[type="radio"]:focus + label {
                box-shadow: 0 0 1px $red;
            }
        }

        &.grid-item {
            input[type="radio"] {
                + label {
                    border: 1px solid $red;
                    &:hover {
                        background-color: $blue-100;
                        box-shadow: 0px 0px 0px 4px $red-200;
                    }
                }
            }
        }
        &.ui-radio,
        &.ui-checkbox {
            input[type="checkbox"],
            input[type="radio"],
            input[type="radio"] + label:before,
            input[type="checkbox"] + label:before {
                border: 1px solid $red;
                background-color: initial;
            }
            input[type="checkbox"]:checked + label:before {
                border: 1px solid $blue;
            }
        }
        &.textbox-question,
        &.dropdown-question,
        &.phone-number-question {
            p {
                color: $red;
            }
            input,
            select {
                border: 1px solid $red;
                &:focus {
                    border: 1px solid transparent;
                    box-shadow: 0 0 0 2.5px $red;
                }

                &:hover {
                    box-shadow: 0px 0px 0px 4px $red-200;
                    border-radius: 0.5rem;
                    border: 1px solid $red;
                }
            }
            select {
                background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 8.89' xml:space='preserve'%3e%3cpath d='M8 8.89c-.24 0-.46-.09-.63-.26L.26 1.53a.901.901 0 0 1 0-1.27C.43.1.66 0 .9 0s.47.1.64.26L8 6.74 14.47.27c.17-.17.4-.27.64-.27s.47.1.63.27c.17.17.26.4.26.64s-.1.47-.27.63l-7.1 7.09a.86.86 0 0 1-.63.26z' fill='%23d4281c'/%3e%3c/svg%3e");
                background-repeat: no-repeat;
                background-position: right 0.75rem center;
                background-size: 16px 12px;
            }
            .has-search-icon {
                button[type="submit"] {
                    background-color: $red-100;
                    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.7817 14.7328L11.8252 10.7762C12.8833 9.45005 13.3936 7.76911 13.2513 6.07849C13.1091 4.38788 12.325 2.81587 11.0601 1.6852C9.79515 0.554524 8.14538 -0.0490261 6.44946 -0.00154744C4.75353 0.0459312 3.14012 0.740836 1.94045 1.94051C0.740775 3.14018 0.0458701 4.75359 -0.00160848 6.44952C-0.0490871 8.14545 0.554463 9.79521 1.68514 11.0601C2.81581 12.325 4.38782 13.1091 6.07843 13.2514C7.76905 13.3937 9.44999 12.8834 10.7762 11.8252L14.7349 15.7839C14.8044 15.8527 14.8869 15.907 14.9774 15.9439C15.068 15.9808 15.165 15.9995 15.2628 15.9989C15.3606 15.9983 15.4573 15.9784 15.5475 15.9405C15.6376 15.9025 15.7194 15.8471 15.7881 15.7776C15.8568 15.708 15.9112 15.6256 15.9481 15.535C15.985 15.4444 16.0036 15.3474 16.0031 15.2496C16.0025 15.1518 15.9826 15.0551 15.9446 14.965C15.9067 14.8748 15.8513 14.7931 15.7817 14.7243V14.7328ZM6.63737 11.7913C5.61803 11.7913 4.62157 11.4891 3.77402 10.9228C2.92646 10.3564 2.26587 9.5515 1.87578 8.60975C1.4857 7.668 1.38363 6.63172 1.5825 5.63196C1.78136 4.6322 2.27222 3.71386 2.99301 2.99307C3.7138 2.27229 4.63214 1.78142 5.6319 1.58256C6.63166 1.38369 7.66793 1.48576 8.60969 1.87585C9.55144 2.26593 10.3564 2.92652 10.9227 3.77408C11.489 4.62163 11.7913 5.61809 11.7913 6.63743C11.7896 8.00382 11.2461 9.31376 10.2799 10.2799C9.3137 11.2461 8.00376 11.7897 6.63737 11.7913Z' fill='%23d4281c'/%3E%3C/svg%3E%0A");
                    border: 1px solid $red;
                    border-left: none;
                }
            }
        }
    }
    //Quote page radio button group
    .package-main {
        .package-wrapper {
            .has-error {
                input[type="radio"] {
                    + .package-label {
                        border: 1px solid $red;
                    }
                }
            }
        }
    }
    //Restore to default style if alert box is present
    .alertError {
        .has-error {
            &.list-button,
            &.list-card {
                border: 1px solid $gray-500;
                input:not(:focus) {
                    + label {
                        border: none;
                        box-shadow: 0 0 0 1px $gray-500;
                        border-radius: 0.5rem;
                    }
                }
                input:checked:focus {
                    + label {
                        border: none;
                        box-shadow: 0 0 0 2.5px $blue;
                        border-radius: 0.5rem;
                    }
                }
                input:checked:not(:focus) {
                    + label {
                        box-shadow: 0 0 0 1px $blue;
                        border-radius: 0.5rem;
                    }
                }
                input:focus {
                    border: 1px solid $gray-500;
                    + label {
                        box-shadow: 0 0 0 2.5px transparent;
                    }
                }
                &:hover {
                    box-shadow: 0 0 0 4px $blue-300;
                    + label {
                        box-shadow: 0 0 0 2.5px transparent;
                        border: 1px solid $blue;
                    }
                }
            }
        }
    }

    .form-test-error {
        color: $red;
        font-size: 0.875rem;
        .small {
            font-weight: 500;
        }
    }

    .form-test-invalid {
        &.btn.btn-primary {
            color: $gray-600;
            background: $gray-200;
            cursor: pointer;
            pointer-events: all;
            font-weight: $font-weight-normal;
        }
        &.btn.btn-primary:hover,
        &.btn.btn-primary:focus {
            background: $gray-200;
            box-shadow: none;
        }
        &.btn.btn-primary:focus-visible {
            box-shadow:
                0 0 0 3px $white,
                0 0 0 5.5px $gray-700;
        }
    }
}
