/* Olsen Family Law - Premarital Financial Disclosure Form
   Extracted from n8n "Prepare Static Form" template */

:root {
  --dark-brown: #5C3426;
  --olive: #9A9583;
  --tan: #B29F8D;
  --beige: #E2DCD6;
  --off-white: #F9F8F6;
  --white: #FFFFFF;
  --text: #444444;
  --light-bg: #FAFAF8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--text);
  background: #f0efed;
  line-height: 1.5;
  font-size: 15px;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
}

/* ========== COVER PAGE ========== */
.cover {
  text-align: center;
  padding: 60px 48px 48px;
  border-bottom: 4px solid var(--beige);
}
.cover-bar { height: 6px; background: var(--dark-brown); margin-bottom: 48px; }
.cover-seal { width: 100px; height: 100px; margin-bottom: 32px; }
.cover h1 {
  font-size: 26px; color: var(--dark-brown); letter-spacing: 6px;
  font-weight: 700; margin-bottom: 8px;
}
.cover .subtitle {
  font-size: 16px; color: var(--olive); font-style: italic; margin-bottom: 40px;
  padding-bottom: 24px; border-bottom: 1px solid var(--dark-brown);
}
.cover p { font-size: 14px; color: var(--text); line-height: 1.7; margin-bottom: 12px; text-align: left; }

.instructions-box {
  border-left: 5px solid var(--olive);
  background: var(--off-white);
  padding: 20px 24px;
  margin: 24px 0;
  text-align: left;
}
.instructions-box h3 { color: var(--dark-brown); font-size: 15px; margin-bottom: 10px; }
.instructions-box li {
  font-size: 13.5px; color: var(--text); margin-bottom: 6px; line-height: 1.6;
  list-style: disc; margin-left: 20px;
}

/* ========== MAIN CONTENT ========== */
.content { padding: 0 48px 48px; }

/* Header bar */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--beige); margin-bottom: 32px;
  position: sticky; top: 0; background: var(--white); z-index: 100;
}
.page-header .logo-text { font-size: 11px; color: var(--olive); letter-spacing: 2px; }
.page-header .doc-title { font-size: 12px; color: var(--olive); font-style: italic; }

/* Section titles */
.section-title {
  background: var(--dark-brown);
  color: var(--white);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 40px 0 20px;
}
.section-title:first-of-type { margin-top: 0; }

.section-desc {
  font-size: 13.5px; color: var(--olive); font-style: italic;
  margin-bottom: 16px; line-height: 1.6;
}

/* Sub-headings */
.sub-heading {
  font-size: 16px; color: var(--dark-brown); font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--beige);
  margin: 28px 0 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.sub-desc {
  font-size: 13px; color: var(--olive); font-style: italic;
  margin-bottom: 12px; line-height: 1.5;
}

/* Field rows */
.field-row {
  display: flex; align-items: flex-end; gap: 12px;
  margin-bottom: 10px;
}
.field-row label {
  font-size: 13.5px; color: var(--dark-brown); font-weight: 700;
  white-space: nowrap; min-width: 160px; padding-bottom: 4px; flex-shrink: 0;
}
.field-row input {
  flex: 1; border: none; border-bottom: 2px solid var(--beige);
  padding: 6px 8px; font-family: Georgia, serif; font-size: 14px;
  color: var(--text); background: transparent; outline: none;
  transition: border-color 0.2s;
}
.field-row input:focus { border-bottom-color: var(--dark-brown); }
.field-row input::placeholder { color: var(--tan); font-style: italic; font-size: 13px; }

.dual-field { display: flex; gap: 24px; margin-bottom: 6px; }
.dual-field .field-row { flex: 1; margin-bottom: 0; }
.dual-field .field-row label { min-width: 100px; }

