/* ==========================================================================
   KuduDoc — product portfolio pages
   Shared by identity.html, forms.html, flows.html and vault.html.
   Page-local styles only; shared components live in styles/components.css.
   Portfolio-specific classes are prefixed .pf-.
   ========================================================================== */

/* ---- Section head (page-local copy of the homepage pattern — home.css
   isn't loaded on these pages, so it's redeclared rather than shared) ---- */
.section-head{ max-width: 640px; margin-bottom: var(--space-8); }

/* ==========================================================================
   1. Hero — split gradient (same rhythm as the homepage hero): copy left,
   believable product mock right.
   ========================================================================== */
.pf-hero{ position: relative; overflow: hidden; }
.pf-hero__cta{ margin-top: var(--space-7); display: flex; gap: var(--space-4); flex-wrap: wrap; }
.pf-hero__note{ margin-top: var(--space-5); font-size: var(--text-small); color: rgba(255,255,255,0.8); }
.pf-hero-doc{ max-width: 480px; margin-inline: auto; text-align: left; }

/* ==========================================================================
   2. Mock primitives — the small believable product bits that live inside
   .doc-window and .card mocks across all four pages.
   ========================================================================== */

/* Small-caps label above a mock's content */
.pf-doc-label{
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-tertiary); margin-bottom: var(--space-3);
}

/* Dashed footnote line at the bottom of a mock */
.pf-doc-foot{
  margin-top: var(--space-4); padding-top: var(--space-3);
  border-top: 1px dashed var(--ink-100);
  font-size: var(--text-micro); color: var(--text-tertiary);
}

/* Generic row: icon + name/sub + trailing chip */
.pf-row{ display: flex; align-items: center; gap: var(--space-3); padding-block: var(--space-3); flex-wrap: wrap; }
.pf-row + .pf-row{ border-top: var(--border-hairline); }
.pf-row__icon{
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--blue-50); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
}
.pf-row__icon svg{ width: 17px; height: 17px; }
.pf-row__who{ display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pf-row__name{ font-size: var(--text-small); font-weight: 600; color: var(--ink-900); }
.pf-row__sub{ font-size: var(--text-micro); color: var(--text-tertiary); }
.pf-row > .chip{ margin-left: auto; flex-shrink: 0; }

/* Numbered routing badge (signing order) */
.pf-order{
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--blue-600); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
}
.pf-order--muted{ background: var(--ink-100); color: var(--ink-700); }

/* Indented conditional branch (wraps a .pf-row) */
.pf-branch{ margin-left: 13px; padding-left: var(--space-4); border-left: 2px dashed var(--ink-200); }
.pf-branch .pf-row{ border-top: none; }

/* Status banner strip inside a mock */
.pf-banner{
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--success-50); color: var(--success-700);
  font-size: var(--text-small); font-weight: 700;
  margin-bottom: var(--space-4);
}
.pf-banner svg{ flex-shrink: 0; width: 18px; height: 18px; }
.pf-banner--blue{ background: var(--blue-50); color: var(--blue-700); }
.pf-banner--foot{ margin-bottom: 0; margin-top: var(--space-4); }

/* Key / value line */
.pf-kv{ display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-small); padding-block: var(--space-2); }
.pf-kv + .pf-kv{ border-top: 1px dashed var(--ink-100); }
.pf-kv__k{ color: var(--text-tertiary); }
.pf-kv__v{ font-weight: 600; color: var(--ink-900); text-align: right; }

/* Monospace fingerprint block */
.pf-mono{
  font-family: 'SF Mono', Menlo, ui-monospace, monospace; font-size: 12px;
  color: var(--text-secondary); background: var(--ink-50);
  border-radius: var(--radius-sm); padding: var(--space-3);
  word-break: break-all;
}

/* Progress bar (form steps, bulk sends) */
.pf-progress{
  display: block; height: 6px; border-radius: var(--radius-full); background: var(--ink-100);
  overflow: hidden; margin-bottom: var(--space-5);
}
.pf-progress__fill{ display: block; height: 100%; border-radius: inherit; background: var(--blue-600); }

