/* ============================================================
   TierTek — HIPAA-Conscious IT Checklist for DPC Clinics
   Standalone document stylesheet.
   Design tokens lifted verbatim from the live site's css/styles.css
   so the document reads as TierTek, not as a generic compliance PDF.
   Screen + print (US Letter) in one sheet.
   ============================================================ */

:root {
  --cream:      #fcfaf6;
  --cream2:     #f3ead8;
  --navy:       #071f3d;
  --navy2:      #0b2b4f;
  --gold:       #c29036;
  --gold2:      #a86e22;
  --gold-light: #f3dfb7;
  --gold-pale:  #fdf6e8;
  --ink:        #061a34;
  --muted:      #5b6a7e;
  --line:       #ddd0b8;
  --white:      #fff;
  --shadow-sm:  0 2px 8px rgba(7,31,61,.07);
  --shadow:     0 8px 28px rgba(7,31,61,.12);
  --serif:      'Playfair Display', Georgia, serif;
  --sans:       'DM Sans', Arial, Helvetica, sans-serif;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;

  /* status colors — chosen to sit beside gold without fighting it */
  --req:     #8c2f2f;  --req-bg:  #fbf0ee;   /* Required */
  --addr:    #1f6f5c;  --addr-bg: #eef6f3;   /* Addressable */
  --rec:     #43506b;  --rec-bg:  #eef1f6;   /* Recommended, not required */
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.sheet { width: min(880px, calc(100% - 48px)); margin: 0 auto; }
.serif { font-family: var(--serif); }
a { color: var(--gold2); }

/* ---------- eyebrow: the site's gold tick ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold2);
}
.eyebrow::before {
  content: ''; width: 22px; height: 2px; border-radius: 2px;
  background: var(--gold); flex-shrink: 0;
}

/* ---------- cover ---------- */
.cover {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy2) 100%);
  color: #fff; padding: 52px 0 46px; position: relative; overflow: hidden;
  margin-bottom: 8px;
}
.cover::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 25%, rgba(194,144,54,.20), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(194,144,54,.13), transparent 32%);
}
.cover .sheet { position: relative; z-index: 1; }
.cover .eyebrow { color: var(--gold-light); }
.cover .eyebrow::before { background: var(--gold-light); }
.cover h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(29px, 4.3vw, 45px); line-height: 1.14;
  margin: 18px 0 14px; max-width: 20ch;
}
.cover .sub { color: #c9d4e2; font-size: 17px; max-width: 60ch; margin: 0; }
/* the wordmark is dark-on-transparent; knock it to solid white for the navy cover */
.cover-logo { height: 32px; width: auto; filter: brightness(0) invert(1); opacity: .95; }

/* ---------- section ---------- */
.section { padding: 42px 0 6px; }
.section h2 {
  font-family: var(--serif); color: var(--navy);
  font-size: 25px; margin: 13px 0 8px; line-height: 1.27;
}
.section .lede { color: var(--muted); margin: 0 0 22px; max-width: 72ch; }

/* ---------- legend ---------- */
.legend {
  display: grid; gap: 9px;
  padding: 16px 18px; margin: 6px 0 22px;
  background: var(--cream2); border-radius: var(--radius-md);
  font-size: 13.5px; color: var(--muted);
}
/* direct children only — must not flatten the .tag pills nested inside */
.legend > span { display: block; }
.legend .tag { margin-left: 0; margin-right: 6px; }

/* ---------- checklist item ---------- */
.item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  break-inside: avoid;
}
.item::before {                 /* the tickbox */
  content: '';
  width: 21px; height: 21px; margin-top: 3px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  background: var(--gold-pale);
}
.item h3 {
  margin: 0 0 5px; font-size: 15.5px; font-weight: 700;
  color: var(--navy); line-height: 1.42;
}
.item p { margin: 0; color: var(--muted); font-size: 14px; }
.item .why {
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--muted);
}
.item .why b { color: var(--navy); font-weight: 700; }
.item.compact { margin-bottom: 0; }

/* two-up grid for Tier 2 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- tags ---------- */
.tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px; margin-left: 6px;
  vertical-align: 2px; white-space: nowrap;
}
.tag.req  { color: var(--req);   background: var(--req-bg);   border: 1px solid rgba(140,47,47,.22); }
.tag.addr { color: var(--addr);  background: var(--addr-bg);  border: 1px solid rgba(31,111,92,.22); }
.tag.rec  { color: var(--rec);   background: var(--rec-bg);   border: 1px solid rgba(67,80,107,.2); }
.tag.dpc  { color: var(--gold2); background: var(--gold-pale); border: 1px solid rgba(194,144,54,.32); }

