/* Messages that belong to a form. See js/core/field-messages.js.
   Colours are the site's own status tokens, so both themes work.
   Nothing here relies on colour alone: the error carries a "!" mark. */

.field-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.field-message--error {
    color: var(--danger);
}

.field-message--error::before {
    content: "!";
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--on-status);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* A message about the whole form: a box, because it is not about one field. */
.form-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 4px;
    border-left: 4px solid transparent;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    color: var(--ink);
}

.form-message[hidden] {
    display: none;
}

.form-message--error {
    background: var(--danger-soft);
    border-left-color: var(--danger);
}

.form-message--success {
    background: var(--ok-soft);
    border-left-color: var(--ok);
}

/* The box that is wrong. Pages with their own heavy field styles (the sign-in
   page forces its borders) add the same rule at their own strength. */
input[aria-invalid="true"] {
    border-color: var(--danger);
}
