/* =====================================================================
   Yes Sir Events design tokens + shared components (derived from the house APFDCL theme)
   Palette = logo colours: royal blue #0023CE, orange #F17400 (yellow #FFC400 gradient), pink #E0459B. Self-hosted, no CDN.
   No inline styles anywhere (CSP style-src 'self').
   ===================================================================== */
:root {
    --brand-950: #060d3a;
    --brand-900: #0a1650;
    --brand-800: #0f1f7a;
    --brand-700: #132aa6;
    --brand-600: #0023ce;
    --brand-500: #2b4ee6;
    --brand-400: #5a77ee;
    --slate-700: #4a5578;
    --slate-600: #6b7699;
    --slate-400: #a3add0;
    --slate-200: #d5dbef;
    --slate-100: #e9edf9;
    --slate-50: #f4f6fc;
    --accent-700: #9a4300;
    --accent-600: #c25d00;
    --accent-500: #f17400;
    --accent-300: #ffc27a;
    --accent-100: #fff1e0;
    --ink: #141a33;
    --ink-2: #2a3150;
    --muted: #5d6584;
    --line: #dfe3ef;
    --line-2: #eaedf6;
    --bg: #f5f7fc;
    --white: #ffffff;
    --danger: #b42318;
    --warning: #b7791f;
    --info: #1f6f8b;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(10, 22, 80, .06), 0 1px 3px rgba(10, 22, 80, .08);
    --shadow: 0 10px 30px rgba(10, 22, 80, .09);
    --shadow-lg: 0 24px 60px rgba(10, 22, 80, .16);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

    --bs-body-font-family: var(--font);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 0, 35, 206;
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 0, 35, 206;
    --bs-link-hover-color: var(--brand-800);
    --bs-link-hover-color-rgb: 15, 31, 122;
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-focus-ring-color: rgba(241, 116, 0, .45);
    --bs-success: #1f8a4c;
    --bs-success-rgb: 31, 138, 76;
}

/* ---- accessibility: text size & contrast (server-rendered from cookies, toggled by app.js) ---- */
html { font-size: 16px; }
html.fs-sm { font-size: 14.5px; }
html.fs-lg { font-size: 17.5px; }
html.fs-xl { font-size: 19px; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { color: var(--brand-900); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--brand-600); text-underline-offset: 3px; }
a:hover { color: var(--brand-800); }
::selection { background: var(--accent-300); color: var(--brand-950); }

:focus-visible { outline: 3px solid var(--accent-500) !important; outline-offset: 2px !important; box-shadow: none !important; }
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 2000; padding: .6rem 1rem; border-radius: var(--radius-sm);
    background: var(--accent-500); color: var(--brand-950); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 10px; }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; }

/* ---- buttons ---- */
.btn { border-radius: 10px; font-weight: 600; letter-spacing: .005em; }
.btn-primary { --bs-btn-bg: var(--brand-600); --bs-btn-border-color: var(--brand-600); --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700); --bs-btn-active-bg: var(--brand-800); --bs-btn-active-border-color: var(--brand-800); --bs-btn-disabled-bg: var(--slate-600); --bs-btn-disabled-border-color: var(--slate-600); }
.btn-outline-primary { --bs-btn-color: var(--brand-600); --bs-btn-border-color: var(--brand-500); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-700); }
.btn-gold { --bs-btn-color: var(--brand-950); --bs-btn-bg: var(--accent-500); --bs-btn-border-color: var(--accent-500); --bs-btn-hover-color: var(--brand-950); --bs-btn-hover-bg: var(--accent-300); --bs-btn-hover-border-color: var(--accent-300); --bs-btn-active-bg: var(--accent-600); }
.btn-light-soft { background: var(--slate-100); border-color: var(--slate-100); color: var(--brand-700); }
.btn-light-soft:hover { background: var(--slate-200); color: var(--brand-800); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; }

