/* ufaa-theme.css — brand overrides for the vendor themes' "primary" colour.
   Soft UI Dashboard's primary is magenta (#cb0c9f) and Bootstrap's is blue (#0d6efd);
   neither is a UFAA brand colour. This file maps primary to navy.
   Linked in every page shell right after ufaa-tokens.css (after Soft UI / Bootstrap,
   before page-level styles, so a page can still customise these classes).
   Uses tokens from ufaa-tokens.css. */

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
    --bs-btn-bg: var(--ufaa-navy); --bs-btn-border-color: var(--ufaa-navy); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--ufaa-navy-deep); --bs-btn-hover-border-color: var(--ufaa-navy-deep); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--ufaa-navy-deep); --bs-btn-active-border-color: var(--ufaa-navy-deep); --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--ufaa-navy); --bs-btn-disabled-border-color: var(--ufaa-navy); --bs-btn-disabled-color: #fff;
    --bs-btn-focus-shadow-rgb: 29, 37, 91;
    color: #fff; background-color: var(--ufaa-navy); border-color: var(--ufaa-navy);
}
.btn-primary:hover { color: #fff; background-color: var(--ufaa-navy-deep); border-color: var(--ufaa-navy-deep); }
.btn-check:focus + .btn-primary,
.btn-primary:focus { color: #fff; background-color: var(--ufaa-navy-deep); border-color: var(--ufaa-navy-deep); }
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle { color: #fff; background-color: var(--ufaa-navy-deep); border-color: var(--ufaa-navy-deep); }
.btn-primary:disabled,
.btn-primary.disabled { color: #fff; background-color: var(--ufaa-navy); border-color: var(--ufaa-navy); }

.btn-outline-primary {
    --bs-btn-color: var(--ufaa-navy); --bs-btn-border-color: var(--ufaa-navy);
    --bs-btn-hover-bg: var(--ufaa-navy); --bs-btn-hover-border-color: var(--ufaa-navy); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--ufaa-navy); --bs-btn-active-border-color: var(--ufaa-navy); --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: var(--ufaa-navy); --bs-btn-disabled-border-color: var(--ufaa-navy);
    --bs-btn-focus-shadow-rgb: 29, 37, 91;
    color: var(--ufaa-navy); border-color: var(--ufaa-navy);
}
.btn-outline-primary:hover { color: #fff; background-color: var(--ufaa-navy); border-color: var(--ufaa-navy); }
/* Soft UI swaps the hover fill for a translucent text-only hover; keep that look, in navy */
.btn-outline-primary:hover:not(.active) { color: var(--ufaa-navy); }
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show { color: #fff; background-color: var(--ufaa-navy); border-color: var(--ufaa-navy); }

.btn-check:focus + .btn-primary, .btn-primary:focus,
.btn-check:focus + .btn-outline-primary, .btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary:focus, .btn-outline-primary:active:focus { box-shadow: 0 0 0 .2rem rgba(29, 37, 91, .35); }
.btn-close:focus { box-shadow: 0 0 0 .2rem rgba(29, 37, 91, .25); }

/* ── Text and links ──────────────────────────────────────────────────── */
/* Default link colour (Soft UI: magenta, Bootstrap: blue). Element-level, so any
   class-based link style in base.css / ufaa-ui.css / page CSS still wins. */
a { color: var(--ufaa-navy); }
a:hover { color: var(--ufaa-navy-deep); }
.text-primary { color: var(--ufaa-navy) !important; }
.link-primary, .btn-link { color: var(--ufaa-navy); }
.link-primary:hover, .link-primary:focus { color: var(--ufaa-navy-deep); }

/* ── Form focus and controls ─────────────────────────────────────────── */
.form-control:focus,
.form-select:focus,
.accordion-button:focus { border-color: var(--ufaa-gold-mid); }
.input-group .form-control:focus { border-left-color: var(--ufaa-gold-mid) !important; border-right-color: var(--ufaa-gold-mid) !important; }
.form-check-input[type="checkbox"]:indeterminate { background-color: var(--ufaa-navy); border-color: var(--ufaa-navy); }
.form-range::-webkit-slider-thumb { background-color: var(--ufaa-navy); }
.form-range::-moz-range-thumb { background-color: var(--ufaa-navy); }

/* ── Progress and lists ──────────────────────────────────────────────── */
.progress-bar { background-color: var(--ufaa-navy); }
.list-group-item.active { background-color: var(--ufaa-navy); border-color: var(--ufaa-navy); }

/* ── Contrast and size floor (2026-11-24) ────────────────────────────── */
/* Soft UI's secondary grey #8392AB is 3.1:1 on white and its .text-xxs is
   10.4px; WCAG 2.2 AA asks 4.5:1 for text. Secondary text now uses
   --ufaa-muted, and no utility class sets text below 12px. */
body { color: var(--ufaa-muted); }
.text-secondary, .text-muted, .text-body { color: var(--ufaa-muted) !important; }
.link-secondary { color: var(--ufaa-muted) !important; }
.text-xxs { font-size: .75rem !important; }
.btn-outline-secondary { --bs-btn-color: var(--ufaa-muted); --bs-btn-border-color: var(--ufaa-muted); color: var(--ufaa-muted); border-color: var(--ufaa-muted); }
.btn-outline-secondary:hover:not(.active) { color: var(--ufaa-ink); }
.page-item span { color: var(--ufaa-muted); }

/* SweetAlert2's default confirm button is purple (#7066e0), not a UFAA colour.
   Calls that pass confirmButtonColor still win (inline style). */
.swal2-popup .swal2-styled.swal2-confirm { background-color: var(--ufaa-navy); }
.swal2-popup .swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(29, 37, 91, .35); }

/* Status text (2026-11-24): Soft UI's success #82d616 (1.8:1 on white), info
   #17c1e8 (2.1:1) and warning #fbcf33 (1.5:1) fail WCAG AA as text. Same
   hues, dark enough to read; status is still also said in words. */
.text-success { color: #166b3f !important; }
.text-info    { color: #0b6e83 !important; }
.text-warning { color: var(--ufaa-warning-text) !important; }
.text-danger  { color: #b42318 !important; }

/* Soft UI gradient fills (2026-11-24): green-to-lime, blue-to-cyan,
   red-to-yellow and purple-to-pink behind white text. They are the theme's
   default palette, not UFAA's, and white on their light ends is 1.4:1 to
   2.5:1. Solid fills in the same hues, each 5:1 or better with white text. */
.bg-gradient-primary   { background-image: none !important; background-color: var(--ufaa-navy) !important; }
.bg-gradient-secondary { background-image: none !important; background-color: var(--ufaa-muted) !important; }
.bg-gradient-success   { background-image: none !important; background-color: #166b3f !important; }
.bg-gradient-info      { background-image: none !important; background-color: #0b6e83 !important; }
.bg-gradient-warning   { background-image: none !important; background-color: var(--ufaa-warning-text) !important; }
.bg-gradient-danger    { background-image: none !important; background-color: #b42318 !important; }

/* ── Message close button (2026-11-25) ─────────────────────────────────────
   One definition for every shell. A 44px target kept inside the alert by
   negative margins; margin/background/padding reset because base.css styles
   every <button> as a navy form button (margin-top: 20px pushed the × down). */
.close-btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin: -10px -8px -10px 8px; padding: 0;
    background: transparent; border: 0; border-radius: 6px; box-shadow: none;
    font-size: 22px; font-weight: 400; line-height: 1; color: var(--ufaa-muted); cursor: pointer;
}
.close-btn:hover { color: var(--ufaa-ink, #344767); background: rgba(29, 37, 91, .07); }
.close-btn:active { background: rgba(29, 37, 91, .12); }
.close-btn:focus-visible { outline: 2px solid var(--ufaa-navy); outline-offset: -2px; }
#ufaa-main:focus { outline: none; }   /* focus target after a message is dismissed, not a control */

/* ── Busy and unavailable controls (2026-11-25, UX-45; see ufaa-a11y.js) ─── */
.btn[aria-disabled="true"], button[aria-disabled="true"], a[aria-disabled="true"] { opacity: .65; cursor: not-allowed; }
[aria-busy="true"] { cursor: progress; }

/* ── Sentence case (2026-11-25, audit 002 #51) ─────────────────────────────
   Soft UI sets every button, badge and sidebar heading in spaced capitals.
   Words in capitals lose their shape and read slower, and the portal's labels
   are short enough that size and weight already set them apart. Labels are
   shown as written, in sentence case, with normal letter spacing. */
.btn, .badge, .navbar-vertical .navbar-heading { text-transform: none; letter-spacing: normal; }

/* ── Elevation (2026-11-25, audit 002 #52) ─────────────────────────────────
   Soft UI floats every card (0 20px 27px) and every button. Cards now sit on
   the page with a hairline edge; buttons are flat and show hover by colour;
   only menus, dialogs and pop-ups lift (tokens in ufaa-tokens.css). */
.card, .shadow, .shadow-sm { box-shadow: var(--ufaa-shadow-card) !important; }
.shadow-lg, .shadow-xl, .dropdown-menu, .modal-content, .popover, .toast,
.swal2-popup { box-shadow: var(--ufaa-shadow-overlay) !important; }
.btn, .btn:hover, .btn:focus:not(:focus-visible), .btn:active,
.btn:hover:not(.btn-icon-only) { box-shadow: none; }
.navbar-main.shadow-blur { box-shadow: var(--ufaa-shadow-card) !important; }
.navbar-vertical .navbar-nav .nav-link.active { box-shadow: var(--ufaa-shadow-card); }
