/* ============================================================
   818 Capital Partners — Fillable Forms layer
   Builds on colors_and_type.css. Adds fillable input primitives.
   ============================================================ */

@import url('colors_and_type.css');

/* Print-safe page sizing */
@page { size: Letter; margin: 0.5in; }

html, body {
  background: #E9ECEF;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg-primary);
}

.page {
  width: 8.5in;
  min-height: 11in;
  margin: 24px auto;
  background: #fff;
  padding: 0.5in 0.55in 0.5in;
  box-sizing: border-box;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  position: relative;
  display: flex;
  flex-direction: column;
}

@media print {
  html, body { background: #fff !important; margin: 0; }
  .page {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0.5in 0.55in 0.5in;
    page-break-after: always;
  }
  .page:last-child { page-break-after: auto; }
  .noprint { display: none !important; }
}

/* ============================================================
   LETTERHEAD — full (page 1)
   ============================================================ */
.lh {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  column-gap: 18px;
  align-items: stretch;
  padding-bottom: 0;
}
.lh__mark {
  width: 60px; height: 60px;
  background: var(--color-navy);
  display: flex; align-items: center; justify-content: center;
}
.lh__mark img { width: 50px; height: 50px; object-fit: contain; }
.lh__word {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 2px 0 4px;
  border-bottom: 2px solid var(--color-accent-blue);
}
.lh__brand {
  font-size: 18px; font-weight: 700; color: var(--color-navy);
  letter-spacing: -0.015em; line-height: 1;
}
.lh__tag {
  font-size: 8px; letter-spacing: 0.3em; color: var(--color-navy);
  font-weight: 700; margin-top: 5px;
}
.lh__addr {
  font-size: 9px; color: var(--fg-secondary);
  letter-spacing: 0.02em; line-height: 1.5; padding-bottom: 4px;
}
.lh__contact {
  border-left: 1px solid var(--border-default);
  padding: 2px 0 4px 16px; font-size: 9px; line-height: 1.55;
  color: var(--fg-primary);
  display: flex; flex-direction: column; justify-content: space-between;
  border-bottom: 2px solid var(--color-accent-blue);
  min-width: 165px;
}
.lh__lbl {
  font-size: 7.5px; letter-spacing: 0.22em; color: var(--color-accent-blue);
  font-weight: 700; text-transform: uppercase; margin-bottom: 2px;
}
.lh__name { font-weight: 700; color: var(--color-navy); font-size: 10px; }

/* Document meta strip (after letterhead) */
.docmeta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; margin-bottom: 4px;
}
.doctag {
  display: inline-block; background: var(--color-navy); color: #fff;
  font-size: 9px; letter-spacing: 0.22em; font-weight: 700;
  padding: 4px 10px; text-transform: uppercase;
}
.docref {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.05em;
  color: var(--fg-secondary); font-weight: 500;
  text-transform: uppercase;
}

.doc-title {
  font-size: 24px;
  color: var(--color-navy);
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 12px 0 2px;
}
.doc-sub {
  font-size: 11px;
  color: var(--fg-secondary);
  margin-bottom: 10px;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.sec {
  margin-top: 18px;
  display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px solid var(--color-accent-blue);
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.sec__num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--color-gold);
  font-weight: 700;
}
.sec__title {
  font-size: 13px;
  color: var(--color-navy);
  font-weight: 700;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sec__hint {
  font-size: 9px;
  color: var(--fg-secondary);
  margin-left: auto;
  font-style: italic;
}

/* ============================================================
   FILLABLE FIELDS
   Input element is the source of truth. Border-bottom shows the
   blank line. Label sits above in tracked uppercase.
   ============================================================ */

.fld {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  min-width: 0;
}
.fld > label, .fld__lbl {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  font-weight: 700;
  white-space: nowrap;
}

input[type="text"], input[type="date"], input[type="number"],
input[type="email"], input[type="tel"], textarea {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--color-navy);
  font-weight: 600;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #B5BEC9;
  padding: 3px 2px 2px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  font-variant-numeric: tabular-nums;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus,
input[type="email"]:focus, input[type="tel"]:focus, textarea:focus {
  border-bottom-color: var(--color-accent-blue);
  background: #F5F8FB;
}

textarea {
  resize: vertical;
  min-height: 2.5em;
  line-height: 1.5;
}

input.numeric { text-align: right; font-variant-numeric: tabular-nums; }
input.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

/* Checkbox */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border: 1px solid var(--color-navy);
  border-radius: 0;
  background: #fff;
  margin: 0 5px 0 0;
  vertical-align: -1px;
  display: inline-block;
  position: relative;
  cursor: pointer;
}
input[type="checkbox"]:checked {
  background: var(--color-navy);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 2px; top: -1px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.cbox {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--fg-primary);
  margin-right: 14px;
  cursor: pointer;
}