/* Form-field mock */
.pf-field{ margin-bottom: var(--space-4); }
.pf-field__label{ display: block; font-size: var(--text-micro); font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.pf-field__box{
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1.5px solid var(--ink-200); border-radius: var(--radius-md);
  padding: .6rem .8rem; font-size: var(--text-small); color: var(--ink-900);
  background: var(--white);
}
.pf-field__box--empty{ color: var(--ink-300); border-style: dashed; }
.pf-field--conditional{ margin-left: var(--space-4); padding-left: var(--space-4); border-left: 2px solid var(--blue-200); }
.pf-field__flag{
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--blue-700); margin-bottom: 4px;
}

/* Upload row mock */
.pf-upload{
  display: flex; align-items: center; gap: var(--space-3);
  border: 1.5px dashed var(--ink-200); border-radius: var(--radius-md);
  padding: .6rem .8rem; font-size: var(--text-small); color: var(--text-secondary);
}
.pf-upload + .pf-upload{ margin-top: var(--space-2); }
.pf-upload svg{ flex-shrink: 0; width: 16px; height: 16px; color: var(--blue-600); }
.pf-upload .chip{ margin-left: auto; flex-shrink: 0; }
.pf-upload--done{ border-style: solid; border-color: var(--ink-100); }

/* Search bar mock */
.pf-search{
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--ink-200); border-radius: var(--radius-full);
  padding: .55rem 1rem; font-size: var(--text-small); color: var(--ink-700);
  background: var(--white); margin-bottom: var(--space-4);
}
.pf-search svg{ flex-shrink: 0; width: 16px; height: 16px; color: var(--blue-600); }
.pf-search__q{ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pf-search__key{ color: var(--blue-700); font-weight: 700; }

/* Filter chip row above search results */
.pf-filters{ display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }

/* Highlighted clause snippet (AI "find the clause" result) */
.pf-snippet{
  border-left: 3px solid var(--blue-600); background: var(--blue-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-small); color: var(--ink-700); line-height: 1.6;
}
.pf-snippet mark{ background: var(--orange-100); color: var(--ink-900); border-radius: 3px; padding: 0 2px; }
.pf-snippet__cite{ display: block; margin-top: var(--space-2); font-size: var(--text-micro); font-weight: 600; color: var(--blue-700); }

/* Chat-thread mock (WhatsApp-style delivery, flows.html) */
.pf-chat{ display: flex; flex-direction: column; gap: var(--space-3); }
.pf-chat__bubble{
  max-width: 88%; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md); font-size: var(--text-small); color: var(--ink-900);
  background: var(--ink-50); border: var(--border-hairline);
  border-bottom-left-radius: 4px; align-self: flex-start; line-height: 1.5;
}
.pf-chat__bubble--out{
  background: var(--success-50); border-color: var(--success-50);
  border-bottom-left-radius: var(--radius-md); border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.pf-chat__meta{ display: block; margin-top: 4px; font-size: var(--text-micro); color: var(--text-tertiary); }

/* Audit-trail timeline */
.pf-trail{ position: relative; padding-left: 22px; }
.pf-trail::before{
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: var(--ink-100);
}
.pf-trail__item{
  position: relative; padding-block: var(--space-2);
  font-size: var(--text-small); color: var(--ink-700);
  display: flex; gap: var(--space-3); align-items: baseline; flex-wrap: wrap;
}
.pf-trail__item::before{
  content: ""; position: absolute; left: -19px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600);
}
.pf-trail__item--ok::before{ background: var(--success-500); }
.pf-trail__time{
  font-size: var(--text-micro); font-weight: 700; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 44px;
}

/* ==========================================================================
   3. Copy-side helpers — icon lists, checklists, callouts.
   ========================================================================== */