/* Data tables */
.data-table-wrap { margin-bottom: 8px; overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.data-table thead th {
  background: var(--off-white);
  color: var(--dark-brown);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid var(--beige);
  border-bottom: 2px solid var(--dark-brown);
  text-align: left;
  white-space: nowrap;
}
table.data-table thead th.num { text-align: right; }
table.data-table tbody td {
  padding: 0; border: 1px solid var(--beige);
}
table.data-table tbody tr:nth-child(even) td { background: var(--light-bg); }
table.data-table tbody td input {
  width: 100%; border: none; padding: 8px 10px;
  font-family: Georgia, serif; font-size: 13.5px; color: var(--text);
  background: transparent; outline: none;
}
table.data-table tbody td input:focus { background: #fffef5; }
table.data-table tbody td input.num { text-align: right; }
table.data-table tbody td input::placeholder { color: var(--tan); font-style: italic; }

/* Subtotal row */
table.data-table tfoot td {
  padding: 8px 10px; border: 1px solid var(--beige);
  border-top: 2px solid var(--dark-brown);
  background: var(--off-white);
  font-weight: 700; color: var(--dark-brown); font-size: 13px;
}
table.data-table tfoot td.num { text-align: right; }

.add-row-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--beige); color: var(--olive);
  font-family: Georgia, serif; font-size: 12px; padding: 5px 14px;
  cursor: pointer; border-radius: 3px; margin-bottom: 8px;
  transition: all 0.2s;
}
.add-row-btn:hover { border-color: var(--dark-brown); color: var(--dark-brown); }

.continuation-note {
  font-size: 12px; color: var(--olive); font-style: italic; margin-bottom: 20px;
}

/* ========== PROGRESS BAR ========== */
.progress-wrap {
  padding: 0;
}
.progress-bar-track {
  height: 4px; background: var(--beige); width: 100%;
}
.progress-bar-fill {
  height: 100%; background: var(--dark-brown); width: 0%; transition: width 0.4s ease;
}
.progress-text {
  font-size: 11px; color: var(--olive); text-align: center; padding: 4px 0;
  font-family: Georgia, serif; letter-spacing: 0.5px;
}

/* ========== SECTION NAV (inline horizontal) ========== */
.section-nav {
  display: flex; flex-wrap: wrap; gap: 4px 6px; z-index: 200;
  background: var(--white); padding: 10px 48px;
  border-bottom: 1px solid var(--beige);
  justify-content: center;
}
.section-nav a {
  font-size: 12px; color: var(--olive); text-decoration: none;
  padding: 5px 12px; border-radius: 20px; line-height: 1.3;
  transition: all 0.2s; display: inline-block;
  border: 1px solid var(--beige); white-space: nowrap;
  font-family: Georgia, serif;
}
.section-nav a:hover { border-color: var(--dark-brown); color: var(--dark-brown); background: var(--off-white); }
.section-nav a.active { background: var(--dark-brown); color: var(--white); border-color: var(--dark-brown); }