/* Field grid */
.fgrid {
  display: grid;
  gap: 12px 18px;
}
.fgrid.cols-2 { grid-template-columns: 1fr 1fr; }
.fgrid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.fgrid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.fgrid.cols-1-1-2 { grid-template-columns: 1fr 1fr 2fr; }
.fgrid.cols-2-1 { grid-template-columns: 2fr 1fr; }
.fgrid .span-2 { grid-column: span 2; }
.fgrid .span-3 { grid-column: span 3; }
.fgrid .span-4 { grid-column: span 4; }

/* ============================================================
   FILLABLE TABLES (assets/liabilities, REO rows, etc)
   ============================================================ */
table.fill {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
table.fill thead th {
  background: var(--color-navy);
  color: #fff;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: left;
  padding: 7px 8px;
  border-right: 1px solid rgba(255,255,255,0.12);
  vertical-align: middle;
}
table.fill thead th:last-child { border-right: 0; }
table.fill thead th.num { text-align: right; }
table.fill td {
  padding: 0;
  border: 1px solid var(--border-default);
  vertical-align: top;
  background: #fff;
}
table.fill td.label-cell {
  background: var(--color-wash);
  font-size: 10px;
  color: var(--color-navy);
  font-weight: 600;
  padding: 6px 8px;
  width: 38%;
}
table.fill td.label-cell.indent { padding-left: 18px; font-weight: 400; color: var(--fg-primary); font-size: 9.5px; }
table.fill td input {
  border: 0;
  background: transparent;
  padding: 7px 8px;
  font-size: 11px;
  color: var(--color-navy);
  font-weight: 600;
  width: 100%;
  height: 100%;
  display: block;
  font-variant-numeric: tabular-nums;
  border-radius: 0;
}
table.fill td input.numeric { text-align: right; }
table.fill tr.total td { background: var(--color-wash); border-top: 2px solid var(--color-navy); }
table.fill tr.total td.label-cell { background: var(--color-wash); font-weight: 700; color: var(--color-navy); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; }
table.fill tr.total td input { font-weight: 700; color: var(--color-navy); }
table.fill tr.netw td { background: var(--color-gold-100); border-top: 2px solid var(--color-gold); }
table.fill tr.netw td.label-cell { background: var(--color-gold-100); color: var(--color-navy); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; }
table.fill tr.netw td input { color: var(--color-navy); font-weight: 700; }

/* Two-column assets/liabilities side-by-side */
.bs-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Wide fillable schedule (REO, etc) */
table.sched {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}
table.sched thead th {
  background: var(--color-navy);
  color: #fff;
  font-size: 7.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: left;
  padding: 6px 5px;
  border-right: 1px solid rgba(255,255,255,0.12);
  vertical-align: middle;
}
table.sched thead th:last-child { border-right: 0; }
table.sched thead th.num { text-align: right; }
table.sched td {
  padding: 0;
  border: 1px solid var(--border-default);
  background: #fff;
  vertical-align: middle;
}
table.sched td input {
  border: 0;
  background: transparent;
  padding: 5px 5px;
  font-size: 9.5px;
  color: var(--color-navy);
  font-weight: 500;
  width: 100%;
  display: block;
  font-variant-numeric: tabular-nums;
  border-radius: 0;
}
table.sched td input.numeric { text-align: right; }
table.sched td.idx {
  background: var(--color-wash);
  text-align: center;
  font-size: 9px;
  color: var(--fg-secondary);
  font-weight: 700;
  padding: 5px 0;
  width: 22px;
}
table.sched tr.subtotal td {
  background: var(--color-wash);
  border-top: 2px solid var(--color-navy);
  font-weight: 700;
  color: var(--color-navy);
  padding: 5px;
  font-size: 9.5px;
}
table.sched tr.subtotal td input {
  color: var(--color-navy);
  font-weight: 700;
}

/* ============================================================
   CALLOUT, RADIO/CHECKBOX BLOCK
   ============================================================ */
.callout-form {
  background: var(--bg-callout);
  border-left: 3px solid var(--color-accent-blue);
  padding: 10px 14px;
  font-size: 10.5px;
  color: var(--fg-primary);
  line-height: 1.55;
  margin: 8px 0;
}
.callout-form b { color: var(--color-navy); }
.callout-form .hd {
  font-size: 9px;
  color: var(--color-navy);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.callout-form.gold {
  background: var(--color-gold-100);
  border-left-color: var(--color-gold);
}

/* Yes/No row */
.yn-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  font-size: 10.5px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-default);
  align-items: start;
}
.yn-row:last-child { border-bottom: 0; }
.yn-row .q { color: var(--fg-primary); line-height: 1.5; }
.yn-row .yn { display: flex; gap: 12px; white-space: nowrap; }

