/* Accessibility baseline (WCAG 2.1 AA, SEBI digital accessibility circular) - loaded on
 * every page by layout/defaultLayout.php (classic + /preview + /kra). Keep it small and
 * look-preserving: the only visible changes are a keyboard focus ring, slightly darker
 * light-grey text and the skip link / session notice when they are used. */

/* 2.4.1 Bypass blocks - skip link, shown only when it receives keyboard focus */
.a11y-skip {
	position: absolute; left: 12px; top: -80px; z-index: 100000;
	padding: 10px 16px; border-radius: 8px;
	background: #0b2f5b; color: #fff !important; font-weight: 600; font-size: 15px;
	text-decoration: underline; transition: top .15s;
}
.a11y-skip:focus { top: 12px; }

/* text only screen readers get */
.a11y-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;
}

/* the <main> landmark takes focus from the skip link - no ring on the whole region */
#main-content:focus { outline: none; }

/* 2.4.7 Focus visible + 1.4.11 contrast - keyboard focus only (mouse clicks unchanged).
 * Two-tone so it shows on white AND on the navy footer / hero bands. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
[role="button"]:focus-visible, [role="tab"]:focus-visible, [role="link"]:focus-visible {
	outline: 3px solid #1d4ed8 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #ffffff !important;
}
/* Text fields: browsers count a mouse CLICK into a text box as :focus-visible, so the ring
 * above showed as a square box on every click (Mohan 2026-10-13: "contradictory to the modern
 * ui/ux"). Fields instead get a border colour + soft glow that follows their rounded corners -
 * still a clear focus indicator (2.4.7). Buttons / links / tabs keep the ring above. */
/* :where() keeps this rule's weight low so the field-specific rules below win */
input:where(:not([type="checkbox"], [type="radio"], [type="file"], [type="button"], [type="submit"], [type="reset"], [type="range"], [type="color"], [type="image"])):focus-visible,
select:focus-visible, textarea:focus-visible {
	outline: none !important;
	border-color: #1d4ed8 !important;
	box-shadow: 0 0 0 3px rgba(29, 78, 216, .22) !important;
}
/* redesigned fields keep their own navy focus look (_kd_styles / _kx_styles) */
.kd-input:focus-visible, .kx-input:focus-visible {
	border-color: var(--kx-navy-2, #123f73) !important;
	box-shadow: 0 0 0 4px rgba(18, 63, 115, .16) !important;
}
/* borderless input inside a styled field: the FIELD shows focus (:focus-within) - no inner box */
.kd-auth-field input:focus-visible, .kd-auth-field select:focus-visible,
.kx-control input:focus-visible, .kx-control select:focus-visible,
.kd-search input:focus-visible, #multidate-input-wrapper input:focus-visible {
	border-color: transparent !important;
	box-shadow: none !important;
}

/* file inputs hidden behind a styled label: ring the label while the input has focus */
label:has(input[type="file"]:focus-visible) {
	outline: 3px solid #1d4ed8; outline-offset: 2px;
}

/* 1.4.3 Contrast - light grey text on white (#9ca3af = 2.5:1) -> #6b7280 (4.8:1) */
.text-gray-400 { color: #6b7280 !important; }
input::placeholder, textarea::placeholder { color: #6b7280 !important; opacity: 1; }

/* Motion off for people who ask for it (spinners keep turning - they mean "loading") */
@media (prefers-reduced-motion: reduce) {
	*:not(.animate-spin):not(.fa-spin), *::before, *::after {
		animation-duration: .01ms !important; animation-iteration-count: 1 !important;
		transition-duration: .01ms !important; scroll-behavior: auto !important;
	}
}

/* 2.2.1 Timing adjustable - "your session is about to end" notice (a11y.js) */
.a11y-timeout {
	position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center;
	justify-content: center; padding: 16px; background: rgba(15, 23, 42, .55);
}
.a11y-timeout[hidden] { display: none; }
.a11y-timeout__panel {
	width: 100%; max-width: 420px; padding: 24px; border-radius: 14px;
	background: #fff; color: #0f172a; box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
	font-size: 15px; line-height: 1.5;
}
.a11y-timeout__panel h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: #0b2f5b; }
.a11y-timeout__panel p { margin: 0 0 18px; }
.a11y-timeout__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.a11y-timeout__actions button {
	min-height: 44px; padding: 0 18px; border-radius: 10px; font-weight: 600; cursor: pointer;
}
.a11y-timeout__stay { background: #0b2f5b; color: #fff; border: 0; }
.a11y-timeout__leave { background: #fff; color: #0b2f5b; border: 1.5px solid #0b2f5b; }
