/*
 * Contrast overrides (WCAG 2.1 AA, 4.5:1 for text) - MOB-025.
 *
 * Bootstrap's default warning (#ffc107), info (#0dcaf0) and primary/secondary
 * outline colours fail AA as text on white or on the light card headers
 * (#f8f8f9 / #f8f9fa). Loaded by every shell (app, auth/public, admin) after
 * Bootstrap so the fixes apply everywhere without touching each template.
 */
:root {
    --bm-a11y-warning-text: #7a5c03;  /* 6.2:1 on white */
    --bm-a11y-info-text: #055160;     /* 8.9:1 on white */
    --bm-a11y-primary-text: #0a58ca;  /* 6.0:1 on white, 5.7:1 on #f8f9fa */
    --bm-a11y-secondary-text: #5c636a;/* 6.0:1 on white, 5.6:1 on #f8f9fa */
    --bm-a11y-success-text: #146c43;  /* 6.4:1 on white, 5.9:1 on #e8f3ee */
}

/* Coloured text utilities used for links and labels */
.text-warning,
a.text-warning,
.link-warning { color: var(--bm-a11y-warning-text) !important; }
.text-info,
a.text-info,
.link-info { color: var(--bm-a11y-info-text) !important; }
/* #198754 is 4.5:1 on white but only ~4:1 on success tints such as
   bg-success bg-opacity-10 (picking "Picked", legal acceptance footer; F-UI-005) */
.text-success,
a.text-success,
.link-success { color: var(--bm-a11y-success-text) !important; }

/* Outline buttons: darker text/border at rest; fills keep Bootstrap colours */
.btn-outline-primary {
    --bs-btn-color: var(--bm-a11y-primary-text);
    --bs-btn-border-color: var(--bm-a11y-primary-text);
}
.btn-outline-secondary {
    --bs-btn-color: var(--bm-a11y-secondary-text);
    --bs-btn-border-color: var(--bm-a11y-secondary-text);
}
.btn-outline-warning {
    --bs-btn-color: var(--bm-a11y-warning-text);
    --bs-btn-border-color: #cc9a06;
    --bs-btn-hover-color: #000;
    --bs-btn-active-color: #000;
}
.btn-outline-info {
    --bs-btn-color: var(--bm-a11y-info-text);
    --bs-btn-border-color: #0aa2c0;
    --bs-btn-hover-color: #000;
    --bs-btn-active-color: #000;
}

/* Links on light surfaces (breadcrumbs, card headers) */
.breadcrumb a { color: var(--bm-a11y-primary-text); }

/* Solid info/warning backgrounds must carry dark text */
.bg-info.text-white,
.bg-warning.text-white { color: #000 !important; }

/* Inline code inside tinted alerts */
.alert code { color: inherit; }

/* Summernote placeholder (#808080 is 3.9:1) */
.note-editor .note-placeholder { color: var(--bm-a11y-secondary-text); }

/* Inline links inside running text are underlined, not colour-only
   (axe link-in-text-block, MOB2-007) */
p a:not(.btn):not(.badge):not(.dropdown-item):not(.nav-link),
.form-text a:not(.btn),
.alert a:not(.btn):not(.alert-link) { text-decoration: underline; }

/* Visually-hidden labels inside scrolling tables (e.g. "Actions" column
   headers) are position:absolute; without a positioned wrapper they escape
   the scroll clip and widen the page on phones. */
.table-responsive { position: relative; }

/* Legal documents: section headings stay smaller than the page title
   (UI2-007). Seeded content uses h2/h3 inside a card titled with h1.h4. */
.legal-content h2 { font-size: 1.15rem; margin-top: 1.25rem; }
.legal-content h3 { font-size: 1.05rem; margin-top: 1rem; }
.legal-content h4, .legal-content h5, .legal-content h6 { font-size: 1rem; }

/* Muted text: Bootstrap's #6c757d is 4.4:1 on the light table headers */
.text-muted,
.text-secondary { color: var(--bm-a11y-secondary-text) !important; }

/* Badges on light fills (info/warning/light) need dark text (white is 1.6–2:1) */
.badge.bg-info,
.badge.bg-warning,
.badge.bg-light:not([class*="text-"]) { color: #000; }
