/* VAERS Reporting Modernization — Working Prototype
   Remington Data Systems LLC — Oxford & Federal Blue system
   No external assets. System font stack only. */

:root {
  --navy: #10243E;
  --navy-deep: #0A1728;
  --accent: #2E6FB8;
  --accent-soft: #7FB3E8;
  --paper: #FFFFFF;
  --slate: #4E5A70;
  --rule: #E4E7ED;
  --bg-tint: #F6F8FB;
  --error: #B3261E;
  --ok: #1E6B3A;
  --warn-bg: #FFF7E6;
  --warn-border: #E6C989;
  --warn-text: #7A4F00;
  --radius: 6px;
  --maxw: 880px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--navy);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
}

/* ---------- utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- header / banner / footer ---------- */

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 14px 0;
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.site-header .brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
}
.site-header .brand:hover { text-decoration: underline; }
.site-header .tag {
  color: var(--accent-soft);
  font-size: 13px;
}

.demo-banner {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn-text);
  font-size: 14px;
  padding: 10px 0;
}
.demo-banner strong { color: var(--warn-text); }

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 56px;
  padding: 22px 0 34px;
  color: var(--slate);
  font-size: 13px;
}
.site-footer a { color: var(--accent); }

/* ---------- landing ---------- */

.hero { padding: 44px 0 8px; }
.hero h1 {
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.hero .lede {
  color: var(--slate);
  font-size: 17px;
  max-width: 640px;
  margin: 0 0 8px;
}

.entry-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 28px 0 8px;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .entry-cards { grid-template-columns: 1fr 1fr; }
}

.entry-card {
  display: block;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  text-decoration: none;
  color: var(--navy);
  background: var(--paper);
  transition: box-shadow 120ms ease;
}
.entry-card:hover { box-shadow: 0 4px 18px rgba(16, 36, 62, 0.12); }
.entry-card h2 { margin: 0 0 8px; font-size: 19px; }
.entry-card p { margin: 0 0 12px; color: var(--slate); font-size: 15px; }
.entry-card .go {
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}

.admin-link-row {
  margin: 10px 0 0;
  padding: 16px 20px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  color: var(--slate);
  font-size: 15px;
}
.admin-link-row a { color: var(--accent); font-weight: 600; }

.pws-map { margin: 44px 0 0; }
.pws-map h2 { font-size: 20px; margin: 0 0 6px; }
.pws-map p.note { color: var(--slate); font-size: 14px; margin: 0 0 14px; }
.pws-map ul {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 10px;
}
.pws-map li {
  border-left: 3px solid var(--accent);
  background: var(--bg-tint);
  padding: 10px 14px;
  font-size: 14.5px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.pws-map li strong { display: block; }
.pws-map li span { color: var(--slate); }

/* ---------- wizard ---------- */

.mode-strip {
  background: var(--bg-tint);
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--slate);
  padding: 8px 0;
}
.mode-strip .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.mode-strip strong { color: var(--navy); }
.mode-strip a { color: var(--accent); }

.resume-banner {
  background: #EAF2FB;
  border: 1px solid #C6DBF2;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 22px 0 0;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.resume-banner button { flex-shrink: 0; }

.progress {
  margin: 30px 0 6px;
}
.progress .steps-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}
.progress .bar {
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.progress .bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 200ms ease;
}

.step h2 {
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: -0.015em;
  margin: 18px 0 6px;
}
.step .intro { color: var(--slate); margin: 0 0 22px; max-width: 640px; }

.field { margin: 0 0 22px; max-width: 560px; }
.field > label,
.choice-group legend {
  display: block;
  font-weight: 600;
  font-size: 15.5px;
  margin-bottom: 6px;
}
.req { color: var(--error); font-weight: 700; }
.hint { margin: -2px 0 8px; font-size: 13.5px; color: var(--slate); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--navy);
  background: #fff;
  border: 1px solid #9AA5B5;
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.choice-group {
  border: 0;
  padding: 0;
  margin: 0;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin: 0 0 8px;
  cursor: pointer;
  font-size: 15px;
}
.choice:hover { border-color: var(--accent-soft); }
.choice input {
  width: 20px; height: 20px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.choice input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.field .error, .form-error {
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0 0;
}
.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: var(--error);
}

