/* =====================================================================
   AURA Shield — design system derived from the AURA glassmorphic UI
   (/workspace/aura/aura.html): iridescent aurora background, frosted
   glass panels, and 1px travelling borders in a green → blue → purple
   spectrum. No inline styles (strict CSP), system fonts only.
   ===================================================================== */
:root {
  --bg-0: #04050b; --bg-1: #080a17;
  --ink: #eef1ff; --ink-dim: rgba(226,232,255,.70); --ink-faint: rgba(226,232,255,.45);
  --cyan: #5ef2ff; --violet: #9b7bff; --teal: #3ff2c4; --blue: #6b8cff; --magenta: #ff5fd2; --gold: #ffe3a3;
  --ok: #3ff2c4; --warn: #ffd27a; --bad: #ff7a9a;
  --iri: linear-gradient(120deg, var(--teal), var(--cyan) 30%, var(--blue) 55%, var(--violet) 80%, var(--teal));
  --glass-fill: linear-gradient(145deg, rgba(255,255,255,.085), rgba(255,255,255,.025) 60%, rgba(255,255,255,.05));
  --glass-blur: blur(26px) saturate(165%);
  --radius-l: 26px; --radius-m: 18px; --radius-s: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --hs { syntax: "<number>"; inherits: false; initial-value: 0; }

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); font-size: 15px; line-height: 1.5;
  background: radial-gradient(1200px 800px at 50% 30%, #0d1030 0%, transparent 70%), linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #a9f7ff; }
::selection { background: rgba(155,123,255,.45); }

/* ---- Aurora background (from AURA) ---- */
.aurora { position: fixed; inset: -10vmax; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; width: 58vmax; height: 58vmax; border-radius: 50%; filter: blur(70px); opacity: .42; mix-blend-mode: screen; will-change: transform; }
.blob.b1 { background: radial-gradient(circle, var(--cyan) 0%, rgba(94,242,255,0) 62%); top: -8%; left: -6%; animation: drift1 38s ease-in-out infinite alternate; }
.blob.b2 { background: radial-gradient(circle, var(--violet) 0%, rgba(155,123,255,0) 62%); top: 30%; right: -14%; animation: drift2 46s ease-in-out infinite alternate; opacity: .36; }
.blob.b3 { background: radial-gradient(circle, var(--blue) 0%, rgba(107,140,255,0) 64%); bottom: -22%; left: 14%; animation: drift3 52s ease-in-out infinite alternate; }
.blob.b4 { background: radial-gradient(circle, var(--teal) 0%, rgba(63,242,196,0) 60%); top: 48%; left: -20%; width: 44vmax; height: 44vmax; animation: drift4 41s ease-in-out infinite alternate; opacity: .24; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.18); } }
@keyframes drift2 { to { transform: translate(-18vmax, -12vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(12vmax, -16vmax) scale(1.15); } }
@keyframes drift4 { to { transform: translate(20vmax, -8vmax) scale(1.25); } }
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(2,3,8,.72) 100%), repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px); }

/* ---- Glass + 1px travelling iridescent border (green/blue/purple only) ---- */
.glass { position: relative; background: var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-l); isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20), inset 0 -1px 0 rgba(255,255,255,.04), inset 0 0 40px rgba(155,123,255,.05), 0 24px 70px -20px rgba(0,0,0,.65), 0 2px 10px rgba(0,0,0,.25); }
.glass::before, .iri::before, .screen-frame::before, .btn::before, .field-shell::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--angle),
    hsl(calc(160 + var(--hs)) 95% 60%), hsl(calc(185 + var(--hs)) 100% 62%) 17%, hsl(calc(210 + var(--hs)) 100% 66%) 34%,
    hsl(calc(232 + var(--hs)) 100% 72%) 51%, hsl(calc(255 + var(--hs)) 100% 74%) 67%, hsl(calc(272 + var(--hs)) 95% 72%) 82%,
    hsl(calc(160 + var(--hs)) 95% 60%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  pointer-events: none; z-index: 2; animation: iriTravel 8s linear infinite, iriHue 24s ease-in-out infinite alternate;
}
.glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 38%); pointer-events: none; z-index: -1; }
@keyframes iriTravel { from { --angle: 0deg; } to { --angle: 360deg; } }
@keyframes iriHue { from { --hs: -12; } to { --hs: 12; } }
.screen-frame { position: fixed; inset: 0; z-index: 50; pointer-events: none; border-radius: 0; }

/* ---- Layout ---- */
.shell { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 26px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .55em; padding-left: .55em;
  background: var(--iri); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 12s ease-in-out infinite alternate; filter: drop-shadow(0 0 14px rgba(155,123,255,.35)); }
