/* ─────────────────────────────────────────────────────────────────────────
 * MRA POS — WCAG 2.1 AA Accessibility Add-ons
 * Loaded after design-tokens.css
 * ───────────────────────────────────────────────────────────────────────── */

/* SC 2.4.1 — Skip link to main content */
.skip-link {
    position: absolute;
    top: -40px; left: 8px;
    background: var(--accent-600);
    color: #fff;
    padding: 8px 16px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 600;
    z-index: 100000;
    transition: top .15s var(--ease);
}
.skip-link:focus, .skip-link:focus-visible {
    top: 0;
    outline: 3px solid var(--accent-200);
    outline-offset: 0;
}

/* SC 2.4.7 — Focus Visible (universal) */
*:focus-visible {
    outline: 2px solid var(--accent-600) !important;
    outline-offset: 2px !important;
    border-radius: 2px !important;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-100) !important;
}

/* SC 2.3.3 — Animation from Interactions / 2.2.2 — Pause, Stop, Hide */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* SC 1.4.3 — Contrast (Minimum) — bump small/secondary text up */
.help-block, small.text-muted, .text-muted {
    color: var(--text-2) !important; /* tighter contrast (was --text-3) */
}
.form-control::placeholder {
    color: var(--text-3) !important; /* AA on white = 4.5:1 */
}

/* SC 2.4.4 — Link Purpose: ensure underlined links in body content */
.content a:not(.btn):not(.label):not(.badge):not(.dropdown-item) {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

/* SC 1.3.1 — Info & Relationships: visually-hidden helper for screen-reader text */
.visually-hidden, .sr-only {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0,0,0,0) !important;
    white-space: nowrap !important; border: 0 !important;
}

/* SC 1.4.10 — Reflow: ensure horizontal scroll never required at 320px */
@media (max-width: 320px) {
    .content, .box, .panel, .card { padding-left: 8px; padding-right: 8px; }
}

/* SC 1.4.11 — Non-text Contrast: inputs / buttons need ≥3:1 against background */
.form-control, .btn { border-width: 1px !important; }

/* SC 2.5.5 — Target Size: tap targets ≥24×24px */
.btn, .label, .pagination > li > a, .nav > li > a {
    min-height: 24px;
}
.btn-xs { min-height: 22px; }

/* SC 1.3.4 — Orientation: never lock to portrait/landscape; default OK */

/* SC 4.1.3 — Status Messages: live regions */
[role="alert"], [role="status"], .alert {
    /* Make sure announcers fire — already standard via ARIA but reinforce visibility */
}

/* High-contrast / dark-mode preferences — out of scope for this pass but keep palette tokens compatible */
@media (prefers-contrast: more) {
    :root {
        --border-1: #94a3b8;
        --border-2: #475569;
        --text-3: #334155;
    }
}
