/* ====================================
   ACCESSIBILITY STYLES - WCAG 2.1 AA
   ==================================== */

/* Focus Indicators - Critical for keyboard navigation */
*:focus {
  outline: 3px solid #0D7377 !important;
  outline-offset: 2px !important;
}

*:focus:not(:focus-visible) {
  outline: none !important;
}

*:focus-visible {
  outline: 3px solid #0D7377 !important;
  outline-offset: 2px !important;
}

/* Button focus states */
button:focus-visible {
  outline: 3px solid #0D7377 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(13, 115, 119, 0.2) !important;
}

/* Input focus states */
input:focus,
textarea:focus,
select:focus {
  border-color: #0D7377 !important;
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.2) !important;
}

/* Link focus states */
a:focus-visible {
  outline: 3px solid #0D7377 !important;
  outline-offset: 2px !important;
  text-decoration: underline !important;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #0D7377;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  z-index: 10000;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  * {
    border-width: 2px !important;
  }
  
  button,
  input,
  select,
  textarea {
    border: 2px solid currentColor !important;
  }
}

/* Reduced motion support */
@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;
  }
}

/* Ensure minimum touch target size (44x44px) - only for main action buttons */
a,
input[type="button"],
input[type="submit"] {
  min-height: 44px;
  min-width: 44px;
}

/* Exception for icon buttons and small buttons */
button.icon-btn,
button.tooltip-btn {
  min-height: unset;
  min-width: unset;
}

/* Checkboxes and radios - use padding on label instead */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: unset;
  min-width: unset;
}

/* Exception for inline text links */
a:not([role="button"]) {
  min-height: auto;
  min-width: auto;
}

/* Ensure sufficient color contrast */
.low-contrast-warning {
  background-color: #fff3cd;
  border: 2px solid #856404;
  color: #856404;
  padding: 12px;
  margin: 8px 0;
  border-radius: 4px;
}

/* Loading/Disabled states should be clear */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error states should be clear */
[aria-invalid="true"] {
  border-color: #C0392B !important;
  border-width: 2px !important;
}

/* Required field indicator */
[aria-required="true"]::after {
  content: " *";
  color: #C0392B;
}

/* Keyboard-only focus (not mouse) */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

.js-focus-visible .focus-visible {
  outline: 3px solid #0D7377;
  outline-offset: 2px;
}

/* ====================================
   END ACCESSIBILITY STYLES
   ==================================== */
