/* AIMS Biller Portal — design tokens
   Mirrors the inline tokens from the walkthrough HTML so the hub +
   appendix render in the same visual system as the prototype.
   HIPAA: fonts are NOT linked here; we inherit system stacks for the
   review surface. The walkthrough self-hosts DM Sans/DM Mono via its
   bundled blobs. */

:root {
  /* Surfaces (light) */
  --bg-0: #ffffff;
  --bg-1: #f4f6f8;
  --bg-2: #ffffff;
  --bg-3: #f0f2f5;
  --bg-4: #e2e6ea;

  --border: #e2e6ea;
  --border-strong: #c8d0d9;

  /* Text */
  --fg-1: #0f1923;
  --fg-2: #4a5568;
  --fg-3: #64748b;
  --fg-on-primary: #ffffff;

  /* Brand + status */
  --primary: #0a84ff;
  --primary-dark: #0060cc;
  --primary-8:  rgba(10,132,255,.08);
  --primary-12: rgba(10,132,255,.12);
  --primary-30: rgba(10,132,255,.30);

  --success: #22c55e;
  --success-12: rgba(34,197,94,.12);
  --warning: #f59e0b;
  --warning-12: rgba(245,158,11,.12);
  --error:   #ef4444;
  --error-10: rgba(239,68,68,.10);
  --error-25: rgba(239,68,68,.25);
  --info:    #3b82f6;
  --info-12: rgba(59,130,246,.12);
  --review:  #f97316;
  --review-12: rgba(249,115,22,.12);

  --seal-gold: #d4a017;
  --brand-purple: #863bff;
  --accent: #00c49a;

  /* Typography */
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ts-3xl:  34px;  --tw-3xl: 700;
  --ts-2xl:  28px;  --tw-2xl: 700;
  --ts-xl:   24px;  --tw-xl:  700;
  --ts-lg:   20px;  --tw-lg:  700;
  --ts-md:   17px;  --tw-md:  600;
  --ts-base: 15px;  --tw-base: 400;
  --ts-sm:   13px;  --tw-sm:  400;
  --ts-xs:   11px;  --tw-xs:  400;

  /* Spacing (4pt grid) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 999px;

  /* Elevation */
  --shadow-low:    0 1px 3px rgba(15,25,35,.04);
  --shadow-medium: 0 4px 10px rgba(15,25,35,.08);
  --shadow-high:   0 12px 24px rgba(15,25,35,.14);

  /* Motion */
  --ease-out: cubic-bezier(.22,.72,.36,1);
  --dur-press: 120ms;
  --dur-fade: 200ms;
}

/* Base */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  color: var(--fg-1);
  background: var(--bg-1);
  margin: 0;
  font-size: var(--ts-base);
  line-height: 1.5;
}

h1, .h1 { font-size: var(--ts-2xl); font-weight: var(--tw-2xl); letter-spacing: -.01em; margin: 0; }
h2, .h2 { font-size: var(--ts-xl);  font-weight: var(--tw-xl);  letter-spacing: -.01em; margin: 0; }
h3, .h3 { font-size: var(--ts-md);  font-weight: var(--tw-md);  letter-spacing: -.005em; margin: 0; }
p,  .p  { font-size: var(--ts-base); line-height: 1.5; margin: 0; }
small, .small { font-size: var(--ts-sm); }
.caption { font-size: var(--ts-xs); color: var(--fg-3); }

.label {
  font-size: var(--ts-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-2);
}

code, kbd, samp, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}

.allergy { color: var(--error); font-weight: 700; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}

/* ---------- Field-type badges (used in appendix) ---------- */
.fbadge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}
.fbadge.req       { background: var(--error-10);   color: #b91c1c;       border-color: var(--error-25); }
.fbadge.opt       { background: var(--bg-3);       color: var(--fg-2);   border-color: var(--border); }
.fbadge.calc      { background: var(--info-12);    color: #1d4ed8;       border-color: rgba(59,130,246,.30); }
.fbadge.sys       { background: var(--primary-12); color: var(--primary-dark); border-color: var(--primary-30); }
.fbadge.cond      { background: var(--warning-12); color: #b45309;       border-color: rgba(245,158,11,.30); }
.fbadge.attest    { background: var(--review-12);  color: #c2410c;       border-color: rgba(249,115,22,.30); }

/* Tier pills (open enforcement tickets) */
.tier {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-full);
}
.tier.t1 { background: var(--error-10); color: #b91c1c; }
.tier.t2 { background: var(--warning-12); color: #b45309; }

/* ─── Floating compass FAB + panel (biller) ──────────────────────────
   Three-destination navigator (Hub / Walkthrough / Appendix). Sits at
   bottom-right, ABOVE the Bug Catcher button. Same visual pattern as
   the apaba review site, retoned for the biller's light surface. */
#biller-compass-fab {
  position: fixed;
  right: 24px;
  bottom: 96px; /* clear of Bug Catcher at bottom: 24px (~56px tall) */
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid #2a3340;
  background: #0d0f12;
  color: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px -10px rgba(15,25,35,0.45), 0 2px 6px -2px rgba(15,25,35,0.30);
  z-index: 199;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
#biller-compass-fab:hover {
  transform: translateY(-2px);
  background: #161b22;
  border-color: rgba(10,132,255,0.45);
}
#biller-compass-fab:active { transform: translateY(0); }
body.biller-compass-open #biller-compass-fab {
  background: var(--primary);
  border-color: var(--primary-dark);
}
body.biller-compass-open #biller-compass-fab svg {
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

#biller-compass-panel {
  position: fixed;
  right: 24px;
  bottom: 160px;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  background: #fff;
  color: var(--fg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 14px 12px;
  box-shadow: 0 24px 60px -20px rgba(15,25,35,0.40);
  font-family: var(--font-sans);
  z-index: 198;
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
body.biller-compass-open #biller-compass-panel {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bcp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.bcp-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 700;
}
.bcp-close {
  background: transparent;
  border: 0;
  color: var(--fg-3);
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.bcp-close:hover { background: var(--bg-3); color: var(--fg-1); }

.bcp-jumps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bcp-jumps li { margin: 0; }
.bcp-jumps a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 10px;
  color: var(--fg-1);
  text-decoration: none;
  font-family: var(--font-sans);
  transition: background 0.15s ease;
  min-height: 44px; /* iOS tap target */
}
.bcp-jumps a:hover { background: var(--bg-3); }
.bcp-jumps a.active {
  background: var(--primary-12);
  cursor: default;
}
.bcp-jumps a.active .bcp-jump-label { color: var(--primary-dark); }
.bcp-jump-text { display: flex; flex-direction: column; gap: 2px; }
.bcp-jump-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
}
.bcp-jump-desc {
  font-size: 11.5px;
  color: var(--fg-3);
  line-height: 1.4;
}
.bcp-jump-arrow {
  color: var(--fg-3);
  font-size: 14px;
}
.bcp-jumps a:hover .bcp-jump-arrow { color: var(--primary); }
.bcp-jump-pip {
  color: var(--primary);
  font-size: 8px;
}

@media (max-width: 480px) {
  #biller-compass-fab {
    bottom: 88px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
  #biller-compass-panel {
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    bottom: 148px;
  }
}
