/* Footer accessibility menu and the settings it controls. */

/* ---------- Always on ---------- */
.skip-link {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    background: #000;
    color: #fff;
}
.skip-link:focus { top: 8px; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
main:focus { outline: none; }
a.nav-left { text-decoration: none; }

/* Keyboard focus is always visible, on every page */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:not(main):focus-visible {
    outline: 3px solid #1a56db !important;
    outline-offset: 2px !important;
}

/* Form fields need an edge that can be seen against the page */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select,
textarea { border-color: #767676 !important; }
#signaturePad { border-color: #767676 !important; }

/* ---------- The menu ---------- */
.a11y-open {
    background: none;
    border: none;
    font-family: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.a11y-dialog {
    width: min(420px, calc(100% - 32px));
    max-height: calc(100% - 32px);
    padding: 0;
    border: none;
    background: var(--bg-color);
    color: var(--text-dark);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: left;
}
.a11y-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.a11y-inner { padding: 22px; }

.a11y-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.a11y-title-row h2 { margin: 0; font-size: 1.75rem; }

.a11y-dialog fieldset { margin: 0 0 12px; padding: 0; border: none; }
.a11y-dialog legend { padding: 0; margin-bottom: 8px; font-size: 15px; font-weight: 600; }

.a11y-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.a11y-sizes label {
    flex: 1 1 90px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid #767676;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}
.a11y-sizes label:has(input:checked) { border: 2px solid var(--accent); font-weight: 600; }

.a11y-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--rule);
    cursor: pointer;
}
.a11y-toggle input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.a11y-toggle b { display: block; font-size: 15px; font-weight: 500; }
.a11y-toggle span span { font-size: 13px; color: var(--text-muted); }

.a11y-footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.a11y-note { margin: 0; font-size: 13px; color: var(--text-muted); flex: 1 1 180px; }

.a11y-btn {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--text-dark);
    background: transparent;
    color: var(--text-dark);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.a11y-dialog :focus-visible,
.a11y-open:focus-visible { outline: 3px solid #1a56db; outline-offset: 2px; }

/* ---------- Text size ---------- */
/* Pages set their sizes in pixels, so the whole page is scaled and everything stays in proportion. */
html.a11y-text-1 body { zoom: 1.15; }
html.a11y-text-2 body { zoom: 1.3; }
/* Long email addresses wrap instead of pushing past the edge of a phone screen */
html.a11y-text-1 main *,
html.a11y-text-2 main * { overflow-wrap: anywhere; }

/* ---------- Underline links ---------- */
html.a11y-underline a { text-decoration: underline !important; }

/* ---------- Easy-to-read font ---------- */
html.a11y-font body,
html.a11y-font body * {
    font-family: Arial, Helvetica, sans-serif !important;
    font-style: normal !important;
    letter-spacing: normal !important;
}

/* ---------- Reduce motion ---------- */
html.a11y-motion,
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* ---------- High contrast ---------- */
html.a11y-contrast body,
html.a11y-contrast body * {
    background-color: #fff !important;
    background-image: none !important;
    color: #000 !important;
    border-color: #000 !important;
    box-shadow: none !important;
    opacity: 1 !important;
}
html.a11y-contrast ::placeholder { color: #000 !important; opacity: 1 !important; }
html.a11y-contrast a { text-decoration: underline !important; }

/* Without their backgrounds, these need a visible edge */
html.a11y-contrast button,
html.a11y-contrast input:not([type="checkbox"]):not([type="radio"]),
html.a11y-contrast select,
html.a11y-contrast textarea,
html.a11y-contrast .btn,
html.a11y-contrast .site-btn,
html.a11y-contrast .site-btn-light,
html.a11y-contrast .sub-primary,
html.a11y-contrast .approval-panel {
    border: 2px solid #000 !important;
}
html.a11y-contrast .a11y-open { border: none !important; }

/* Backgrounds that carry meaning stay visible */
html.a11y-contrast .progress li.done .dot,
html.a11y-contrast .progress li.current .dot {
    background-color: #000 !important;
    color: #fff !important;
}
html.a11y-contrast .progress li.done::before,
html.a11y-contrast .progress li.current::before { background: #000 !important; }
html.a11y-contrast .progress li.current { text-decoration: underline; }
html.a11y-contrast .option:has(input:checked) { outline: 3px solid #000; }
html.a11y-contrast .a11y-sizes label:has(input:checked) { outline: 2px solid #000; }
html.a11y-contrast :focus-visible { outline: 3px solid #000 !important; outline-offset: 2px !important; }