/* Vertical icon list inside split bodies */
.pf-list{ display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-6); }
.pf-list__item{ display: flex; align-items: flex-start; gap: var(--space-4); }
.pf-list__icon{
  width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--blue-50); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
}
.pf-list__icon svg{ width: 18px; height: 18px; }
.pf-list__body{ min-width: 0; }
.pf-list__label{ display: block; font-size: var(--text-small); font-weight: 600; color: var(--ink-900); }
.pf-list__sub{ display: block; font-size: var(--text-small); color: var(--text-secondary); margin-top: 2px; }

/* Two-column use-case checklist */
.pf-checklist{
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--space-5) var(--space-8);
}
@media (max-width: 700px){ .pf-checklist{ grid-template-columns: minmax(0,1fr); } }
.pf-checklist__item{ display: flex; gap: var(--space-3); align-items: flex-start; }
.pf-checklist__icon{
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; margin-top: 2px;
  background: var(--success-50); color: var(--success-700);
  display: flex; align-items: center; justify-content: center;
}
.pf-checklist__icon svg{ width: 14px; height: 14px; }
.pf-checklist__title{ display: block; font-size: var(--text-body); font-weight: 600; color: var(--ink-900); }
.pf-checklist__desc{ display: block; font-size: var(--text-small); color: var(--text-secondary); margin-top: 2px; }

/* Honesty callout (the "honest caveat" block) */
.pf-callout{
  border-left: 4px solid var(--orange-500); background: var(--orange-50);
  padding: var(--space-5) var(--space-6); border-radius: var(--radius-md);
  margin-top: var(--space-7); font-size: var(--text-small); color: var(--ink-900);
  line-height: 1.6;
}
.pf-callout strong{ font-weight: 700; }

/* Split media sizing */
.pf-split-doc{ max-width: 500px; margin-inline: auto; }

/* Inline text links (FAQ answers, list subs) — base.css strips underline
   and colour from anchors, so in-copy links restate both. */
.faq-item__answer a,
.pf-list__sub a,
.pf-checklist__desc a{
  color: var(--blue-600); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
}
.faq-item__answer a:hover,
.pf-list__sub a:hover,
.pf-checklist__desc a:hover{ color: var(--blue-700); }

/* ==========================================================================
   4. FAQ accordion — exact copy of the product.html pattern (product.css
   isn't loaded on these pages). Bold question, right-aligned chevron,
   hairline dividers, grid-rows expand/collapse driven by .is-open.
   ========================================================================== */
.faq{ max-width: 760px; margin-inline: auto; }
.faq-item{ border-bottom: var(--border-hairline); }
.faq-item:first-child{ border-top: var(--border-hairline); }
.faq__q-heading{ margin: 0; font-size: inherit; font-weight: inherit; }
.faq-item__trigger{
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding-block: var(--space-5); text-align: left;
  font-family: var(--font-sans); font-size: var(--text-body-lg); font-weight: 600; color: var(--ink-900);
}
.faq-item__chevron{ flex-shrink: 0; transition: transform var(--dur-base) var(--ease-out); color: var(--blue-600); }
.faq-item.is-open .faq-item__chevron{ transform: rotate(180deg); }
.faq-item__panel{ display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-base) var(--ease-out); }
.faq-item.is-open .faq-item__panel{ grid-template-rows: 1fr; }
.faq-item__panel-inner{ overflow: hidden; min-height: 0; }
.faq-item__answer{ padding-bottom: var(--space-5); max-width: 640px; color: var(--text-secondary); }
.faq-item__answer p + p{ margin-top: var(--space-4); }

/* ==========================================================================
   5. Small screens
   ========================================================================== */
@media (max-width: 560px){
  .pf-row{ align-items: flex-start; }
  .pf-trail__time{ min-width: 0; }
  .pf-search__q{ white-space: normal; }
}

/* Anchor offset so #scan-seal doesn't land under the sticky nav */
#scan-seal{ scroll-margin-top: calc(var(--nav-height) + var(--space-5)); }