.brand .tag { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); }
@keyframes sheen { to { background-position: 100% 0; } }
.nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; border-radius: 999px; }
.nav a { color: var(--ink-dim); text-decoration: none; font-size: 13px; padding: 7px 14px; border-radius: 999px; transition: background .25s, color .25s; position: relative; z-index: 3; }
.nav a:hover, .nav a.active { color: var(--ink); background: rgba(255,255,255,.08); }
.nav a.active { box-shadow: inset 0 0 0 1px rgba(155,123,255,.35); }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 22px 48px; }
.center { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.panel { padding: 26px; }
.panel.narrow { width: min(460px, 100%); }
.panel.mid { width: min(640px, 100%); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); align-items: start; }
.grid.fields { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
details.track > summary { cursor: pointer; padding: 4px 0; }
details.track[open] > summary { margin-bottom: 10px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: .01em; }
h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); font-size: 13px; }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
hr.sep { border: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(155,123,255,.4), transparent); margin: 18px 0; }

/* ---- Forms ---- */
label.lbl { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 6px; }
.field-shell { position: relative; isolation: isolate; border-radius: var(--radius-s); background: rgba(6,8,20,.42);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06); }
.field-shell::before { opacity: .55; }
.field-shell:focus-within::before { opacity: 1; animation-duration: 3s, 12s; }
input.inp, select.inp, textarea.inp { display: block; width: 100%; border: 0; outline: none; background: transparent; color: var(--ink);
  font: 15px/1.4 var(--font); padding: 12px 14px; border-radius: var(--radius-s); caret-color: var(--cyan); position: relative; z-index: 3; }
textarea.inp { min-height: 90px; resize: vertical; }
select.inp option { background: #12142a; }
input.inp::placeholder, textarea.inp::placeholder { color: var(--ink-faint); }
input.code { font-family: var(--mono); font-size: 22px; letter-spacing: .4em; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-dim); }
.check input { margin-top: 4px; accent-color: var(--violet); }

