/* VSTS app styles, layered on USWDS 3. Colors use USWDS tokens for contrast (WCAG 2.1 AA). */

:root {
    --vsts-primary: #005ea2;
    --vsts-primary-dark: #1a4480;
    --vsts-ink: #1b1b1b;
    --vsts-base: #71767a;
    --vsts-border: #dfe1e2;
    --vsts-bg: #f0f0f0;
    --vsts-green: #00a91c;
    --vsts-green-dark: #008817;
    --vsts-amber: #ffbe2e;
    --vsts-red: #d54309;
    --vsts-grey: #a9aeb1;
    --vsts-nav-width: 15rem;
}

html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; background: #fff; color: var(--vsts-ink); }

.display-inline { display: inline; }
.vsts-loading { color: var(--vsts-base); font-style: italic; }

/* ------------------------------------------------------------------ header */
.vsts-header { background: var(--vsts-primary-dark); color: #fff; }
.vsts-header__inner { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; flex-wrap: wrap; }
.vsts-header__link:focus { outline: .25rem solid #2491ff; outline-offset: 2px; }
.vsts-header__title { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; flex: 1 1 auto; }
.vsts-header__title:visited { color: #fff; }
.vsts-header__logo { width: 2.5rem; height: 2.5rem; }
.vsts-header__agency { display: block; font-size: .8rem; opacity: .9; letter-spacing: .04em; text-transform: uppercase; }
.vsts-header__system { display: block; font-family: Merriweather, Georgia, serif; font-weight: 700; font-size: 1.15rem; }
.vsts-header__user { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; font-size: .95rem; }
.vsts-header__name { display: inline-flex; align-items: center; gap: .25rem; }
.vsts-header__link { color: #fff !important; text-decoration: underline; font-size: .95rem; display: inline-flex; align-items: center; gap: .25rem; }

/* ------------------------------------------------------------------ shell */
.vsts-shell { display: flex; flex: 1 0 auto; }
.vsts-sidenav { width: var(--vsts-nav-width); flex: 0 0 var(--vsts-nav-width); background: var(--vsts-bg); border-right: 1px solid var(--vsts-border); padding: 1rem .5rem; }
.vsts-sidenav .usa-sidenav { border: 0; }
.vsts-sidenav .usa-sidenav__item a { display: flex; align-items: center; gap: .5rem; }
.vsts-sidenav .usa-sidenav__item a .usa-icon { flex: 0 0 auto; }
.vsts-main { flex: 1 1 auto; min-width: 0; padding: 1.5rem 2rem 3rem; }
.vsts-main:focus { outline: none; }


.vsts-footer { background: var(--vsts-bg); border-top: 1px solid var(--vsts-border); font-size: .85rem; color: #3d4551; }
.vsts-footer__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 1rem; }

@media (max-width: 40em) {
    .vsts-shell { flex-direction: column; }
    .vsts-sidenav { width: 100%; flex-basis: auto; border-right: 0; border-bottom: 1px solid var(--vsts-border); }
    .vsts-main { padding: 1rem; }
    .vsts-header__system { font-size: 1rem; }
}

/* ------------------------------------------------------------------ login */
.vsts-login-banner { background: var(--vsts-primary-dark); color: #fff; }
.vsts-login-banner__inner { display: flex; align-items: center; gap: 1rem; max-width: 64rem; margin: 0 auto; padding: 1.25rem 1rem; }
.vsts-login-banner__logo { width: 3.5rem; height: 3.5rem; }
.vsts-login-banner__agency { margin: 0; font-size: .85rem; opacity: .9; }
.vsts-login-banner__title { margin: .25rem 0 0; font-family: Merriweather, Georgia, serif; font-size: 1.6rem; font-weight: 700; }
.vsts-login-main { flex: 1 0 auto; padding: 2rem 0 3rem; }
.vsts-login-heading { margin-top: 0; }
.vsts-login-cards { margin-top: 1.5rem; row-gap: 1.5rem; }
.vsts-login-card { border: 1px solid var(--vsts-border); border-radius: .5rem; padding: 1.5rem; box-shadow: 0 2px 6px rgba(0,0,0,.06); display: flex; flex-direction: column; }
.vsts-login-card__icon { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: #d9e8f6; color: var(--vsts-primary); display: flex; align-items: center; justify-content: center; }
.vsts-login-card__icon .usa-icon { width: 2rem; height: 2rem; }
.vsts-login-card__title { margin: 1rem 0 .25rem; font-size: 1.35rem; }
.vsts-login-card__desc { margin: 0 0 1rem; color: #3d4551; flex: 1 0 auto; }
.vsts-login-card__actions { margin-top: auto; flex-direction: column; flex-wrap: nowrap; }
.vsts-login-card__actions .usa-button-group__item { margin: .5rem 0 0; width: 100%; }
.vsts-login-card__actions .usa-button { width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: .5rem; }

/* ------------------------------------------------------------------ panels, tags */
.vsts-panel { border: 1px solid var(--vsts-border); border-radius: .5rem; padding: 1.25rem; margin-bottom: 1.5rem; background: #fff; }
.vsts-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.vsts-panel__title { margin: 0 0 .5rem; font-size: 1.25rem; }
.vsts-panel__header .vsts-panel__title { margin: 0; }
.vsts-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.vsts-page-header h1 { margin-top: 0; }

.vsts-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin: 0; }
.vsts-status-grid--single { grid-template-columns: 1fr; gap: .5rem; }
.vsts-status-grid dt { font-size: .85rem; color: #3d4551; }
.vsts-status-grid dd { margin: .25rem 0 0; font-weight: 700; font-size: 1.05rem; }

.vsts-offline { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 2rem; align-items: start; }
.vsts-offline .usa-form-group { margin-top: .5rem; }
.vsts-offline__warnings { margin: .25rem 0 0; padding-left: 1.25rem; font-size: .9rem; color: #3d4551; }

.vsts-tag { display: inline-block; padding: .1rem .5rem; border-radius: 1rem; font-size: .8rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.vsts-tag--success { background: #ecf3ec; color: #154c21; border-color: #70e17b; }
.vsts-tag--info { background: #e7f6f8; color: #07648d; border-color: #99deea; }
.vsts-tag--warning { background: #faf3d1; color: #5c4809; border-color: #ffbe2e; }
.vsts-tag--error { background: #f4e3db; color: #6f3331; border-color: #d54309; }
.vsts-tag--neutral { background: #f0f0f0; color: #1b1b1b; border-color: #a9aeb1; }
.vsts-header .vsts-tag--neutral { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.5); }

.vsts-table { width: 100%; font-size: .95rem; }
.vsts-table__actions { white-space: nowrap; }
.vsts-table--templates { font-size: .875rem; }
.vsts-table--templates th, .vsts-table--templates td { padding: .5rem .6rem; }
.vsts-table--templates tbody th { white-space: nowrap; }
.vsts-table--templates td { white-space: normal; }
.vsts-table .usa-hint { font-size: .8rem; }
.vsts-table--templates td:nth-child(2) { min-width: 16rem; }
.vsts-table--templates td:nth-child(5) { min-width: 9rem; }
.vsts-action-list { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.vsts-action-list .usa-button--unstyled { font-size: inherit; }
.vsts-table__actions > * + * { margin-left: .75rem; }
.vsts-danger-link { color: #b50909 !important; }

.vsts-summary-cards { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; }
.vsts-summary-card { display: block; border-radius: .5rem; padding: 1.25rem; text-decoration: none; color: var(--vsts-ink) !important; border: 1px solid var(--vsts-border); border-top-width: .4rem; }
.vsts-summary-card:hover { background: var(--vsts-bg); }
.vsts-summary-card__count { display: block; font-size: 2.5rem; font-weight: 700; line-height: 1; }
.vsts-summary-card__label { display: block; margin-top: .5rem; text-decoration: underline; }
.vsts-summary-card--success { border-top-color: var(--vsts-green); }
.vsts-summary-card--info { border-top-color: #00bde3; }
.vsts-summary-card--warning { border-top-color: var(--vsts-amber); }
.vsts-summary-card--neutral { border-top-color: var(--vsts-grey); }
.vsts-big-number { font-size: 2.5rem; font-weight: 700; margin: .25rem 0; }

/* ------------------------------------------------------------------ help tip */
.vsts-help { position: relative; display: inline-block; vertical-align: middle; margin-left: .25rem; }
.vsts-help__button { background: none; border: 0; padding: 0; color: var(--vsts-primary); cursor: help; line-height: 1; }
.vsts-help__button .usa-icon { width: 1.15rem; height: 1.15rem; }
.usa-label:has(+ .vsts-help) { display: inline-block; }
.usa-form-group > .usa-hint, .usa-fieldset > .usa-hint { display: block; }
.vsts-help__button:focus { outline: .2rem solid #2491ff; outline-offset: 1px; }
.vsts-help__text {
    position: absolute; z-index: 300; left: 50%; bottom: calc(100% + .5rem); transform: translateX(-50%);
    width: max-content; max-width: 18rem; padding: .5rem .75rem; border-radius: .25rem;
    background: #1b1b1b; color: #fff; font-size: .85rem; font-weight: 400; line-height: 1.35; text-align: left;
    visibility: hidden; opacity: 0; transition: opacity .1s; pointer-events: none; white-space: normal;
}
.vsts-help:hover .vsts-help__text, .vsts-help__button:focus + .vsts-help__text { visibility: visible; opacity: 1; }
@media (max-width: 40em) { .vsts-help__text { left: auto; right: -1rem; transform: none; max-width: 14rem; } }

/* ------------------------------------------------------------------ certification form */
.vsts-process-note { border-left: .3rem solid #00bde3; background: #e7f6f8; padding: .75rem 1rem; margin: 1rem 0; max-width: 60rem; }
.vsts-process-note p { margin: 0; }
.vsts-cert-form { max-width: 64rem; }
.vsts-section { border: 1px solid var(--vsts-border); border-radius: .5rem; padding: 0 1.25rem 1.25rem; margin-top: 1.5rem; }
.vsts-section > .usa-legend { padding: 0 .5rem; margin-left: -.5rem; font-size: 1.3rem; display: flex; align-items: center; gap: .25rem; }
.vsts-section--custom { border-color: #00bde3; background: #f5fbfc; }
.vsts-section .usa-input, .vsts-section .usa-select, .vsts-section .usa-textarea { max-width: none; }
.vsts-select-wide { max-width: 40rem; }
.vsts-textarea-short { height: 5rem; }
.vsts-row-card { border: 1px solid var(--vsts-border); border-radius: .25rem; padding: .5rem 1rem 1rem; margin: 1rem 0; background: #fafafa; }
.vsts-row-card__header { display: flex; justify-content: space-between; align-items: center; }
.vsts-row-card__title { margin: .5rem 0 0; font-size: 1rem; }
.vsts-attest .usa-checkbox__label { max-width: none; }
.vsts-endorser-note { margin-top: 1rem; padding: .75rem 1rem; background: var(--vsts-bg); border-radius: .25rem; }
.vsts-inline-radios { display: flex; gap: 1.5rem; }
.vsts-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 2rem 0 1rem; position: sticky; bottom: 0; background: #fff; padding: .75rem 0; border-top: 1px solid var(--vsts-border); z-index: 10; }
.vsts-pdf-frame { width: 100%; height: 36rem; border: 1px solid var(--vsts-border); }
.vsts-pdf-frame--tall { height: 52rem; }

/* ------------------------------------------------------------------ admin */
.vsts-filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; }
.vsts-filters .usa-form-group { margin-top: 0; }
.vsts-filters .usa-select { min-width: 12rem; }
.vsts-filters__search { flex: 1 1 18rem; }
.vsts-filters__search .usa-input { max-width: none; }
.vsts-search { display: flex; margin-top: .5rem; }
.vsts-search .usa-input { margin: 0; flex: 1 1 auto; border-right: 0; }
.vsts-search .usa-button { margin: 0; border-radius: 0 .25rem .25rem 0; padding: 0 1rem; }
/* Headings receive programmatic focus on navigation (FocusOnNavigate / modals); beat USWDS [tabindex]:focus outline. */
h1:focus, h2:focus, h1[tabindex]:focus, h2[tabindex]:focus { outline: none; }
.vsts-upload-form { max-width: 40rem; }
.vsts-file { display: block; margin-top: .5rem; }
.vsts-checklist { position: relative; max-height: 14rem; overflow-y: auto; border: 1px solid var(--vsts-border); padding: .25rem .75rem; margin-top: .5rem; }
.vsts-checklist .usa-checkbox__label { margin-top: .5rem; }

.vsts-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.vsts-toolbar .usa-button { margin: 0; display: inline-flex; align-items: center; gap: .35rem; }
.vsts-toolbar .usa-select { margin-top: 0; max-width: 20rem; }
.vsts-progress { min-width: 16rem; }
.vsts-progress__bar { height: .9rem; background: var(--vsts-border); border-radius: 1rem; overflow: hidden; }
.vsts-progress__fill { height: 100%; background: var(--vsts-green); transition: width .3s; }

.vsts-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .85rem; margin-bottom: .75rem; }
.vsts-swatch { display: inline-block; width: .9rem; height: .9rem; border: 2px solid; vertical-align: middle; margin-right: .25rem; }
.vsts-swatch--high { border-color: var(--vsts-green); background: rgba(0,169,28,.2); }
.vsts-swatch--medium { border-color: var(--vsts-amber); background: rgba(255,190,46,.25); }
.vsts-swatch--low { border-color: var(--vsts-red); background: rgba(213,67,9,.2); }
.vsts-swatch--confirmed { border-color: var(--vsts-grey); background: rgba(169,174,177,.3); }

.vsts-split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 1rem; align-items: start; }
@media (max-width: 64em) { .vsts-split { grid-template-columns: minmax(0, 1fr); } }
.vsts-split__pdf { position: sticky; top: .5rem; min-width: 0; }
@media (max-width: 64em) { .vsts-split__pdf { position: static; } }
.vsts-pdf-viewer { max-height: 80vh; overflow: auto; border: 1px solid var(--vsts-border); background: #565c65; padding: .5rem; }
.vsts-pdf-viewer > .vsts-loading { color: #fff; }
.vsts-pdf-zoom { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.vsts-pdf-zoom .usa-button { margin: 0; }
.vsts-pdf-zoom .usa-button--outline { width: auto; padding: .35rem .5rem; display: inline-flex; }
.vsts-pdf-zoom__level { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.vsts-pdf-page { position: relative; margin: 0 auto .5rem; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.vsts-pdf-page canvas { display: block; }
.vsts-pdf-overlay { position: absolute; inset: 0; }
.vsts-box { position: absolute; border: 2px solid; cursor: pointer; transition: box-shadow .15s; }
.vsts-box--high { border-color: var(--vsts-green); background: rgba(0,169,28,.15); }
.vsts-box--medium { border-color: var(--vsts-amber); background: rgba(255,190,46,.22); }
.vsts-box--low { border-color: var(--vsts-red); background: rgba(213,67,9,.18); }
.vsts-box--confirmed { border-color: var(--vsts-grey); background: rgba(169,174,177,.25); }
.vsts-box--selected { box-shadow: 0 0 0 3px #2491ff; z-index: 2; }

.vsts-mapping-scroll { max-height: 80vh; overflow: auto; border: 1px solid var(--vsts-border); }
.vsts-mapping-table { width: 100%; margin: 0; font-size: .85rem; }
.vsts-mapping-table th, .vsts-mapping-table td { vertical-align: top; font-size: .85rem; padding: .4rem .5rem; }
.vsts-mapping-table tbody th { background: transparent; }
.vsts-mapping-table .usa-hint { font-size: .8rem; }
.vsts-mapping-table .usa-button--unstyled { font-size: .8rem; }
.vsts-mapping-table thead th { position: sticky; top: 0; z-index: 3; background: var(--vsts-bg); }
.vsts-mapping-table tbody tr { cursor: pointer; }
.vsts-mapping-table__field { font-weight: 400; min-width: 8rem; max-width: 12rem; }
.vsts-mapping-table__field code { font-weight: 700; word-break: break-all; }
.vsts-mapping-table__mapping { min-width: 13rem; }
.vsts-mapping-table .usa-select, .vsts-mapping-table .usa-input { margin-top: 0; max-width: none; height: 2rem; padding-top: .2rem; padding-bottom: .2rem; font-size: .85rem; }
.vsts-mapping-table .usa-input { margin-top: .25rem; }
.vsts-mapping-table .usa-checkbox { background: transparent; }
.vsts-mapping-table .usa-checkbox__label { margin-top: .25rem; font-size: .8rem; white-space: nowrap; }
.vsts-row--selected > th, .vsts-row--selected > td { background: #d9e8f6 !important; }
.vsts-row-details td { background: #fafafa; }
.vsts-inline-fields { display: flex; gap: .35rem; margin-top: .35rem; }
.vsts-row-index { width: 4.5rem !important; flex: 0 0 auto; }

.vsts-chip { display: inline-block; min-width: 3rem; text-align: center; border-radius: 1rem; padding: .1rem .4rem; font-weight: 700; font-size: .8rem; border: 2px solid; }
.vsts-chip--high { border-color: var(--vsts-green); background: #ecf3ec; color: #154c21; }
.vsts-chip--medium { border-color: var(--vsts-amber); background: #faf3d1; color: #5c4809; }
.vsts-chip--low { border-color: var(--vsts-red); background: #f4e3db; color: #6f3331; }
.vsts-chip--confirmed { border-color: var(--vsts-grey); background: #f0f0f0; color: #1b1b1b; }

.vsts-statement { border-left: .3rem solid var(--vsts-amber); padding: .5rem 0 .5rem 1rem; margin-bottom: 1rem; }
.vsts-statement--confirmed { border-left-color: var(--vsts-green); }
.vsts-statement .usa-textarea { max-width: none; }
.vsts-statement__actions { display: flex; justify-content: space-between; align-items: center; }

.vsts-warnings { list-style: none; padding: 0; margin: 0; }
.vsts-warning { display: flex; gap: .5rem; padding: .5rem; border-left: .25rem solid var(--vsts-amber); background: #faf3d1; margin-bottom: .5rem; }
.vsts-warning--error { border-left-color: var(--vsts-red); background: #f4e3db; }
.vsts-warning--info { border-left-color: #00bde3; background: #e7f6f8; }
.vsts-warning .usa-icon { flex: 0 0 auto; margin-top: .15rem; }

/* ------------------------------------------------------------------ modal */
.vsts-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 900; }
.vsts-modal { position: fixed; z-index: 901; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; background: #fff; border-radius: .5rem; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.vsts-modal--wide { width: min(44rem, calc(100vw - 2rem)); }
.vsts-modal__header { display: flex; justify-content: space-between; align-items: flex-start; padding: 1.25rem 1.5rem 0; }
.vsts-modal__title { margin: 0; font-size: 1.35rem; }
.vsts-modal__title:focus { outline: none; }
.vsts-modal__close .usa-icon { width: 1.5rem; height: 1.5rem; }
.vsts-modal__body { padding: .5rem 1.5rem 1.5rem; }

/* ------------------------------------------------------------------ blazor */
#blazor-error-ui { background: #faf3d1; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: #f4e3db; padding: 1rem; color: #6f3331; }
.blazor-error-boundary::after { content: "An error has occurred."; }
