vaadin-password-field[readonly][invalid] {
    --lumo-required-field-indicator-color: var(--lumo-primary-text-color);
    --vaadin-input-field-invalid-background: transparent;
    --vaadin-input-field-invalid-hover-highlight: transparent;
}

vaadin-password-field[disabled][invalid] {
    --lumo-required-field-indicator-color: var(--lumo-primary-text-color);
    --vaadin-input-field-invalid-background: var(--lumo-contrast-5pct);
}

vaadin-password-field[disabled][has-error-message]::part(error-message),
vaadin-password-field[readonly][has-error-message]::part(error-message) {
    display: none;
}