/* ---------- callout ---------- */
.callout {
  border-left: 3px solid var(--gold);
  background: var(--gold-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 18px; margin: 20px 0;
  break-inside: avoid;
}
.callout.warn { border-left-color: var(--req); background: var(--req-bg); }
.callout h4 {
  margin: 0 0 7px; font-family: var(--serif);
  font-size: 16.5px; color: var(--navy); line-height: 1.35;
}
.callout p { margin: 0; font-size: 14px; color: var(--muted); }
.callout p + p { margin-top: 9px; }
.callout b { color: var(--navy); }

/* ---------- covered-entity decision flow ---------- */
.flow { display: grid; gap: 10px; margin: 20px 0; }
.flow-q {
  display: grid; grid-template-columns: 34px 1fr; gap: 13px; align-items: start;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 14px 16px;
  font-size: 14px; color: var(--muted);
  break-inside: avoid;
}
.flow-q b { color: var(--navy); }
.flow-n {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: var(--gold-light);
  font-family: var(--serif); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.flow-out {
  margin-top: 4px; padding: 14px 16px;
  border: 1px dashed var(--gold); border-radius: var(--radius-md);
  background: var(--gold-pale); font-size: 14px; color: var(--muted);
}
.flow-out b { color: var(--navy); }

/* ---------- copy-this script block ---------- */
.script {
  margin: 12px 0 0; padding: 14px 16px;
  background: var(--cream2); border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px; color: var(--navy); font-style: italic;
}

/* ---------- BAA table ---------- */
.baa {
  width: 100%; border-collapse: collapse; margin: 6px 0 4px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden;
  font-size: 13.5px;
}
.baa thead th {
  background: var(--navy); color: #fff; text-align: left;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 11px 14px; font-weight: 700;
}
.baa td { padding: 11px 14px; border-top: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.baa td b { color: var(--navy); }
.baa tbody tr:nth-child(even) { background: #fdfcf9; }
.baa td:nth-child(3) { text-align: center; font-size: 17px; color: var(--gold); }
.baa td:nth-child(4) { min-width: 82px; border-bottom: none; }

/* ---------- CTA ---------- */
.cta {
  margin: 44px 0 0;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy2) 100%);
  color: #fff; border-radius: var(--radius-lg);
  padding: 34px 36px; break-inside: avoid; position: relative; overflow: hidden;
}
.cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 88% 20%, rgba(194,144,54,.18), transparent 40%);
}
.cta > * { position: relative; z-index: 1; }
.cta h2 { font-family: var(--serif); color: #fff; font-size: 24px; margin: 12px 0 9px; line-height: 1.3; }
.cta p  { color: #c9d4e2; margin: 0 0 20px; font-size: 15px; max-width: 64ch; }
.cta .eyebrow { color: var(--gold-light); }
.cta .eyebrow::before { background: var(--gold-light); }
.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  padding: 13px 26px; border-radius: 99px; color: #1c1305;
  background: linear-gradient(135deg, #cf9d42, var(--gold) 55%, #b07f28);
  box-shadow: var(--shadow-sm);
}

/* ---------- footer ---------- */
.doc-footer {
  margin: 32px 0 0; padding: 22px 0 44px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.doc-footer .disclaimer {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 15px; margin-bottom: 16px;
  line-height: 1.55;
}
.doc-footer .disclaimer b { color: var(--navy); }

/* ---------- print helper bar (screen only) ---------- */
.printbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); color: #fff;
  padding: 10px 0; font-size: 13px;
}
.printbar .sheet { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.printbar button {
  font-family: var(--sans); font-weight: 700; font-size: 13px; cursor: pointer;
  padding: 8px 18px; border: 0; border-radius: 99px; color: #1c1305;
  background: linear-gradient(135deg, #cf9d42, var(--gold) 55%, #b07f28);
}

/* ============================================================
   GATE PAGE (hipaa-checklist.php) — the public landing page.
   The document itself is served only after the form is submitted.
   ============================================================ */
.gate-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: start;
}
@media (max-width: 860px) { .gate-grid { grid-template-columns: 1fr; gap: 30px; } }

.toc { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 11px; }
.toc li {
  position: relative; padding-left: 26px;
  font-size: 14.5px; color: var(--muted); line-height: 1.55;
}
.toc li b { color: var(--navy); }
.toc li::before {                       /* gold check */
  content: ''; position: absolute; left: 0; top: 6px;
  width: 7px; height: 12px;
  border: solid var(--gold); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* the form card — sticky on desktop so it follows the reader down */
.gate-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 26px 22px;
  box-shadow: var(--shadow); position: sticky; top: 24px;
}
@media (max-width: 860px) { .gate-card { position: static; } }

.gate-card h3 { margin: 0 0 6px; font-size: 21px; color: var(--navy); }
.gate-sub { margin: 0 0 20px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }

.gate-card label {
  display: block; margin: 0 0 5px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--navy);
}
.gate-card label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.gate-card input {
  width: 100%; margin: 0 0 15px;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 11px 13px;
  background: var(--cream);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .18s, box-shadow .18s;
}
.gate-card input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(194,144,54,.16);
  background: var(--white);
}
.gate-card .btn { width: 100%; text-align: center; border: 0; cursor: pointer; margin-top: 4px; }
.gate-fine { margin: 14px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.gate-error {
  background: var(--req-bg); border: 1px solid rgba(140,47,47,.25);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 18px;
}
.gate-error p { margin: 0; font-size: 13px; color: var(--req); line-height: 1.5; }
.gate-error p + p { margin-top: 6px; }

/* honeypot — hidden from humans, still submitted by bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ============================================================
   PRINT — US Letter. This is the PDF path (Print → Save as PDF).
   ============================================================ */
@page { size: Letter; margin: 13mm 12mm; }

@media print {
  body { background: #fff; font-size: 10.2pt; line-height: 1.5; }
  .sheet { width: 100%; }

  /* force brand color through the print pipeline */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  .printbar, .no-print { display: none !important; }
  .page-break { break-before: page; }

  .cover { padding: 28px 0 24px; margin-bottom: 0; }
  .cover h1 { font-size: 26pt; }
  .cover .sub { font-size: 11pt; }

  .section { padding: 18px 0 4px; }
  .section h2 { font-size: 15pt; }
  .section .lede { font-size: 10pt; }

  .item { box-shadow: none; padding: 10px 12px; margin-bottom: 7px; }
  .item h3 { font-size: 10.6pt; }
  .item p, .item .why, .flow-q, .callout p, .baa { font-size: 9.4pt; }
  .callout { margin: 14px 0; padding: 12px 14px; }
  .callout h4 { font-size: 11.5pt; }

  .cta { margin-top: 26px; padding: 24px 26px; }
  .cta h2 { font-size: 15pt; }

  h2, h3, .callout, .item, .flow-q, .cta, .baa tr, .script { break-inside: avoid; }
  a { text-decoration: none; color: inherit; }
}

/* ============================================================
   ROADMAP / GENERAL-GUIDE COMPONENTS
   (added when the stylesheet was promoted from the HIPAA
   checklist to a shared guide sheet)
   ============================================================ */

/* ---------- fillable worksheet table ---------- */
.worksheet {
  width: 100%; border-collapse: collapse; margin: 8px 0 6px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden;
  font-size: 13px;
}
.worksheet thead th {
  background: var(--navy); color: #fff; text-align: left;
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  padding: 10px 12px; font-weight: 700; vertical-align: bottom;
}
.worksheet td {
  padding: 10px 12px; border-top: 1px solid var(--line);
  color: var(--muted); vertical-align: top;
}
.worksheet td b { color: var(--navy); }
.worksheet tbody tr:nth-child(even) { background: #fdfcf9; }
/* an empty cell the reader fills in by hand */
.worksheet td.fill { background: repeating-linear-gradient(
    to bottom, transparent, transparent 21px, var(--line) 21px, var(--line) 22px);
  min-width: 92px; }
.worksheet caption {
  caption-side: bottom; text-align: left; padding: 9px 2px 0;
  font-size: 12px; color: var(--muted); font-style: italic;
}

/* ---------- myth vs fact ---------- */
.myth {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; margin: 20px 0; break-inside: avoid;
}
@media (max-width: 700px) { .myth { grid-template-columns: 1fr; } }
.myth > div { padding: 16px 18px; }
.myth .m-bad  { background: var(--req-bg);  border-right: 1px solid var(--line); }
.myth .m-good { background: var(--addr-bg); }
.myth h5 {
  margin: 0 0 7px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
}
.myth .m-bad h5  { color: var(--req); }
.myth .m-good h5 { color: var(--addr); }
.myth p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.myth b { color: var(--navy); }

/* ---------- lifecycle timeline ---------- */
.timeline { margin: 20px 0; display: grid; gap: 0; }
.tl {
  display: grid; grid-template-columns: 118px 1fr; gap: 16px;
  padding: 13px 0 13px 0; border-top: 1px solid var(--line);
  break-inside: avoid;
}
.timeline .tl:last-child { border-bottom: 1px solid var(--line); }
.tl-when {
  font-family: var(--serif); font-weight: 700; font-size: 14px;
  color: var(--navy); padding-left: 14px; position: relative;
}
.tl-when::before {                 /* the gold dot on the rail */
  content: ''; position: absolute; left: 0; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale);
}
.tl-when small { display: block; font-family: var(--sans); font-weight: 400;
  font-size: 11px; color: var(--muted); letter-spacing: .03em; margin-top: 2px; }
.tl-what { font-size: 13.5px; color: var(--muted); }
.tl-what b { color: var(--navy); }
.tl.past   .tl-when::before { background: var(--req); box-shadow: 0 0 0 3px var(--req-bg); }
.tl.past   .tl-when { color: var(--req); }

/* ---------- big pull-stat ---------- */
.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 20px 0; break-inside: avoid;
}
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 18px 16px; text-align: center;
}
.stat .n {
  display: block; font-family: var(--serif); font-weight: 700;
  font-size: 30px; color: var(--gold2); line-height: 1.1; margin-bottom: 6px;
}
.stat .l { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.stat .src { display: block; margin-top: 7px; font-size: 10px; color: var(--muted); opacity: .8; }

@media print {
  .worksheet, .myth, .tl, .stat-row { break-inside: avoid; }
  .worksheet { font-size: 8.8pt; }
  .worksheet td.fill { min-height: 26px; }
  .stat .n { font-size: 19pt; }
  .myth p, .tl-what { font-size: 9pt; }
}