/* ========== HELPER TOOLTIP ========== */
.help-tip {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  background: var(--beige); color: var(--dark-brown); text-align: center;
  font-size: 11px; line-height: 16px; cursor: help; margin-left: 6px;
  position: relative; font-style: normal; font-weight: 700;
  vertical-align: middle;
}
.help-tip:hover::after {
  content: attr(data-tip);
  position: absolute; left: 24px; top: 50%; transform: translateY(-50%);
  background: #333; color: white; font-size: 12px; font-weight: 400;
  padding: 8px 12px; border-radius: 4px; white-space: normal;
  width: 220px; z-index: 999; line-height: 1.4; font-style: normal;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ========== SECTION SKIP / NA ========== */
.skip-sub-btn {
  font-family: Georgia, serif; font-size: 11px; padding: 3px 10px;
  background: none; border: 1px dashed var(--beige); color: var(--olive);
  cursor: pointer; border-radius: 3px; transition: all 0.2s;
  font-weight: 400; white-space: nowrap; flex-shrink: 0;
}
.skip-sub-btn:hover { border-color: var(--olive); color: var(--dark-brown); }
.skip-sub-btn.skipped { background: var(--off-white); color: var(--dark-brown); border-style: solid; }
.sub-body.collapsed { display: none; }
.skipped-badge {
  display: none; padding: 8px 14px; background: var(--off-white);
  border: 1px dashed var(--beige); border-radius: 4px; margin: 4px 0 12px;
  font-size: 12px; color: var(--olive); font-style: italic;
}
.skipped-badge.visible { display: block; }

/* Employment blocks */
.emp-block {
  border: 1px solid var(--beige); border-radius: 6px; padding: 20px 24px;
  margin-bottom: 16px; background: var(--off-white); position: relative;
}
.emp-block .emp-label {
  font-size: 11px; color: var(--olive); letter-spacing: 1px; font-weight: 700;
  margin-bottom: 12px; text-transform: uppercase;
}
.emp-block .remove-emp {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--tan); font-size: 18px;
  cursor: pointer; font-family: Georgia, serif; padding: 0 4px;
  transition: color 0.2s;
}
.emp-block .remove-emp:hover { color: #c0392b; }

/* Expense tables */
table.expense-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 4px;
}
table.expense-table thead th {
  background: var(--off-white); color: var(--dark-brown);
  font-size: 12px; font-weight: 700; padding: 8px 10px;
  border: 1px solid var(--beige); border-bottom: 2px solid var(--dark-brown);
}
table.expense-table thead th:last-child { text-align: right; }
table.expense-table tbody td {
  padding: 0; border: 1px solid var(--beige);
}
table.expense-table tbody tr:nth-child(even) td { background: var(--light-bg); }
table.expense-table tbody td:first-child { padding: 8px 10px; font-size: 13.5px; color: var(--text); }
table.expense-table tbody td:last-child { padding: 0; }
table.expense-table tbody td input {
  width: 100%; border: none; padding: 8px 10px;
  font-family: Georgia, serif; font-size: 13.5px; color: var(--text);
  background: transparent; outline: none; text-align: right;
}
table.expense-table tbody td input:focus { background: #fffef5; }
table.expense-table tbody td input::placeholder { color: var(--tan); font-style: italic; }
table.expense-table tfoot td {
  padding: 8px 10px; border: 1px solid var(--beige);
  border-top: 2px solid var(--dark-brown);
  background: var(--off-white);
  font-weight: 700; color: var(--dark-brown); font-size: 13px;
}
table.expense-table tfoot td:last-child { text-align: right; }

/* Grand total */
.grand-total {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--off-white); border-top: 3px solid var(--dark-brown);
  border-bottom: 3px solid var(--dark-brown);
  padding: 12px 16px; margin: 24px 0;
}
.grand-total .label {
  font-size: 14px; font-weight: 700; color: var(--dark-brown); letter-spacing: 1px;
}
.grand-total .amount {
  font-size: 18px; font-weight: 700; color: var(--dark-brown);
}

/* Checklist */
.checklist-item {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 8px; padding: 6px 0;
}
.checklist-item input[type="checkbox"] {
  margin-top: 3px; width: 16px; height: 16px; accent-color: var(--dark-brown);
  cursor: pointer; flex-shrink: 0;
}
.checklist-item span { font-size: 14px; color: var(--text); line-height: 1.5; }

/* Callout */
.callout {
  border-left: 5px solid var(--olive); background: var(--off-white);
  padding: 14px 18px; margin: 16px 0; font-size: 13.5px; line-height: 1.6;
}
.callout strong { color: var(--dark-brown); }

/* Text area */
.text-area {
  width: 100%; min-height: 120px; border: 1px solid var(--beige);
  padding: 12px 14px; font-family: Georgia, serif; font-size: 14px;
  color: var(--text); resize: vertical; outline: none;
}
.text-area:focus { border-color: var(--dark-brown); }

