/* GrailGuard Contrast & Accessibility Fixes
   Ensures WCAG 2.1 AA compliance (4.5:1 contrast ratio for normal text) */

/* Fix low-contrast text on light backgrounds */
.text-secondary, .text-muted, .hint, .subtitle, .meta {
  color: #4b5563 !important; /* gray-600: 7.0:1 on white */
}

/* Ensure placeholder text meets minimum contrast */
input::placeholder, textarea::placeholder, select::placeholder {
  color: #6b7280 !important; /* gray-500: 5.0:1 on white */
}

/* Fix badge/tag contrast */
.badge, .tag, .status-badge {
  font-weight: 600;
}
.badge.pending, .status-pending {
  background: #fef3c7 !important;
  color: #92400e !important; /* amber-800: 5.5:1 */
}
.badge.active, .status-active, .badge.paid, .status-paid {
  background: #dcfce7 !important;
  color: #166534 !important; /* green-800: 5.2:1 */
}
.badge.cancelled, .status-cancelled, .badge.failed, .status-failed {
  background: #fee2e2 !important;
  color: #991b1b !important; /* red-800: 5.8:1 */
}

/* Fix button text contrast */
.btn-primary, .btn-submit, button[type="submit"] {
  color: #ffffff !important;
}
.btn-clear, .btn-secondary, .btn-outline {
  color: #283618 !important;
  border-color: #283618 !important;
}

/* Focus indicators for keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #283618 !important;
  outline-offset: 2px !important;
}

/* Fix disabled state contrast */
button:disabled, input:disabled, select:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}

/* Ensure links are distinguishable from surrounding text */
a:not(.btn):not(.btn-primary):not(.nav-link) {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* High contrast for error/success messages */
.error, .error-msg, [class*="error"] {
  color: #991b1b !important;
}
.success, .success-msg, [class*="success"] {
  color: #166534 !important;
}

/* Fix table header contrast */
th, .table-header {
  color: #1f2937 !important; /* gray-800 */
  font-weight: 600;
}

/* Improve form label contrast */
label, .field-label {
  color: #374151 !important; /* gray-700: 9.5:1 on white */
}

/* Skip to content link for screen readers */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #283618;
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
}
