/**
 * Nebraska Motor Fuels Tax - Accessibility Enhancements
 * WCAG 2.2 Level A/AA Compliance
 *
 * This file provides accessibility enhancements for the motor fuels tax application:
 * - Keyboard focus indicators
 * - Skip link functionality
 * - Screen reader utilities
 * - Touch target sizing
 * - Focus management
 */

/* ==================================================
   SKIP LINK
   WCAG: 2.4.1 Bypass Blocks (Level A)
   ================================================== */

.sr-only-focusable {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 20px;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: #000000;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    border: 2px solid #FFFFFF;
    border-radius: 4px;
}

/* ==================================================
   SCREEN READER ONLY
   WCAG: 1.3.1 Info and Relationships (Level A)
   ================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================================================
   FOCUS INDICATORS
   WCAG: 2.4.7 Focus Visible (Level AA)
   ================================================== */

/* Global focus indicator for all interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

/* Form elements - Enhanced focus for better visibility */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
}

/* Buttons - Clear focus indication */
button:focus,
.btn:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
input[type="reset"]:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
}

/* Navigation links - Visible focus */
nav a:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 2px;
    background-color: rgba(74, 144, 226, 0.1);
}

/* ==================================================
   TOUCH TARGET SIZING
   WCAG: 2.5.8 Target Size (Minimum) (Level AA) [WCAG 2.2]
   Note: Using 44x44px exceeds the 24x24px AA minimum requirement
   ================================================== */

/* Ensure minimum 44x44px touch targets for buttons */
.btn,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 20px;
}

/* Navigation toggle button for mobile */
.navbar-toggle {
    min-height: 44px;
    min-width: 44px;
}

/* Links should have adequate spacing */
nav a,
.footer a {
    padding: 4px 8px;
    display: inline-block;
}

/* ==================================================
   FORM ACCESSIBILITY
   WCAG: 3.3.2 Labels or Instructions (Level A)
   ================================================== */

/* Error messages should be clearly visible */
.alert-danger,
.error-message {
    background-color: #F8D7DA;
    border: 2px solid #DC3545;
    color: #721C24;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Required field indicators */
.required::after {
    content: " *";
    color: #DC3545;
    font-weight: bold;
}

/* ==================================================
   HIGH CONTRAST MODE SUPPORT
   Ensures visibility in Windows High Contrast Mode
   ================================================== */

@media (prefers-contrast: high) {
    .sr-only-focusable:focus {
        border: 3px solid;
    }

    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid;
    }
}

/* ==================================================
   REDUCED MOTION SUPPORT
   WCAG: 2.3.3 Animation from Interactions (Level AAA, best practice)
   ================================================== */

@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;
    }
}

/* ==================================================
   PRINT STYLES
   Ensure accessibility features don't break printing
   ================================================== */

@media print {
    .sr-only-focusable,
    .sr-only {
        display: none;
    }
}