/* ---- Buttons ---- */
.btn { appearance: none; border: 0; cursor: pointer; color: var(--ink); font: 600 14px var(--font); border-radius: var(--radius-m);
  position: relative; isolation: isolate; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  background: rgba(255,255,255,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 24px rgba(0,0,0,.3); transition: transform .15s, box-shadow .3s, background .3s; }
.btn::before { opacity: .55; }
.btn:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 22px rgba(94,242,255,.22); color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(135deg, rgba(63,242,196,.30), rgba(94,242,255,.28) 40%, rgba(155,123,255,.34)); }
.btn.primary::before { opacity: 1; }
.btn.danger { background: linear-gradient(135deg, rgba(255,122,154,.22), rgba(155,123,255,.2)); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:focus-visible, .inp:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---- Pills, badges ---- */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 12px; color: var(--ink-dim);
  background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pill.warn .dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.pill.bad .dot { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.pill.info .dot { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.pill.bad { color: #ffd0dc; } .pill.warn { color: #ffe9bf; }

/* ---- Protection orb (static-safe iridescent orb inspired by AURA) ---- */
.orb { width: 168px; height: 168px; border-radius: 50%; position: relative; margin: 0 auto;
  background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.55), rgba(255,255,255,0) 32%),
    conic-gradient(from var(--angle), #3ff2c4, #5ef2ff, #6b8cff, #9b7bff, #3ff2c4);
  filter: saturate(1.15); animation: iriTravel 14s linear infinite;
  box-shadow: 0 0 60px rgba(94,242,255,.35), 0 0 120px rgba(155,123,255,.25), inset 0 0 40px rgba(4,5,11,.55); }
.orb::after { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle at 50% 50%, rgba(6,8,20,.82), rgba(6,8,20,.55) 70%, transparent 72%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.orb .orb-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 2; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }
.orb .orb-label strong { display: block; font-size: 34px; letter-spacing: 0; color: var(--ink); font-weight: 600; }
.orb.sm { width: 96px; height: 96px; }

/* ---- Lists / cards ---- */
.card { padding: 18px 20px; border-radius: var(--radius-m); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.07); }
.list > li:first-child { border-top: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 40px; color: var(--ink-dim); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(155,123,255,.4); }
.steps li.done { color: var(--ink); } .steps li.done::before { content: "✓"; background: rgba(63,242,196,.25); box-shadow: inset 0 0 0 1px rgba(63,242,196,.7); }
.steps li.current { color: var(--ink); } .steps li.current::before { box-shadow: inset 0 0 0 1px var(--cyan), 0 0 14px rgba(94,242,255,.45); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.links a { font-size: 13px; padding: 5px 11px; border-radius: 10px; background: rgba(94,242,255,.08); text-decoration: none; box-shadow: inset 0 0 0 1px rgba(94,242,255,.22); }
.links a:hover { background: rgba(94,242,255,.16); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-faint); } .kv dd { margin: 0; }
.task { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.task input[type=checkbox] { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); }
.notice { padding: 14px 16px; border-radius: var(--radius-s); background: rgba(155,123,255,.10); box-shadow: inset 0 0 0 1px rgba(155,123,255,.3); font-size: 13.5px; color: var(--ink-dim); }
.notice.warn { background: rgba(255,210,122,.08); box-shadow: inset 0 0 0 1px rgba(255,210,122,.35); }
.notice.bad { background: rgba(255,122,154,.08); box-shadow: inset 0 0 0 1px rgba(255,122,154,.35); }
.qr { display: block; margin: 8px auto; border-radius: 14px; background: #fff; padding: 8px; width: 220px; height: 220px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: var(--mono); font-size: 14px; }
.codes span { padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.06); text-align: center; }
table.log { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.log th, table.log td { text-align: left; padding: 7px 8px; border-top: 1px solid rgba(255,255,255,.06); }
table.log th { color: var(--ink-faint); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }

/* ---- Toast + modal ---- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 100; padding: 12px 18px; max-width: min(560px, 92vw); font-size: 14px; }
.toast.bad { color: #ffd0dc; }
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(2,3,8,.6); display: grid; place-items: center; padding: 20px; }

@media (max-width: 720px) {
  .topbar { padding: 12px 14px; } main { padding: 6px 12px 40px; } .panel { padding: 20px; }
  .brand h1 { letter-spacing: .4em; }
}
@media (prefers-reduced-motion: reduce) {
  .blob, .glass::before, .iri::before, .screen-frame::before, .btn::before, .field-shell::before, .orb, .brand h1 { animation: none !important; }
}
/* Reduced-transparency mode (SPEC §11 accessibility) */
body.solid .glass { background: #10132a; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.solid .aurora { display: none; }
#view:focus { outline: none; } /* programmatic focus on route change (screen readers); no visual ring */

/* Phase 2: FCRA written-instructions text (scrollable, preserves paragraphs) */
.consent-text{white-space:pre-wrap;max-height:22rem;overflow:auto;line-height:1.5}
fieldset{border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:.8rem 1rem}
legend{padding:0 .4rem;font-weight:600}

/* Phase 3: business protection */
ol.checklist { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
ol.checklist li::marker { color: var(--violet); }

/* Phase 4: remediation suite */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.tabs a { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-dim); text-decoration: none; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.tabs a:hover { background: rgba(94,242,255,.10); }
.tabs a.active { color: var(--ink); background: rgba(155,123,255,.18); box-shadow: inset 0 0 0 1px rgba(155,123,255,.45); }
.overdue { color: #ffd27a; }
.doc { display: grid; gap: 6px; font-size: 14.5px; line-height: 1.55; }
.sent { margin: 0; padding: 4px 8px; border-radius: 8px; }
.sent:hover { background: rgba(255,255,255,.04); }
.sent .src, .src { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; color: var(--ink-faint); background: rgba(94,242,255,.08); box-shadow: inset 0 0 0 1px rgba(94,242,255,.22); vertical-align: middle; }
.sent.k-fact { box-shadow: inset 3px 0 0 rgba(94,242,255,.55); }
.sent.k-user_entered { box-shadow: inset 3px 0 0 rgba(155,123,255,.6); }
.sent.k-user_statement { box-shadow: inset 3px 0 0 rgba(255,210,122,.7); font-style: italic; }
.sent.k-statement_label, .sent.k-label { font-weight: 600; margin-top: 8px; }
.sent.k-warning { font-size: 12.5px; color: #ffd27a; }
.sent.k-missing { background: rgba(255,122,154,.10); box-shadow: inset 3px 0 0 rgba(255,122,154,.7); color: #ffd0dc; }
.sent.k-header, .sent.k-closing { color: var(--ink-dim); }

/* Card Guard town map (Leaflet, vendored) */
.cg-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .cg-layout { grid-template-columns: 1fr; } }
.cg-map { height: 440px; border-radius: var(--radius-s); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(155,123,255,.3); background: #1b1f2e; }
.cg-map .cg-map-msg { padding: 16px; }
.cg-map .leaflet-container, .cg-map.leaflet-container { font: inherit; }
.cg-town-results { max-height: 220px; overflow: auto; }
.cg-town-results .btn { width: 100%; justify-content: flex-start; }

/* Finder: search picker */
.fs-group { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.fs-group legend { color: var(--ink-dim, inherit); margin-bottom: 4px; }
.fs-src { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.fs-src input { margin-top: 4px; }
.fs-primary { padding: 12px; border-radius: var(--radius-s); box-shadow: inset 0 0 0 1px rgba(155,123,255,.35); }
.fs-logo { width: 24px; height: 24px; border-radius: 4px; object-fit: contain; flex: none; }
.fs-inst img.fs-logo, .pill img.fs-logo { width: 18px; height: 18px; margin-right: 4px; vertical-align: middle; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fs-import { padding: 10px 0; }
.fs-review .list { max-height: 420px; overflow: auto; }