/* ============================================================
   SIGNATURE BLOCK
   ============================================================ */
.sigwrap {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border-default);
}
.sigblock {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  margin-top: 14px;
}
.sigline {
  display: flex;
  flex-direction: column;
}
.sigline input {
  border-bottom: 1px solid var(--color-charcoal);
  font-family: 'Caveat', 'Brush Script MT', cursive;
  font-size: 17px;
  font-weight: 400;
  color: var(--color-navy);
  padding-bottom: 2px;
  padding-top: 12px;
}
.sigline.printed input {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}
.sigline.dateline input {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}
.sigline__lbl {
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  font-weight: 700;
  margin-top: 3px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.pfoot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--fg-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pfoot b {
  color: var(--color-navy);
  letter-spacing: 0;
  font-weight: 700;
  text-transform: none;
}

/* ============================================================
   PRINT BUTTON (screen only)
   ============================================================ */
.printbar {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 100;
  display: flex;
  gap: 8px;
}
.printbar button, .printbar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-navy);
  color: #fff;
  border: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.printbar button:hover, .printbar a:hover { background: var(--color-navy-900); }
.printbar a.ghost {
  background: #fff;
  color: var(--color-navy);
  border: 1px solid var(--color-navy);
}

/* Small text utility */
.fineprint {
  font-size: 8.5px;
  line-height: 1.55;
  color: var(--fg-secondary);
  margin-top: 8px;
}
.fineprint b { color: var(--color-navy); font-weight: 700; }

/* Inline note */
.note {
  font-size: 9px;
  color: var(--fg-secondary);
  font-style: italic;
  margin-top: 4px;
}

/* Stat strip variant tighter for forms */
.stat-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border-default);
  border-top: 3px solid var(--color-gold);
  margin-top: 10px;
}
.stat-mini > .cell {
  padding: 10px 12px;
  border-right: 1px solid var(--border-default);
}
.stat-mini > .cell:last-child { border-right: 0; }
.stat-mini .k {
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--fg-secondary);
  font-weight: 700;
  text-transform: uppercase;
}
.stat-mini .v {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-navy);
  margin-top: 3px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