/* Certification */
.cert-text { font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.sig-block { margin-top: 40px; }
.sig-line {
  display: flex; gap: 24px; margin-bottom: 32px;
}
.sig-field { flex: 1; }
.sig-field .line { border-bottom: 2px solid var(--dark-brown); height: 32px; margin-bottom: 4px; }
.sig-field .label { font-size: 12px; color: var(--olive); }

/* Footer branding */
.brand-footer {
  text-align: center; padding: 32px 0 48px;
  border-top: 2px solid var(--olive); margin-top: 48px;
}
.brand-footer .firm { font-size: 13px; color: var(--olive); letter-spacing: 3px; margin-bottom: 4px; }
.brand-footer .tagline { font-size: 12px; color: var(--tan); font-style: italic; }

/* ========== EXPORT BUTTON ========== */
.export-bar {
  position: sticky; bottom: 0; background: var(--white);
  border-top: 2px solid var(--beige); padding: 14px 48px;
  display: flex; justify-content: flex-end; gap: 12px; z-index: 100;
}
.btn-export {
  background: var(--dark-brown); color: var(--white);
  border: none; padding: 12px 32px; font-family: Georgia, serif;
  font-size: 14px; font-weight: 700; letter-spacing: 1px; cursor: pointer;
  transition: background 0.2s;
}
.btn-export:hover { background: #7a4a38; }
.btn-secondary {
  background: var(--white); color: var(--dark-brown);
  border: 2px solid var(--dark-brown); padding: 10px 24px;
  font-family: Georgia, serif; font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--off-white); }
.btn-submit {
  background: var(--dark-brown); color: var(--white);
  border: none; padding: 14px 40px; font-family: Georgia, serif;
  font-size: 15px; font-weight: 700; letter-spacing: 1px; cursor: pointer;
  transition: background 0.2s;
}
.btn-submit:hover { background: #7a4a38; }
.btn-submit:disabled { background: var(--tan); cursor: not-allowed; }

/* Staff mode indicator */
.staff-badge {
  position: fixed; top: 12px; right: 12px; z-index: 999;
  background: #d4380d; color: white; font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 3px; letter-spacing: 1px;
  font-family: Georgia, serif;
}

/* Confirmation overlay */
.confirm-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(92,52,38,0.92); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.4s ease;
}
.confirm-overlay.visible { opacity: 1; }
.confirm-box {
  background: white; padding: 48px 56px; border-radius: 8px;
  text-align: center; max-width: 520px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.confirm-box .checkmark {
  width: 64px; height: 64px; margin: 0 auto 20px;
  border-radius: 50%; background: var(--dark-brown);
  display: flex; align-items: center; justify-content: center;
}
.confirm-box .checkmark svg { stroke: white; }
.confirm-box h2 { color: var(--dark-brown); font-size: 22px; margin-bottom: 12px; font-family: Georgia, serif; }
.confirm-box p { color: var(--text); font-size: 14px; line-height: 1.7; margin-bottom: 8px; font-family: Georgia, serif; }
.confirm-box .subtext { color: var(--olive); font-size: 13px; font-style: italic; }

/* Submitting spinner */
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Prevent overflow inside nested containers */
.emp-block .dual-field { flex-wrap: wrap; gap: 12px; }
.emp-block .field-row { min-width: 0; }
.emp-block .field-row input { min-width: 0; }

/* ========== PRINT STYLES ========== */
@media print {
  body { background: white; font-size: 11pt; }
  .container { max-width: 100%; box-shadow: none; }
  .cover { page-break-after: always; }
  .page-header { position: static; }
  .export-bar { display: none; }
  .add-row-btn { display: none; }
  .continuation-note { display: none; }
  .section-title { break-after: avoid; }
  .sub-heading { break-after: avoid; }
  table.data-table, table.expense-table { break-inside: avoid; }
  input, textarea { border-color: #ccc !important; }
  .field-row input { border-bottom: 1px solid #ccc !important; }
  .sticky-header, .section-nav, .progress-wrap, .upload-box { display: none !important; }

  @page { margin: 0.75in; }
}