/* Prominent plain-language escape hatch ("in your own words") */
.field.emphasis {
  border: 1px solid var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-bg, #F2F7FC);
  padding: 14px 16px 16px;
}
.field.emphasis > label { font-size: 16.5px; }

.symfu-group {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px 2px;
  margin: 0 0 14px;
  max-width: 560px;
}
.symfu-group > legend {
  font-weight: 700;
  font-size: 15px;
  padding: 0 6px;
}
.symfu-group .field { margin-bottom: 14px; }

.vax-instance {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 18px 4px;
  margin: 0 0 18px;
  position: relative;
  max-width: 620px;
}
.vax-instance h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 13.5px;
}
.vax-instance .remove-btn { position: absolute; top: 12px; right: 12px; }

.wizard-nav {
  display: flex;
  gap: 12px;
  margin: 30px 0 0;
  flex-wrap: wrap;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  min-height: 44px;
  padding: 10px 22px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: #275F9E; }
.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid #9AA5B5;
  font-weight: 600;
}
.btn-secondary:hover { border-color: var(--navy); }
.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  padding: 6px 8px;
  min-height: 36px;
}
.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--error);
  font-size: 13.5px;
  min-height: 32px;
  padding: 4px 10px;
}

/* ---------- review ---------- */

.review-section {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 16px;
}
.review-section .rev-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.review-section h3 { margin: 0 0 8px; font-size: 17px; }
.review-section dl { margin: 6px 0 4px; }
.review-section dt {
  font-size: 13px;
  color: var(--slate);
  font-weight: 600;
  margin-top: 10px;
}
.review-section dd {
  margin: 1px 0 0;
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.review-section .rev-sub {
  font-weight: 700; font-size: 14px;
  margin: 12px 0 0; color: var(--navy);
}
.unanswered { color: var(--slate); font-style: italic; }

/* ---------- output ---------- */

.output-note {
  background: var(--bg-tint);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14.5px;
  margin: 16px 0;
}
pre.json-preview {
  background: var(--navy-deep);
  color: #D7E3F4;
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  max-height: 480px;
}

/* ---------- admin ---------- */

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 26px;
}
@media (min-width: 900px) {
  .admin-layout { grid-template-columns: 300px 1fr; align-items: start; }
}

