/* ═══════════════════════════════════════════════════════════
   HARVEY L. PHELPS · VOLUME II — DOCUMENT TOKENS
   Shared styling for legal, financial, editorial documents
   Extends shared/tokens.css
   ═══════════════════════════════════════════════════════════ */

@import url('tokens.css');

/* Print base */
.doc-body { background: #d8d3c6; padding: 32px 16px; }
.doc-stage-cap {
  max-width: 8.5in; margin: 0 auto 16px;
  font-family: var(--font-body); font-size: 0.68rem;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--hlp-navy); font-weight: 500;
  display: flex; justify-content: space-between;
}

/* The base document sheet — US Letter */
.doc-sheet {
  width: 8.5in; min-height: 11in;
  margin: 0 auto 24px;
  background: white;
  box-shadow: 0 40px 80px -20px rgba(15,24,48,0.35);
  position: relative;
  padding: 0.85in 0.9in 1in;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--hlp-ink);
  page-break-after: always;
}
.doc-sheet::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 6px;
  background: var(--hlp-gold-foil);
  z-index: 5;
}

/* Letterhead — the top of every doc */
.doc-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  padding-bottom: 0.3in;
  border-bottom: 1px solid var(--hlp-rule);
  gap: 0.4in;
  margin-bottom: 0.4in;
}
.doc-head .brand {
  display: flex; align-items: center; gap: 0.18in;
}
.doc-head .brand img { height: 0.7in; }
.doc-head .brand .divider { width: 1px; height: 0.5in; background: var(--hlp-gold); }
.doc-head .brand .lock {
  font-family: var(--font-display); font-weight: 400;
  font-size: 0.22in; line-height: 1;
  color: var(--hlp-navy); letter-spacing: -0.005em;
}
.doc-head .brand .lock small {
  display: block;
  font-family: var(--font-body); font-size: 0.08in;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--hlp-gold-deep); font-weight: 500;
  margin-top: 0.05in;
}
.doc-head .doc-meta {
  text-align: right;
}
.doc-head .doc-meta .type {
  font-family: var(--font-body); font-size: 0.08in;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--hlp-gold-deep); font-weight: 500;
  margin-bottom: 0.06in;
}
.doc-head .doc-meta .id {
  font-family: var(--font-mono); font-size: 0.11in;
  color: var(--hlp-navy); letter-spacing: 0.02em;
}

/* Doc title */
.doc-title {
  margin-bottom: 0.3in;
}
.doc-title h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 0.52in; line-height: 1;
  letter-spacing: -0.02em;
  color: var(--hlp-navy);
  margin: 0 0 0.1in;
  font-variation-settings: 'opsz' 144;
}
.doc-title h1 em {
  font-style: italic; font-weight: 300;
  background: var(--hlp-gold-foil);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.doc-title .subtitle {
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  font-size: 0.17in; color: var(--hlp-graphite);
  line-height: 1.4;
}

/* Section grid */
.doc-section {
  margin-bottom: 0.3in;
}
.doc-section h2 {
  font-family: var(--font-body); font-size: 0.09in;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--hlp-gold-deep); font-weight: 600;
  margin: 0 0 0.14in;
  padding-bottom: 0.08in;
  border-bottom: 1px solid var(--hlp-rule-light);
}
.doc-section p, .doc-section li {
  font-family: var(--font-body); font-size: 0.115in;
  line-height: 1.65;
  color: var(--hlp-ink-soft);
  margin: 0 0 0.1in;
}
.doc-section strong { color: var(--hlp-navy); font-weight: 600; }
.doc-section em { font-family: var(--font-display); font-style: italic; }

/* Two-column meta grid */
.doc-meta-grid {
  display: grid;
  grid-template-columns: 1.4in 1fr;
  gap: 0.06in 0.2in;
  padding: 0.2in;
  background: var(--hlp-ivory-soft);
  border-left: 3px solid var(--hlp-gold);
  margin: 0.3in 0;
}
.doc-meta-grid .k {
  font-family: var(--font-body); font-size: 0.075in;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--hlp-gold-deep); font-weight: 500;
  padding: 0.06in 0;
}
.doc-meta-grid .v {
  font-family: var(--font-display); font-weight: 400;
  font-size: 0.12in; color: var(--hlp-navy);
  padding: 0.06in 0;
}

/* Signature block */
.doc-sig-block {
  margin-top: 0.4in;
  padding-top: 0.3in;
  border-top: 1px solid var(--hlp-rule);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4in;
}
.doc-sig {
  display: flex; flex-direction: column;
  gap: 0.1in;
}
.doc-sig .sig-line {
  height: 0.45in;
  border-bottom: 1px solid var(--hlp-navy);
  position: relative;
}
.doc-sig .sig-line .signed {
  position: absolute;
  bottom: 0.02in; left: 0;
  font-family: var(--font-display); font-style: italic;
  font-size: 0.28in; color: var(--hlp-navy);
  line-height: 0.9;
}
.doc-sig .who {
  font-family: var(--font-display); font-weight: 500;
  font-size: 0.14in; color: var(--hlp-navy);
}
.doc-sig .who small {
  display: block;
  font-family: var(--font-body); font-size: 0.075in;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--hlp-gold-deep);
  font-weight: 500; margin-top: 0.04in;
}
.doc-sig .date-line {
  display: grid; grid-template-columns: 0.6in 1fr;
  gap: 0.1in; align-items: baseline;
}
.doc-sig .date-line .k {
  font-family: var(--font-body); font-size: 0.075in;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--hlp-gold-deep); font-weight: 500;
}
.doc-sig .date-line .line {
  border-bottom: 1px solid var(--hlp-navy);
  min-height: 0.16in;
}

