/* Accessibility improvements */

/* 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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px 12px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: #f2849e;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  z-index: 10000;
}

/* Form validation styles */
.field input.error,
.field textarea.error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.error-message {
  color: #dc3545;
  font-size: 0.875em;
  margin-top: 0.25rem;
  display: block;
}

/* Notification styles */
.notification {
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.notification.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.close-notification {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: inherit;
  padding: 0;
  margin-left: 1rem;
}

.close-notification:hover,
.close-notification:focus {
  opacity: 0.7;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Focus improvements */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #f2849e;
  outline-offset: 2px;
}

/* Skip link improvements */
a[href='#main'] {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #f2849e;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 10000;
  font-weight: bold;
}

a[href='#main']:focus {
  top: 0;
}

/* Better color contrast for links */
a {
  color: #0056b3;
}

a:hover,
a:focus {
  color: #f2849e;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .notification.success {
    background-color: #000;
    color: #00ff00;
    border: 2px solid #00ff00;
  }

  .notification.error {
    background-color: #000;
    color: #ff0000;
    border: 2px solid #ff0000;
  }
}

/* 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;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .notification.success {
    background-color: #0f5132;
    color: #d1e7dd;
    border-color: #2d6a4f;
  }

  .notification.error {
    background-color: #842029;
    color: #f8d7da;
    border-color: #a52834;
  }
}
