/* ReganSAFE — matches regantech.com: Public Sans + IBM Plex Mono, navy / slate / federal red.
   Fonts fall back to the system stack; drop the .woff2 files into static/fonts and add
   @font-face rules here if you want them served locally (no third-party CDNs). */

:root {
  --navy: #1B2A49;
  --navy-deep: #12203A;
  --slate: #5A6B7B;
  --slate-light: #8C9AA8;
  --red: #B22234;
  --red-deep: #8E1B29;
  --bg: #F3F5F8;
  --panel: #FFFFFF;
  --line: #D6DDE5;
  --ink: #1F2933;
  --ok: #1E7F4F;
  --ok-bg: #E3F4EA;
  --warn: #9A6700;
  --warn-bg: #FFF4D6;
  --bad: #B22234;
  --bad-bg: #FBE7E9;
  --info-bg: #E8EEF7;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(18, 32, 58, .06), 0 4px 16px rgba(18, 32, 58, .06);
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--navy); }
a:hover { color: var(--red); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.2rem; margin-top: 1.5rem; } h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.small { font-size: .875rem; } .muted { color: var(--slate); } .nowrap { white-space: nowrap; }
.eyebrow { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--red); margin-bottom: .4rem; }
.lede { font-size: 1.15rem; color: var(--slate); max-width: 46rem; }
.hint { font-size: .85rem; color: var(--slate); margin: .35rem 0 0; }
.error { color: var(--bad); font-weight: 600; }
.req { font-size: .7rem; color: var(--red); text-transform: uppercase; letter-spacing: .08em; margin-left: .4rem; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header / footer */
.site-header { background: var(--navy); color: #fff; border-bottom: 4px solid var(--red); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .8rem; color: #fff; text-decoration: none; }
.brand-plate { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; padding: 4px; }
.brand-logo { height: 36px; width: auto; display: block; }
.receipt-logo { height: 96px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.brand-sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: #B9C4D4; }
.nav { display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; }
.nav a, .nav .linklike { color: #E5EAF2; text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius); font-size: .95rem; }
.nav a:hover, .nav .linklike:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.muted { color: #B9C4D4; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; }
.inline-form { display: inline; margin: 0; }
.site-footer { background: var(--navy-deep); color: #B9C4D4; font-size: .85rem; margin-top: 3rem; }
.footer-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; flex-wrap: wrap; }
.site-footer a { color: #fff; }
.footer-links { display: flex; flex-direction: column; gap: .3rem; text-align: right; }
.notice { color: #F3B4BB; font-weight: 600; }

/* layout */
.hero { padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: 2.2rem; max-width: 40rem; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin: 1rem 0 2rem; }
.choice { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.choice:nth-child(2) { border-top-color: var(--red); }
.choice h2 { margin-top: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.facts div { background: var(--info-bg); padding: .9rem 1rem; border-radius: var(--radius); display: flex; flex-direction: column; }
.facts strong { color: var(--navy); }
.facts span { font-size: .85rem; color: var(--slate); }
.notice-box { background: var(--panel); border-left: 4px solid var(--red); padding: 1rem 1.4rem; border-radius: var(--radius); }
.notice-box h2 { margin-top: 0; font-size: 1rem; }
.notice-box ul { margin: 0; padding-left: 1.2rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); margin: 1.5rem 0; }
.panel.narrow { max-width: 34rem; }
.panel h1 { font-size: 1.5rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.2rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 1rem; }
.page-head h1 { margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2rem; }
.subnav { display: flex; gap: .2rem; }
.subnav a { padding: .4rem .8rem; border-radius: var(--radius); text-decoration: none; }
.subnav a.active { background: var(--navy); color: #fff; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; text-decoration: none; display: flex; flex-direction: column; }
.stat strong { font-size: 1.8rem; color: var(--navy); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--slate); }
.prose { max-width: 46rem; margin: 2rem auto; background: var(--panel); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--line); }
.prose ul { padding-left: 1.3rem; }
blockquote.message { margin: .5rem 0 1rem; padding: .7rem 1rem; background: var(--info-bg); border-left: 3px solid var(--navy); white-space: pre-wrap; font-size: .95rem; }

/* forms */
.form fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
.form legend { font-weight: 700; color: var(--navy); padding: 0; margin-bottom: .6rem; font-size: 1rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: .6rem .7rem; border: 1px solid #A9B4C0; border-radius: var(--radius); font: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible, .dropzone:focus { outline: 3px solid #F2B824; outline-offset: 1px; }
input[readonly] { background: #F3F5F8; color: var(--slate); }
.code-input { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .12em; text-transform: uppercase; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; margin: .6rem 0; }
.check input { margin-top: .3rem; flex: none; }
.actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.stack { margin-bottom: 1rem; }
.inline-fields { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.inline-fields input[type=number] { width: 5rem; }
.search { margin: 1rem 0; }
.search input { width: 20rem; max-width: 100%; }
.copy-row { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.copy-row input { flex: 1; }

.btn { display: inline-block; padding: .6rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--navy); background: #fff; color: var(--navy); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--info-bg); color: var(--navy); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); color: #fff; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--bad-bg); color: var(--red-deep); }
.btn-small { padding: .35rem .7rem; font-size: .85rem; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }

/* dropzone + file list */
.dropzone { border: 2px dashed #A9B4C0; border-radius: var(--radius); padding: 1.6rem; text-align: center; background: #FAFBFC; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--navy); background: var(--info-bg); }
.dropzone p { margin: 0 0 .3rem; }
.linklike-text { color: var(--navy); text-decoration: underline; }
.file-list { list-style: none; padding: 0; margin: .8rem 0 0; }
.file-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
.file-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .size { color: var(--slate); font-family: var(--mono); font-size: .85rem; }
.file-list .remove { background: none; border: 0; color: var(--red); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }

/* progress */
.progress-panel { position: sticky; top: 1rem; }
.progress-text { font-weight: 600; color: var(--navy); }
.bar { height: 14px; background: var(--line); border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--navy), #2E4A7D); transition: width .25s; }
.bar-fill.done { background: var(--ok); }
.bar-fill.error { background: var(--red); }
.progress-files { list-style: none; padding: 0; margin: 1rem 0 0; font-size: .88rem; }
.progress-files li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.progress-files .pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-files .pf-state { font-family: var(--mono); color: var(--slate); white-space: nowrap; }
.progress-files .pf-bar { grid-column: 1 / -1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-files .pf-fill { height: 100%; width: 0; background: var(--navy); }
.progress-files li.done .pf-fill { background: var(--ok); }
.progress-files li.error .pf-fill { background: var(--red); }
.passcode-panel { margin-top: 1.4rem; padding: 1rem; background: var(--warn-bg); border: 1px solid #E9C46A; border-radius: var(--radius); }
.passcode-panel h2 { margin-top: 0; font-size: 1rem; }
.passcode { font-size: 1.9rem; letter-spacing: .12em; color: var(--navy); margin: .3rem 0 .6rem; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; margin-right: .3rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-line { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 1rem; flex-wrap: wrap; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--panel); }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); background: #F7F9FB; }
.table.small { font-size: .84rem; }
.table .filename { word-break: break-word; min-width: 10rem; }
.table td:nth-child(2) { white-space: nowrap; }
.table .hash { max-width: 12rem; }
.table .detail { max-width: 26rem; word-break: break-all; font-family: var(--mono); font-size: .78rem; }
.row-new td { background: #FFFBEA; }
.row-dim td { color: var(--slate-light); }

.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; background: var(--info-bg); color: var(--navy); }
.badge-ready { background: var(--ok-bg); color: var(--ok); }
.badge-processing, .badge-scanning, .badge-uploaded, .badge-uploading { background: var(--warn-bg); color: var(--warn); }
.badge-quarantined, .badge-failed { background: var(--bad-bg); color: var(--bad); }
.badge-purged { background: #E9ECF0; color: var(--slate); }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.dl dt { font-weight: 600; color: var(--slate); } .dl dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.timeline li { padding: .4rem 0; border-bottom: 1px solid var(--line); }

/* flashes */
.flashes { margin-top: 1rem; }
.flash { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: .6rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); border-color: #BFE3CC; color: #14532D; }
.flash-error { background: var(--bad-bg); border-color: #F2C0C5; color: var(--red-deep); }
.flash-passcode { background: var(--warn-bg); border-color: #E9C46A; color: #5A3E00; font-family: var(--mono); font-size: 1rem; }

.qr img { background: #fff; border: 1px solid var(--line); padding: .5rem; border-radius: var(--radius); }

/* receipt (print) */
body.receipt { background: #fff; display: block; }
.receipt-head { display: flex; align-items: center; gap: 1rem; border-bottom: 3px solid var(--navy); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.receipt-head .brand-logo { height: 44px; }
@media print {
  .site-header, .site-footer, .actions, .nav { display: none !important; }
  .prose, .panel { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* markings, CUI warning and the acknowledgement dialog */
.mk { display: inline-block; font-family: var(--mono); font-size: .8em; font-weight: 700; background: #FFF4D6; color: #5A3E00; border: 1px solid #E9C46A; border-radius: 3px; padding: 0 .35em; margin: .1em .05em; white-space: nowrap; }
.marking-classified .mk { background: var(--bad-bg); color: var(--red-deep); border-color: #F2C0C5; }
.cui-warning { border: 2px solid var(--red); border-left-width: 8px; background: #FFF8F8; border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1.4rem; }
.cui-warning h3 { color: var(--red-deep); margin: 0 0 .4rem; font-size: 1rem; }
.cui-warning p { margin: 0; font-size: .95rem; }
.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(760px, 100% - 2rem); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(18, 32, 58, .7); }
.modal-body { padding: 1.6rem 1.8rem; border-top: 8px solid var(--red); }
.modal-body h2 { margin-top: 0; color: var(--red-deep); font-size: 1.4rem; }
.modal-body h3 { font-size: .9rem; margin: 0 0 .3rem; color: var(--navy); }
.marking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .8rem; margin: 1rem 0 1.2rem; }
.marking { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; background: #FAFBFC; }
.marking p { margin: 0; font-size: .9rem; line-height: 1.7; }
.marking-classified { border-color: var(--red); background: #FFF5F5; }
.marking-classified h3 { color: var(--red-deep); }
.modal-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 1rem; }
@media (max-width: 600px) { .modal-body { padding: 1.1rem; } .marking-grid { grid-template-columns: 1fr; } }

/* file selection toolbar */
.select-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 .6rem; }
.select-bar > span { margin-right: .4rem; }
.col-check { width: 2rem; text-align: center; }
.col-check input { width: 1.1rem; height: 1.1rem; }
.select-form { margin: 0; }
