/* Accessibility enhancements */

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

/* Form help text */
.form-help {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Focus indicators */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Skip links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Keyboard navigation */
.keyboard-navigation *:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading states */
[aria-busy="true"] {
    cursor: wait;
}

/* Error states */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-error::before {
    content: "⚠";
    font-weight: bold;
}

/* Toast notifications for screen readers */
.toast[role="alert"] {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: #1f2937;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    max-width: 300px;
    z-index: 9999;
}

/* Success states */
.form-success {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-success::before {
    content: "✓";
    font-weight: bold;
}

/* Better contrast for placeholders */
::placeholder {
    opacity: 0.7;
    color: #6b7280;
}

/* Ensure interactive elements are large enough for touch */
@media (max-width: 768px) {
    .btn,
    .action-btn,
    .card-btn {
        min-height: 44px;
        min-width: 44px;
    }
}