/* ---- forms ---- */
.form-label { font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control, .form-select { border-radius: 10px; border-color: #cfd5e8; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 .2rem rgba(0, 35, 206, .15); }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand-600); border-color: var(--brand-600); }
.input-group-text { background: var(--slate-50); border-color: #cfd5e8; }
.captcha-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.captcha-row .form-control { flex: 1 1 140px; min-width: 0; }
.captcha-row img { border-radius: 8px; border: 1px solid var(--line); height: 48px; width: 160px; background: #f5f7fc; }
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: .25rem .45rem; }

/* ---- cards / surfaces ---- */
.card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: var(--white); border-bottom-color: var(--line-2); font-weight: 700; color: var(--brand-900); }
.surface { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.soft { background: var(--slate-50); border: 1px solid var(--line-2); border-radius: var(--radius); }

/* ---- status badges ---- */
.status-badge { font-weight: 600; letter-spacing: .01em; padding: .38em .65em; border-radius: 999px; }
.badge.text-bg-success { background: #e3f1e6 !important; color: #1d5a31 !important; }
.badge.text-bg-primary { background: #e1ecf6 !important; color: #1c4f7a !important; }
.badge.text-bg-info { background: #e0f0f4 !important; color: #165a6f !important; }
.badge.text-bg-warning { background: #fff3e3 !important; color: #85590f !important; }
.badge.text-bg-danger { background: #fbe4e1 !important; color: #9b1c12 !important; }
.badge.text-bg-secondary { background: #eceef4 !important; color: #4a5068 !important; }
.badge.text-bg-dark { background: #2b3048 !important; color: #fff !important; }
.badge-count { background: var(--accent-500); color: var(--brand-950); border-radius: 999px; font-size: .7rem; font-weight: 700; padding: .2em .55em; min-width: 1.5em; text-align: center; }

/* ---- tables ---- */
.table { --bs-table-color: var(--ink); --bs-table-hover-bg: var(--slate-50); margin-bottom: 0; }
.table > thead th { background: var(--slate-50); color: var(--ink-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; border-bottom-color: var(--line); white-space: nowrap; }
.table > thead th a { color: inherit; text-decoration: none; }
.table > :not(caption) > * > * { padding: .7rem .8rem; border-bottom-color: var(--line-2); vertical-align: middle; }
tr[data-href] { cursor: pointer; }
.table-responsive { position: relative; } /* contain visually-hidden labels so tables never widen the page on phones */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
.table .mono { white-space: nowrap; } /* references such as REQ-2627-000001 never break mid-code */

/* ---- key-value + timeline ---- */
.kv { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .45rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; font-size: .88rem; }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--slate-200); }
.timeline li { position: relative; padding: 0 0 1rem 2rem; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 3px solid var(--brand-500); }
.timeline li.muted::before { border-color: var(--slate-400); }
.timeline .when { font-size: .8rem; color: var(--muted); }

/* ---- empty state ---- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .bi { font-size: 2.4rem; color: var(--slate-400); display: block; margin-bottom: .6rem; }

/* ---- alerts ---- */
.alert { border-radius: var(--radius-sm); border-width: 1px; }
.alert-success { background: #ecf6ee; border-color: #c8e3cf; color: #132aa6; }
.alert-warning { background: #fff6ea; border-color: #ffd9a8; color: #6b4a0c; }
.alert-danger { background: #fdecea; border-color: #f4c7c1; color: #8a1c12; }
.alert-info { background: #e8f3f6; border-color: #c4e0e8; color: #154f62; }

/* ---- pagination ---- */
.pagination { --bs-pagination-color: var(--brand-600); --bs-pagination-active-bg: var(--brand-600); --bs-pagination-active-border-color: var(--brand-600); --bs-pagination-hover-color: var(--brand-800); --bs-pagination-focus-box-shadow: none; }

/* ---- high contrast mode (GIGW) ---- */
html.hc body, html.hc .site-header, html.hc .surface, html.hc .card, html.hc .staff-topbar, html.hc main, html.hc .table, html.hc .page-hero, html.hc footer, html.hc .site-nav, html.hc .gov-strip, html.hc .sb {
    background: #000 !important; color: #fff !important; border-color: #fff !important;
}
html.hc a, html.hc .btn-link, html.hc .nav-link { color: #ffff00 !important; }
html.hc h1, html.hc h2, html.hc h3, html.hc h4, html.hc h5, html.hc h6, html.hc .text-muted, html.hc .form-text, html.hc .kv dt { color: #fff !important; }
html.hc .btn-primary, html.hc .btn-gold { background: #ffff00 !important; color: #000 !important; border-color: #ffff00 !important; }
html.hc .table > thead th, html.hc .table td { background: #000 !important; color: #fff !important; }
html.hc .form-control, html.hc .form-select { background: #000; color: #fff; border-color: #fff; }
html.hc img { filter: grayscale(1) contrast(1.2); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
    .no-print, .gov-strip, .site-nav, .site-header form, footer, .sb, .staff-topbar, .account-nav { display: none !important; }
    body { background: #fff; }
}
