/**
 * WCAG 2.2 Accessibility Fixes - ne-nlc-bill-tracker
 *
 * WCAG Success Criteria Addressed:
 *   2.4.1 Bypass Blocks (Level A)    - skip link focus visibility
 *   1.4.3 Contrast Minimum (Level AA) - PDF links in .form-text on white
 *   1.4.3 Contrast Minimum (Level AA) - btn-link buttons in card bodies and list-group items on white
 *   1.4.3 Contrast Minimum (Level AA) - badge-success (New Bills!) white text on green
 *   1.4.3 Contrast Minimum (Level AA) - bill name links in list-group-item on white
 *   1.4.3 Contrast Minimum (Level AA) - text-muted in list items: hint text, "no entries" notices, mdash separators
 *   1.4.3 Contrast Minimum (Level AA) - "Remove" links (a.text-danger) in list items on bg-faded
 *   1.4.3 Contrast Minimum (Level AA) - "Profile:" / "Report Period:" labels in card-header
 *   1.4.3 Contrast Minimum (Level AA) - bill name links in report card-body on white
 *   best practice (WCAG 1.4.3 exempts inactive UI) - disabled radio labels on report_setup.tpl
 *   1.4.3 Contrast Minimum (Level AA) - text-muted in card-body on white (login.tpl)
 *   1.4.3 Contrast Minimum (Level AA) - h2 small.text-muted on grey page background (login.tpl)
 *   1.4.3 Contrast Minimum (Level AA) - "BillTracker" small.text-info in navbar on white
 *   1.4.3 Contrast Minimum (Level AA) - "Logout" btn-link button in navbar on white
 */

/* Skip link - visible when focused (WCAG 2.4.1 Bypass Blocks, Level A) */
a.sr-only-focusable:focus {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10000;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: #000000;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
}

/* Links inside .form-text on white background fail contrast (WCAG 1.4.3, Level AA)
 * #005580 provides 7.1:1 contrast ratio against white (#ffffff) */
p.form-text a,
.faq-answer a {
    color: #005580 !important;
    text-decoration: underline;
}

p.form-text a:hover,
p.form-text a:focus,
.faq-answer a:hover,
.faq-answer a:focus {
    color: #003d5c !important;
}

/* btn-link buttons inside card bodies and list-group items on white background
 * (WCAG 1.4.3, Level AA). Bootstrap default #007bff gives ~3.1:1; #005580 gives 7.1:1.
 * Scoped to avoid overriding btn-link on colored header backgrounds.
 * list-group-item selector covers <button> elements (e.g. "Edit" on account.tpl)
 * that are not matched by the .list-group-item a rule. */
.card-body .btn.btn-link,
.list-group-item .btn.btn-link {
    color: #005580;
}

.card-body .btn.btn-link:hover,
.card-body .btn.btn-link:focus,
.list-group-item .btn.btn-link:hover,
.list-group-item .btn.btn-link:focus {
    color: #003d5c;
}

/* badge-success ("New Bills!") white text on #28a745 gives ~2.9:1 (WCAG 1.4.3, Level AA)
 * #155724 (Bootstrap dark success) gives 7.8:1 with white text. */
.badge-success {
    background-color: #155724 !important;
}

/* Bill name links in list-group-item cards on white background (WCAG 1.4.3, Level AA)
 * Bootstrap default #007bff gives ~4.0:1; #005580 gives 7.1:1 on white. */
.list-group-item a {
    color: #005580;
}

.list-group-item a:hover,
.list-group-item a:focus {
    color: #003d5c;
}

/* text-muted elements in list items on white (WCAG 1.4.3, Level AA)
 * Covers two cases:
 *   small.text-muted - match criteria hint text on profile_matches.tpl
 *   em.text-muted    - "no entries" notification on profile.tpl (bg-faded is a Bootstrap 4
 *                      alpha class not defined in stable; renders on white background)
 *   span.text-muted  - &mdash; separator between bill name and headline on tracked.tpl
 *                      and profile_matches.tpl
 * Bootstrap 4.0/4.1 text-muted is #868e96 (~3.3:1 on white, fails).
 * Bootstrap 4.3+ text-muted is #6c757d (~4.7:1 on white, passes).
 * Since bootstrap-4.current version is unknown, explicitly override to #6b6b6b (5.3:1). */
