/* WCAG AA colour-contrast fixes. Colour changes only (no layout, size, font or spacing). Linked last in base.html so it wins.
   Every colour and its measured ratio is listed in docs/project/colour-contrast-audit.md. */

/* ---------- Light mode ---------- */

/* Bootstrap grey #6c757d -> #5c636a (text-secondary, link-secondary, secondary subtle badges) */
html[data-bs-theme="light"] {
  --bs-secondary-rgb: 92, 99, 106;
  --bs-link-color: #0b5ed7;      /* default link blue #0d6efd failed on the grey page background */
  --bs-link-color-rgb: 11, 94, 215;
}
html[data-bs-theme="light"] .btn-outline-secondary { --bs-btn-color: #5c636a; }

html[data-bs-theme="light"] .text-success { color: #146c43 !important; }
html[data-bs-theme="light"] .text-danger { color: #b02a37 !important; }
html[data-bs-theme="light"] .badge.text-info { color: #056b80 !important; }
html[data-bs-theme="light"] .badge.text-warning { color: #8a6500 !important; }
html[data-bs-theme="light"] .badge.text-primary { color: #0058b3 !important; }
html[data-bs-theme="light"] code { color: #c2287a; }

/* Pricing cards and registration-group picker (colours set in their own inline styles) */
html[data-bs-theme="light"] .tier:not(.feat) .tier-eyebrow,
html[data-bs-theme="light"] .tier:not(.feat) .tier-price .unit,
html[data-bs-theme="light"] .tier:not(.feat) .tier-pricesub { color: #6b7587; }
html[data-bs-theme="light"] .btn-book-demo { color: #26749f !important; }
html[data-bs-theme="light"] .rg-picker .rg-tier-verification .rg-tier-title { color: #0b7a54; }
html[data-bs-theme="light"] .rg-picker .rg-tier-certification .rg-tier-title { color: #c2410c; }

/* ---------- Dark mode ---------- */

html[data-bs-theme="dark"] {
  --bs-secondary-rgb: 156, 163, 175;   /* was #6c757d (3.8:1 on the dark surface) */
}
html[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #9ca3af; }

/* Brand blue #3b82f6 is fine as text on dark but too light behind white text: use the next step down */
html[data-bs-theme="dark"] .btn-primary,
html[data-bs-theme="dark"] .bg-primary,
html[data-bs-theme="dark"] .text-bg-primary {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
}
html[data-bs-theme="dark"] .nav-pills .nav-link.active,
html[data-bs-theme="dark"] .nav-pills .show > .nav-link,
html[data-bs-theme="dark"] .list-group-item.active {
  background-color: #1d4ed8 !important;   /* also carries small grey-blue helper text */
  border-color: #1d4ed8 !important;
}
html[data-bs-theme="dark"] .btn-primary:hover { background-color: #1d4ed8 !important; border-color: #1d4ed8 !important; }

html[data-bs-theme="dark"] .text-primary,
html[data-bs-theme="dark"] .link-primary,
html[data-bs-theme="dark"] .btn-outline-primary { color: #6ea8fe !important; }
html[data-bs-theme="dark"] .btn-outline-primary:hover { color: #fff !important; }
html[data-bs-theme="dark"] .preview-mode-banner .btn-outline-primary { color: #2563eb !important; } /* white pill */

html[data-bs-theme="dark"] .text-danger { color: #f27a86 !important; }
html[data-bs-theme="dark"] .text-success { color: #34b37a !important; }
html[data-bs-theme="dark"] .badge.bg-warning.text-dark,
html[data-bs-theme="dark"] .btn-warning.text-dark { color: #212529 !important; } /* dark-mode text-dark remap made it near-white on yellow */
html[data-bs-theme="dark"] .rg-picker .rg-tier-specialised .rg-tier-title { color: #9a7df0; }
html[data-bs-theme="dark"] .bg-secondary { --bs-secondary-rgb: 108, 117, 125; } /* keep the original grey fill behind white text */
html[data-bs-theme="dark"] .table-light {   /* Bootstrap's table-light is near-white even in dark mode */
  --bs-table-bg: #1f2937;
  --bs-table-color: #f3f4f6;
  --bs-table-border-color: #374151;
}
