/* WCAG 2.2 Level AA Enhancements */

/* Skip link for keyboard navigation (WCAG 2.4.1 - Bypass Blocks) */
.skip-link {
	position: absolute;
	top: -40px;
	left: 0;
	background: #005580;
	color: #ffffff;
	padding: 12px 16px;
	text-decoration: none;
	z-index: 9999;
	font-weight: bold;
	border-radius: 0 0 4px 0;
	border: 2px solid transparent;
}

.skip-link:focus {
	top: 0;
	outline: 3px solid #ffdd00;
	outline-offset: 2px;
	background: #003d5c;
	color: #ffffff;
	border: 2px solid #ffdd00;
}

.skip-link:hover {
	background: #003d5c;
	color: #ffffff;
	text-decoration: underline;
}

/* Enhanced focus indicators for keyboard navigation (WCAG 2.4.7 - Focus Visible, WCAG 2.4.11 - Focus Appearance) */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
.btn:focus {
	outline: 3px solid #0077AA;
	outline-offset: 2px;
}

/* Visible focus for links */
a:focus {
	text-decoration: underline;
	background-color: rgba(0, 119, 170, 0.1);
}

/* Enhanced focus for form controls */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="submit"]:focus,
textarea:focus,
select:focus {
	border-color: #0077AA;
	box-shadow: 0 0 0 3px rgba(0, 119, 170, 0.25);
	outline: 3px solid #0077AA;
	outline-offset: 0;
}

/* Ensure sufficient contrast for link hover states (WCAG 1.4.3) */
a:hover {
	color: #005580;
	text-decoration: underline;
}

/* Improve disabled button contrast (WCAG 1.4.3) */
.btn-notice.disabled,
.btn-notice[disabled],
.btn-notice2.disabled,
.btn-notice2[disabled] {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Ensure minimum target size for interactive elements (WCAG 2.5.8 - Target Size) */
.btn,
.btn-notice,
.btn-notice2,
button,
a.btn {
	min-height: 44px;
	min-width: 44px;
	padding: 12px 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Exception for small buttons in tables/pagination */
.btn-sm,
.btn-notice-sm {
	min-height: 32px;
	min-width: 32px;
}

/* Improve contrast for placeholder text (WCAG 1.4.3) */
::-webkit-input-placeholder {
	color: #6c757d;
	opacity: 1;
}
::-moz-placeholder {
	color: #6c757d;
	opacity: 1;
}
:-ms-input-placeholder {
	color: #6c757d;
	opacity: 1;
}
::placeholder {
	color: #6c757d;
	opacity: 1;
}

/* Ensure proper focus visibility for navigation links (WCAG 2.4.11) */
.navbar-notice .navbar-nav > li > a:focus {
	outline: 3px solid #00CCFF;
	outline-offset: -3px;
	background-color: rgba(0, 204, 255, 0.15);
}

/* Better focus indicator for tab navigation */
.nav-tabs > li > a:focus {
	outline: 3px solid #0077AA;
	outline-offset: 2px;
	background-color: rgba(0, 119, 170, 0.1);
}

/* Focus indicator for active navigation items (WCAG 2.4.11) */
.navbar-notice .navbar-nav > .active > a:focus {
	outline: 3px solid #0077AA;
	outline-offset: -3px;
}

/* Improve form label visibility */
label {
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #212529;
}

/* Ensure links in footer have sufficient contrast */
.footer-bottom a {
	color: #ffffff;
	text-decoration: underline;
}

.footer-bottom a:hover,
.footer-bottom a:focus {
	color: #00CCFF;
	text-decoration: underline;
}

/* Better visual distinction for required fields */
.required::after {
	content: " *";
	color: #dc3545;
	font-weight: bold;
}

/* Improve error message visibility */
.error-message,
.field-validation-error {
	color: #721c24;
	background-color: #f8d7da;
	border: 2px solid #f5c6cb;
	padding: 8px 12px;
	margin-top: 4px;
	border-radius: 4px;
	display: block;
}

/* Success message styling */
.success-message {
	color: #155724;
	background-color: #d4edda;
	border: 2px solid #c3e6cb;
	padding: 8px 12px;
	margin-top: 4px;
	border-radius: 4px;
	display: block;
}

/* Ensure proper heading hierarchy styling */
h1, h2, h3, h4, h5, h6 {
	margin-top: 1em;
	margin-bottom: 0.5em;
	line-height: 1.3;
}

/* Use .h1-.h6 classes to apply heading styles without affecting hierarchy */
.h3 {
	font-size: 1.75rem;
	font-weight: 600;
}

.h4 {
	font-size: 1.25rem;
	font-weight: 600;
}

/* Improve table accessibility */
table {
	border-collapse: collapse;
	width: 100%;
}

th {
	text-align: left;
	font-weight: 600;
	background-color: #f8f9fa;
}

/* Ensure proper focus for dropdown menus */
.dropdown-menu > li > a:focus {
	outline: 2px solid #0077AA;
	outline-offset: -2px;
	background-color: rgba(0, 119, 170, 0.1);
}

/* Improve contrast for date picker calendar icon */
.input-group-addon {
	cursor: pointer;
}

.input-group-addon:focus-within {
	outline: 3px solid #0077AA;
	outline-offset: 2px;
}

/* Better indication of current page in navigation (WCAG 2.4.8) */
.navbar-notice .navbar-nav > .active > a,
.navbar-notice .navbar-nav > .active > a:hover,
.navbar-notice .navbar-nav > .active > a:focus {
	border-bottom: 4px solid #00CCFF;
	font-weight: 600;
}

/* Responsive text sizing for better readability */
@media screen and (max-width: 768px) {
	body {
		font-size: 16px;
	}
	
	.btn,
	.btn-notice,
	.btn-notice2 {
		min-height: 48px;
		font-size: 16px;
	}
}

/* Print styles for accessibility */
@media print {
	.skip-link,
	.navbar,
	.footer-bottom {
		display: none;
	}
	
	a[href]:after {
		content: " (" attr(href) ")";
	}
}

/* Ensure calendar icons in input groups are properly hidden */
.input-group-addon img[role="presentation"] {
	pointer-events: none;
}

/* Fix for fieldset legend styling */
fieldset {
	border: none;
	padding: 0;
	margin: 0;
}

fieldset legend {
	font-size: inherit;
	font-weight: normal;
	margin-bottom: 0.5rem;
	padding: 0;
	border: none;
}

/* Pagination navigation styling */
nav[aria-label*="pagination"] {
	margin-top: 20px;
	margin-bottom: 20px;
}

/* Ensure status messages are visible */
[role="status"][aria-live="polite"] {
	font-weight: 600;
	color: #212529;
}
