/* Register form (login/register): validation states and messages.
   Scoped to #formSignup so the rest of the login pages are unchanged. */

/* Red when invalid, green when valid. Bootstrap's icons are dropped: they sat
   under the password eye icon. */
#formSignup .form-control.is-invalid,
#formSignup .hx-dd__btn.is-invalid {
    border-color: #d92d20 !important;
    background-image: none !important;
}

#formSignup .form-control.is-valid,
#formSignup .hx-dd__btn.is-valid {
    border-color: #10594B !important;
    background-image: none !important;
}

#formSignup .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12) !important;
}

#formSignup .form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 89, 75, 0.12) !important;
}

#formSignup .form-check-input.is-invalid {
    border-color: #d92d20;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

/* One message per field, written by the page script */
#formSignup .hx-field-msg {
    display: none;
    position: relative;
    margin: -2px 0 6px;
    padding-left: 19px;
    color: #d92d20;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

#formSignup .hx-field-msg.is-shown {
    display: block;
}

#formSignup .hx-field-msg::before {
    content: "!";
    position: absolute;
    left: 0;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d92d20;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}

/* The terms message sits centred under the checkbox */
#formSignup .form-group:has(> #exampleCheck1) .hx-field-msg {
    display: none;
    width: fit-content;
    margin: 6px auto 0;
}

#formSignup .form-group:has(> #exampleCheck1) .hx-field-msg.is-shown {
    display: block;
}

/* The page's older messages are replaced by .hx-field-msg */
#formSignup .invalid-feedback,
#formSignup #pass_len,
#formSignup #pass_match,
#formSignup #email_match,
#formSignup #email_format {
    display: none !important;
}

/* Register button while the form is being sent */
#formSignup .btn-loading {
    pointer-events: none;
    opacity: 0.85;
}

.hx-spin {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: -3px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hx-spin 0.7s linear infinite;
}

@keyframes hx-spin {
    to {
        transform: rotate(360deg);
    }
}
