/* Styling for intake-validation.js.
 *
 * Rule that drives every choice here: an invalid field is NEVER signalled by
 * colour alone. Each one carries a border/outline change, a red label, AND an
 * inline text message -- so the state survives a colour-vision deficiency, a
 * high-contrast theme, and a greyscale print.
 */

:root {
    --iv-err: #a8321f;
    --iv-err-bg: #fdf3f1;
    --iv-err-border: #e7b4aa;
}

/* ---------------------------------------------------------------- summary */

.validation-summary {
    border: 3px solid var(--iv-err);
    background: var(--iv-err-bg);
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    margin: 0 0 1.5rem;
}

.validation-summary:focus {
    outline: 3px solid var(--iv-err);
    outline-offset: 3px;
}

.validation-summary__title {
    margin: 0 0 .35rem;
    font-size: 1.15rem;
    line-height: 1.3;
    color: var(--iv-err);
    font-weight: 700;
}

.validation-summary__lead {
    margin: 0 0 .6rem;
    color: #4a2019;
    font-size: .95rem;
}

.validation-summary__list {
    margin: 0;
    padding-left: 1.2rem;
}

.validation-summary__list li {
    margin-bottom: .3rem;
    line-height: 1.45;
}

.validation-summary__page {
    display: inline-block;
    margin-right: .4rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--iv-err);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .3px;
    vertical-align: 1px;
}

.banner button.errlink,
.validation-summary button.errlink {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: #7c2d20;
    text-decoration: underline;
    cursor: pointer;
    text-align: left;
}

.validation-summary button.errlink:hover {
    color: #000;
}

.validation-summary button.errlink:focus-visible {
    outline: 3px solid var(--iv-err);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ------------------------------------------------------------ field state */

.field.bad input,
.field.bad select,
.field.bad textarea {
    border-color: var(--iv-err) !important;
    box-shadow: 0 0 0 3px rgba(168, 50, 31, .14);
}

.field.bad label,
.field.bad .lab {
    color: var(--iv-err);
}

/* Non-input anchors -- radio/role-card groups, "add row" buttons, notes --
   must be visible too, or a flagged error stays invisible. */
.bad:not(.field) {
    outline: 2px solid var(--iv-err);
    outline-offset: 3px;
    border-radius: 10px;
}

.ferr {
    display: block;
    margin-top: 5px;
    color: var(--iv-err);
    font-size: .82rem;
    line-height: 1.4;
    font-weight: 600;
}

.ferr::before {
    content: "\26A0";           /* warning sign -- a non-colour cue */
    margin-right: 5px;
    font-weight: 700;
}

/* Table rows carry their own wrapper-less inputs. */
td.bad,
th.bad {
    outline: 2px solid var(--iv-err);
    outline-offset: -2px;
}

@media (prefers-contrast: more) {
    .field.bad input,
    .field.bad select,
    .field.bad textarea {
        border-width: 2px;
    }
}