.admin-tree {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--bg-tint);
}
.admin-tree details { margin: 2px 0; }
.admin-tree summary {
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: var(--radius);
}
.admin-tree summary:hover { background: #E9EEF6; }
.admin-tree .tree-field {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  padding: 7px 10px 7px 22px;
  font-size: 13.5px;
  color: var(--navy);
  min-height: 34px;
}
.admin-tree .tree-field:hover { background: #E9EEF6; }
.admin-tree .tree-field[aria-current="true"] {
  background: var(--navy);
  color: #fff;
}
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: 1px;
}
.badge.req { background: #FBE9E7; color: var(--error); }
.badge.prov { background: #E3EDF9; color: var(--accent); }
.badge.branch { background: #EDE7F6; color: #5E35B1; }
.badge.off { background: #EEE; color: var(--slate); }
.tree-field[aria-current="true"] .badge { filter: none; opacity: 0.95; }

.admin-editor {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
}
.admin-editor h2 { margin: 0 0 4px; font-size: 20px; }
.admin-editor .fid {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--slate);
  margin: 0 0 18px;
}
.admin-editor .field { max-width: 640px; }
.editor-row-inline {
  display: flex; gap: 22px; flex-wrap: wrap; margin: 4px 0 18px;
}
.editor-row-inline label.toggle {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.editor-row-inline input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--accent);
}

.cond-box {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 18px;
  background: var(--bg-tint);
}
.cond-box h3 { margin: 0 0 8px; font-size: 14.5px; }
.cond-box .cond-desc { font-size: 13.5px; color: var(--slate); margin: 0 0 10px; }
.cond-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .cond-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.cond-box textarea {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.preview-pane {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 22px;
  background: var(--paper);
}
.preview-pane h3 { margin: 0 0 4px; font-size: 15px; }
.preview-pane .pv-mode {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 14px 0 8px;
}
.preview-pane .not-shown {
  color: var(--slate);
  font-style: italic;
  font-size: 14px;
}
.preview-pane .cond-note {
  font-size: 13px;
  color: #5E35B1;
  margin: 4px 0 10px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 24px 0 0;
}
.save-status { font-size: 14px; font-weight: 600; color: var(--ok); }

.prod-note {
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--slate);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  max-width: 720px;
}

/* ---------- admin v2: add question, protection notes, history ---------- */

.btn-add-question {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius);
  padding: 9px 12px;
  margin: 2px 0 10px;
  min-height: 40px;
}
.btn-add-question:hover { background: #EAF2FB; }
.btn-add-question[aria-current="true"] {
  background: var(--accent);
  color: #fff;
  border-style: solid;
}

.protect-note {
  font-size: 13.5px;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0 0 18px;
  max-width: 640px;
}
.toggle-disabled { opacity: 0.55; cursor: not-allowed; }

.cond-grid .cond-hint {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--slate);
  margin: 0;
}
.cond-remove { margin-top: 12px; }

.btn-small {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13.5px;
}

.history-panel {
  margin-top: 34px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px 14px;
  background: var(--bg-tint);
}
.history-panel h2 { margin: 0 0 4px; font-size: 19px; }
.history-panel .note { color: var(--slate); font-size: 14px; margin: 0 0 14px; max-width: 680px; }

.snapshot {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 10px;
}
.snapshot .snap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}
.snapshot .snap-summary {
  margin: 8px 0 2px;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--slate);
}
.snapshot .snap-summary li { margin: 2px 0; }

.prod-note-inline {
  font-size: 13px;
  color: var(--slate);
  margin: 12px 0 0;
}

.badge.custom { background: #E0F2E9; color: var(--ok); }

/* ---------- technical approach page ---------- */

.ta-section { margin: 40px 0 0; }
.ta-section h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.ta-section > p { max-width: 720px; }
.ta-section .note { color: var(--slate); font-size: 14px; }

.arch-svg-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  margin: 16px 0;
}
.arch-svg-wrap svg {
  display: block;
  min-width: 620px;
  width: 100%;
  height: auto;
}

.ta-list { max-width: 760px; padding-left: 22px; }
.ta-list li { margin: 6px 0; }

.risk-table-wrap { overflow-x: auto; margin: 16px 0; }
table.risk-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 680px;
  font-size: 14px;
}
.risk-table caption {
  text-align: left;
  font-size: 13px;
  color: var(--slate);
  padding-bottom: 8px;
}
.risk-table th, .risk-table td {
  border: 1px solid var(--rule);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.risk-table th {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.risk-table tbody tr:nth-child(even) { background: var(--bg-tint); }
.risk-table td:first-child { font-weight: 600; }
.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.pill.low { background: #E0F2E9; color: var(--ok); }
.pill.med { background: #FFF3D6; color: var(--warn-text); }
.pill.high { background: #FBE9E7; color: var(--error); }

.perf-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .perf-cards { grid-template-columns: repeat(3, 1fr); }
}
.perf-cards li {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.perf-cards .big {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.perf-cards .small { color: var(--slate); font-size: 13.5px; }

.ta-toplink-row {
  margin: 10px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  font-size: 15px;
  background: var(--bg-tint);
}
.ta-toplink-row a { color: var(--accent); font-weight: 700; }
.ta-toplink-row .sub { color: var(--slate); display: block; margin-top: 2px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
