﻿/* Match form control styles on insurance.wa.gov */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.5rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.375;
    color: #1b1b1b;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #cccccc;
    appearance: none;
    border-radius: 0;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .form-control:focus:not(:disabled):not(.disabled) {
        border-color: #cccccc;
        box-shadow: none !important;
        outline: 2.5px #4BA63A solid;
    }

.form-check-input {
    outline-color: #4BA63A;
}

/* Match button styles on insurance.wa.gov */
.btn {
    border-radius: 0;
    stroke-width: 2.5px;
    -webkit-text-stroke-color: #005A8B;
    font-weight: 400;
    border: none;
}

    .btn:focus:not(:disabled):not(.disabled) {
        box-shadow: none !important;
        outline: 2.5px #4BA63A solid;
        outline-offset: 0.25rem;
    }

    .btn.btn-primary {
        background-color: #337728 !important;
        color: #FCFEFF !important;
    }

        .btn.btn-primary:hover:not(:disabled):not(.disabled),
        .btn.btn-primary:focus:not(:disabled):not(.disabled) {
            background-color: #005A8B !important;
        }

/* Handle required field asterisk styles */
.required {
    color: red;
    margin-left: 0.25rem;
}

/* Hide validation summary when it's valid */
.validation-summary-valid {
    display: none;
}

/* Override Bootstrap for valid controls, so they don't turn green with check marks */
.form-control.is-valid,
.form-control.is-valid:focus,
.was-validated .form-control:valid,
.was-validated .form-control:valid:focus {
    background: none;
    border-color: #ced4da; /* Revert to default border color */
    box-shadow: none;
}

/* When a radio button group or checkbox group is required, .NET Core/Razor validation strangely
    marks only the first radio button or checkbox as invalid. So we need to fix this visually.
    NOTE: Most browsers support the :has() pseudo-class, but we don't want to break other browsers.
*/
@supports (selector(:has(*))) {
    /* Highlight the legend red, which is the label for the whole group of radio buttons or check boxes */
    fieldset.form-group:has(.is-invalid) legend {
        color: var(--danger);
    }
    /* When there's a red legend, revert the color of the first label so that it's not highlighted red or green */
    fieldset.form-group:has(legend) .form-check-input ~ .form-check-label {
        color: revert;
    }
}