/* Doc footer */
.doc-foot {
  position: absolute;
  bottom: 0.4in; left: 0.9in; right: 0.9in;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0.2in;
  padding-top: 0.15in;
  border-top: 1px solid var(--hlp-rule-light);
  font-family: var(--font-body); font-size: 0.075in;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--hlp-graphite);
}
.doc-foot .c { text-align: center; color: var(--hlp-gold-deep); font-weight: 500; }
.doc-foot .r { text-align: right; }

/* Form field */
.doc-field {
  margin: 0.14in 0;
}
.doc-field .flabel {
  font-family: var(--font-body); font-size: 0.075in;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--hlp-gold-deep); font-weight: 500;
  margin-bottom: 0.06in;
}
.doc-field .fline {
  height: 0.28in;
  border-bottom: 1px solid var(--hlp-navy);
}
.doc-field .fline.tall { height: 0.6in; }
.doc-field .fline.xtall { height: 1in; }
.doc-field .fline.filled {
  padding-bottom: 0.04in;
  font-family: var(--font-display); font-style: italic; font-weight: 300;
  color: var(--hlp-navy); font-size: 0.14in;
  display: flex; align-items: end;
}

/* Row of fields */
.doc-field-row {
  display: grid; gap: 0.2in;
  margin: 0.14in 0;
}
.doc-field-row.two { grid-template-columns: 1fr 1fr; }
.doc-field-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* Checkbox */
.doc-check {
  display: flex; align-items: flex-start; gap: 0.1in;
  padding: 0.06in 0;
}
.doc-check .box {
  width: 0.15in; height: 0.15in;
  border: 1.5px solid var(--hlp-navy);
  flex-shrink: 0;
  margin-top: 0.02in;
}
.doc-check .box.filled {
  background: var(--hlp-navy);
  position: relative;
}
.doc-check .box.filled::after {
  content: '✓';
  position: absolute; inset: 0;
  color: var(--hlp-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.11in; font-weight: 700;
}
.doc-check label {
  font-family: var(--font-body); font-size: 0.11in;
  color: var(--hlp-ink-soft); line-height: 1.4;
}

/* Numbered clause */
.clause {
  display: grid; grid-template-columns: 0.5in 1fr;
  gap: 0.15in;
  margin-bottom: 0.15in;
  padding-bottom: 0.15in;
  border-bottom: 1px solid var(--hlp-rule-light);
}
.clause:last-child { border-bottom: none; }
.clause .n {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 0.2in; color: var(--hlp-gold-deep);
  line-height: 1;
}
.clause .body-t {
  font-family: var(--font-display); font-weight: 500;
  font-size: 0.14in; color: var(--hlp-navy);
  line-height: 1.2;
  margin-bottom: 0.06in;
}
.clause .body-d {
  font-family: var(--font-body); font-size: 0.11in;
  color: var(--hlp-ink-soft); line-height: 1.6;
}
.clause .body-d p { margin: 0 0 0.08in; }

/* Total / amount box */
.amount-box {
  margin: 0.2in 0;
  padding: 0.2in 0.3in;
  background: var(--hlp-midnight);
  color: var(--hlp-ivory);
  display: grid; grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.2in;
  border-left: 4px solid var(--hlp-gold);
}
.amount-box .k {
  font-family: var(--font-body); font-size: 0.08in;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--hlp-gold); font-weight: 500;
}
.amount-box .amt {
  font-family: var(--font-display); font-weight: 300;
  font-size: 0.5in; color: var(--hlp-ivory);
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 144;
}
.amount-box .amt em {
  font-style: italic;
  background: var(--hlp-gold-foil);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.15in 0;
}
.doc-table th {
  font-family: var(--font-body); font-size: 0.075in;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--hlp-gold-deep); font-weight: 600;
  text-align: left;
  padding: 0.08in 0.1in;
  border-bottom: 1.5px solid var(--hlp-navy);
}
.doc-table th:last-child, .doc-table td:last-child { text-align: right; }
.doc-table td {
  font-family: var(--font-body); font-size: 0.1in;
  color: var(--hlp-ink); padding: 0.09in 0.1in;
  border-bottom: 1px solid var(--hlp-rule-light);
  line-height: 1.4;
  vertical-align: top;
}
.doc-table td strong {
  font-family: var(--font-display); font-weight: 500;
  color: var(--hlp-navy);
  font-size: 0.115in;
  display: block; margin-bottom: 0.03in;
}
.doc-table .sub {
  font-family: var(--font-body); font-size: 0.088in;
  color: var(--hlp-graphite);
}
.doc-table tfoot td {
  border-bottom: none; padding-top: 0.1in;
  font-family: var(--font-display); font-weight: 500;
  color: var(--hlp-navy); font-size: 0.12in;
}

/* Watermark */
.doc-watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-family: var(--font-display); font-weight: 300;
  font-size: 4in;
  color: var(--hlp-navy);
  opacity: 0.03;
  pointer-events: none;
  letter-spacing: -0.03em;
  white-space: nowrap;
  z-index: 1;
}

/* All content above watermark */
.doc-sheet > *:not(.doc-watermark):not(::before) {
  position: relative;
  z-index: 2;
}

/* Confidential badge */
.confidential-badge {
  display: inline-block;
  padding: 0.05in 0.14in;
  background: var(--hlp-navy);
  color: var(--hlp-gold);
  font-family: var(--font-body); font-size: 0.07in;
  letter-spacing: 0.3em; text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.14in;
}

@media print {
  body { background: white; padding: 0; }
  .doc-stage-cap { display: none; }
  .doc-sheet {
    box-shadow: none; margin: 0;
    page-break-after: always;
  }
}
