/* Accessibility CSS for Revenu */
/* WCAG 2.1 AA Compliance Styles */

/* High contrast focus indicators */
*:focus {
  outline: 3px solid #3f4eae !important;
  outline-offset: 2px !important;
}

/* Enhanced focus for interactive elements */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #3f4eae !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(63, 78, 174, 0.2) !important;
}

/* Skip links accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 8px 16px;
  z-index: 9999;
  background: #3f4eae;
  color: white;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 8px 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid white;
}

/* Screen reader only content */
.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;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  * {
    border-color: currentColor !important;
  }

  button,
  .button {
    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;
  }
}

/* Color contrast improvements */
.text-muted {
  color: #666 !important;
}

@media (prefers-color-scheme: dark) {
  .text-muted {
    color: #ccc !important;
  }
}

/* Focus trap for modals */
.modal-focus-trap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
}

/* Improved button accessibility */
button:disabled,
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Link accessibility */
a:not([class]) {
  text-decoration: underline;
  color: #3f4eae;
}

a:not([class]):hover {
  text-decoration: none;
}

/* Form accessibility */
input:invalid,
select:invalid,
textarea:invalid {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2) !important;
}

label {
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

/* Error message styles */
.error-message {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Success message styles */
.success-message {
  color: #2e7d32;
  font-size: 0.875rem;
  margin-top: 4px;
}