.list-group-item small.text-muted,
.list-group-item em.text-muted,
.list-group-item span.text-muted {
    color: #6b6b6b !important;
}

/* "Remove" links (a.text-danger) in list items on bg-faded background (WCAG 1.4.3, Level AA)
 * bg-faded may render as light gray from platform CSS; Bootstrap text-danger #dc3545
 * gives ~4.2:1 on light gray (fails) and a borderline ~4.5:1 on white.
 * #b02a37 gives 6.0:1 on light gray and 6.5:1 on white. */
.list-group-item a.text-danger {
    color: #b02a37 !important;
}

/* Bill name links (a.font-weight-bold) in report card-body on white (WCAG 1.4.3, Level AA)
 * Covers report.tpl, treport.tpl, creport.tpl. Bootstrap default #007bff gives ~4.0:1;
 * #005580 gives 7.1:1 on white. Scoped to .font-weight-bold to avoid broad card-body impact. */
.card-body a.font-weight-bold {
    color: #005580;
}

.card-body a.font-weight-bold:hover,
.card-body a.font-weight-bold:focus {
    color: #003d5c;
}

/* "Profile:" and "Report Period:" labels (span.text-muted) in card-header on View Report
 * pages (report.tpl, treport.tpl, creport.tpl) (WCAG 1.4.3, Level AA).
 * Bootstrap card-header background is rgba(0,0,0,.03) ≈ #f7f7f7; text-muted varies by
 * version. #6b6b6b gives 5.0:1 on #f7f7f7 and 5.3:1 on white. */
.card-header .text-muted {
    color: #6b6b6b !important;
}

/* Disabled radio/checkbox labels on report_setup.tpl (best practice — WCAG 1.4.3 exempts
 * inactive UI components, but low contrast on disabled labels is still poor UX).
 * report_setup.tpl has no inner white card; page background is rgb(226,233,237) = #E2E9ED.
 * Bootstrap disabled custom-control-label color varies by version and platform CSS may
 * apply additional opacity. #6b6b6b (used elsewhere) gives only 4.35:1 on #E2E9ED (fails).
 * #595959 gives 5.7:1 on #E2E9ED and 7.0:1 on white. */
.custom-control-input:disabled ~ .custom-control-label {
    color: #595959 !important;
}

/* text-muted inside card-body on white background (WCAG 1.4.3, Level AA)
 * Covers: lead paragraph in New User tab and "Forgot Password?" link on login.tpl.
 * Bootstrap text-muted varies by version; #6b6b6b gives 5.3:1 on white. */
.card-body .text-muted {
    color: #6b6b6b !important;
}

/* text-muted in h2 subheadings on grey page background (WCAG 1.4.3, Level AA)
 * Covers: "Premium Bill Tracking" / "Free Access..." subtitles on login.tpl.
 * These sit outside any card on the #E2E9ED page background.
 * #6b6b6b gives only 4.35:1 on #E2E9ED (fails); #595959 gives 5.7:1 on #E2E9ED
 * and 7.0:1 on white. */
h2 small.text-muted {
    color: #595959 !important;
}

/* "BillTracker" sub-heading (small.text-info) in navbar on white background (WCAG 1.4.3, Level AA)
 * Bootstrap text-info #17a2b8 gives ~3.1:1 on white; #0c7285 gives 5.6:1. */
.navbar-brand small.text-info {
    color: #0c7285 !important;
}

/* "Logout" btn-link button in navbar on white background (WCAG 1.4.3, Level AA)
 * Bootstrap default btn-link color #007bff gives ~3.1:1 on white (fails).
 * #005580 gives 7.1:1 on white. Scoped to navbar-nav to avoid impacting
 * btn-link on colored backgrounds elsewhere. */
.navbar-nav .btn.btn-link {
    color: #005580;
}

.navbar-nav .btn.btn-link:hover,
.navbar-nav .btn.btn-link:focus {
    color: #003d5c;
}
