/* ==============================================================================
   US Tax Pilot - Schedule E Rental Property & Depreciation Calculator Styles
   Matches Form 8949 and FTC Carryover tool design tokens and layout
   ============================================================================== */

:root {
  --bg: #f6f3ed;
  --paper: #fbfaf7;
  --ink: #17201b;
  --muted: #687069;
  --line: #d9d7cf;
  --accent: #315d50;
  --accent-soft: #e9f0ec;
  --dark: #142019;
  --danger: #fff1ee;
  --warning: #fbf2df;
  --radius: 15px;

  /* Legacy aliases for internal components */
  --blue: #315d50;
  --card: #fbfaf7;
  --required: #fff9f8;
  --required-line: #e3a9a2;
  --good: #23483d;
  --warn: #715319;
  --bad: #87392f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
.site-shell { width: min(1180px, calc(100% - 42px)); margin: auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 10px; top: 10px; background: white; padding: 10px; z-index: 99; }

/* Site Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 237, .96);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-row {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand { display: grid; margin-right: auto; }
.brand-name { font-weight: 850; font-size: 19px; letter-spacing: -.02em; }
.brand-tag { font-size: 10px; color: var(--muted); }
.desktop-nav { display: flex; gap: 27px; font-size: 12px; font-weight: 650; }
.desktop-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.lang-nav { font-size: 11px; font-weight: 800; }

/* Hero Section */
.hero { padding: 62px 0 58px; }
.breadcrumb { display: flex; gap: 9px; font-size: 11px; color: var(--muted); margin-bottom: 52px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, .6fr);
  gap: 72px;
  align-items: end;
}
.eyebrow, .section-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  font-weight: 850;
}
.hero h1 {
  font-size: clamp(48px, 7vw, 82px);
  line-height: .96;
  letter-spacing: -.055em;
  max-width: 870px;
  margin: 16px 0 24px;
}
.hero-copy { font-size: 20px; max-width: 810px; color: #39423c; }
.hero-actions { display: flex; gap: 10px; margin-top: 30px; }
.button, .btn {
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
}
.button.primary, .btn.primary { background: var(--ink); color: white; border-color: var(--ink); }
.button.secondary { background: transparent; color: var(--ink); }
.button.good, .btn.good { background: var(--accent); color: white; border-color: var(--accent); }
.btn.disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.trust-line { font-size: 12px; color: var(--muted); margin-top: 18px; max-width: 780px; }
.hero-proof {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(255, 255, 255, .25);
}
.proof-label { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.proof-row {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.proof-row:last-child { border: 0; }

/* Intent Strip */
.intent-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.intent-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.intent-grid a {
  padding: 20px;
  border-right: 1px solid var(--line);
  min-height: 118px;
  display: grid;
  align-content: start;
}
.intent-grid a:first-child { border-left: 1px solid var(--line); }
.intent-grid span { font-size: 10px; color: var(--accent); font-weight: 800; }
.intent-grid strong { font-size: 14px; margin-top: 12px; }
.intent-grid small { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* Sections */
.tool-section, .content-section { padding: 76px 0; }
.section-head, .two-col-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .45fr);
  gap: 70px;
  align-items: end;
  margin: 10px 0 34px;
}
.section-head h2, .two-col-heading h2, .sources-section h2, .cta-section h2 {
  font-size: clamp(34px, 5vw, 55px);
  line-height: 1.02;
  letter-spacing: -.045em;
  margin: 0;
}
.section-head p, .two-col-heading p { color: var(--muted); margin: 10px 0 0; }
.source-badge {
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 10px;
  color: var(--muted);
}

/* Tool Panel & Form Container */
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  padding: 28px;
  margin-bottom: 24px;
}
.card {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
}

/* Steps Navigation */
.steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.step {
  border: 1px solid var(--line);
  padding: 12px 6px;
  border-radius: 10px;
  background: #f1eee6;
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.step:hover { background: #e8e3d8; color: var(--ink); }
.step.on {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

/* Form Sections */
.section { display: none; }
.section.on { display: block; }
.section h2 {
  font-size: 22px;
  margin: 0 0 16px;
  letter-spacing: -.02em;
}

/* Grids & Inputs */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.property-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.span2 { grid-column: span 2; }
.span4 { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 11px;
  font-weight: 750;
  margin-bottom: 6px;
  color: var(--ink);
}
input, select, textarea {
  font: inherit;
  width: 100%;
  border: 1px solid #cac8c0;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  height: 44px;
  padding: 0 12px;
}
input[type="number"] { font-variant-numeric: tabular-nums; }
textarea { min-height: 100px; padding: 12px; }
.required input, .required select, .required textarea {
  background: #fff;
  border-color: #cac8c0;
}
.required input:focus, .required select:focus, .required textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.star { color: #b42318; margin-left: 3px; }
.help { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* Alerts & Notices */
.notice, .warn, .error, .success, .critical {
  padding: 13px 16px;
  border-radius: 10px;
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.5;
}
.notice { background: #eef4fb; border: 1px solid #c8d7ec; color: #234575; }
.warn { background: var(--warning); border: 1px solid #e8d3a7; color: #715319; }
.error, .critical { background: var(--danger); border: 1px solid #efc9c4; color: #8d3026; }
.success { background: var(--accent-soft); border: 1px solid #bfcfc7; color: #23483d; }

.hidden { display: none !important; }
.dynamic-group { display: none; }
.dynamic-group.on { display: contents; }

/* Choice & Checkbox Grids */
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.choice {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.choice input { width: 18px; height: 18px; margin-right: 10px; }

/* Expense Cards */
.expense-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0; }
.expense-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.expense-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.expense-title b { font-size: 13px; line-height: 1.3; }
.expense-title .line-tag {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--accent);
  white-space: nowrap;
}
.repair-guide {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #e8d3a7;
  background: var(--warning);
  border-radius: 10px;
  font-size: 12px;
  color: #715319;
}
.optional-panel {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 16px 16px;
}
.optional-panel summary {
  padding: 14px 0;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.optional-grid { margin-top: 8px; }
.subcard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfaf7;
  margin-top: 8px;
}

/* Actions */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Metrics & Results */
.metrics, .simple-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.metric {
  background: #f1eee6;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px;
}
.metric span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 800;
  display: block;
}
.metric b {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -.03em;
  margin-top: 6px;
  display: block;
  font-variant-numeric: tabular-nums;
}

/* Transfer Table */
.transfer-card {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px;
  background: #fff;
}
.transfer-card h3 { margin-top: 0; font-size: 16px; letter-spacing: -.01em; }
.transfer-table { width: 100%; border-collapse: collapse; }
.transfer-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.transfer-table td:first-child { font-weight: 800; width: 100px; color: var(--accent); }
.transfer-table td.amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }

.doc-list {
  columns: 2;
  gap: 30px;
  list-style: none;
  padding-left: 0;
  margin: 10px 0;
  font-size: 12px;
}
.doc-list li { margin: 6px 0; break-inside: avoid; color: #39423c; }

/* IRS Form Facsimile Workpaper */
.irs-form-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px 0; }
.irs-form {
  background: #fff;
  color: #111;
  border: 1px solid #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.15;
  min-width: 900px;
  max-width: 1060px;
  margin: 0 auto;
}
.irs-top { display: grid; grid-template-columns: 160px 1fr 155px; border-bottom: 2px solid #111; }
.irs-top > div { padding: 7px; border-right: 1px solid #111; }
.irs-top > div:last-child { border-right: 0; }
.irs-form-name { font-size: 21px; font-weight: 800; line-height: 1; }
.irs-form-sub { font-size: 12px; font-weight: 700; }
.irs-title { text-align: center; font-weight: 800; font-size: 18px; }
.irs-title small { display: block; font-size: 11px; font-weight: 700; margin-top: 3px; }
.irs-year { text-align: center; font-size: 30px; font-weight: 800; }
.irs-taxpayer { display: grid; grid-template-columns: 1fr 220px; border-bottom: 2px solid #111; }
.irs-taxpayer > div { min-height: 35px; padding: 4px 7px; border-right: 1px solid #111; }
.irs-taxpayer > div:last-child { border-right: 0; }
.irs-part { display: flex; border-bottom: 1px solid #111; align-items: stretch; }
.irs-part-label { background: #111; color: #fff; font-weight: 800; font-size: 16px; padding: 4px 10px; white-space: nowrap; }
.irs-part-title { font-size: 17px; font-weight: 800; padding: 3px 10px; }
.irs-question { display: grid; grid-template-columns: 28px 1fr 54px 54px; border-bottom: 1px solid #111; }
.irs-question > div { padding: 4px 6px; }
.irs-question .qno { font-weight: 800; text-align: center; }
.irs-check { text-align: center; font-weight: 700; }
.box { display: inline-block; width: 13px; height: 13px; border: 1px solid #111; margin-right: 3px; vertical-align: -2px; }
.box.checked::after { content: "✓"; font-size: 14px; position: relative; left: 1px; top: -4px; }
.irs-address { display: grid; grid-template-columns: 52px 1fr; border-bottom: 1px solid #111; }
.irs-address > div { padding: 5px 7px; }
.irs-address .rowid { text-align: center; font-weight: 800; border-right: 1px solid #111; }
.irs-property-meta { display: grid; grid-template-columns: 52px 160px 1fr 52px 128px 128px 90px; border-bottom: 1px solid #111; }
.irs-property-meta > div { padding: 5px; border-right: 1px solid #111; }
.irs-property-meta > div:last-child { border-right: 0; }
.irs-property-meta .center { text-align: center; }
.irs-property-meta .strong { font-weight: 800; }
.irs-lines { width: 100%; border-collapse: collapse; }
.irs-lines td, .irs-lines th { border-right: 1px solid #111; border-bottom: 1px solid #111; padding: 3px 5px; }
.irs-lines th { font-weight: 800; text-align: center; }
.irs-lines .ln { width: 42px; text-align: center; font-weight: 800; }
.irs-lines .desc { text-align: left; }
.irs-lines .prop { width: 155px; text-align: right; font-variant-numeric: tabular-nums; }
.irs-lines .blank { background: #fff; }
.irs-lines .gray { background: #cfcfcf; }
.irs-footer { display: flex; justify-content: space-between; padding: 5px 7px; font-size: 10px; font-weight: 700; }

/* Allocation Table */
.allocation-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.allocation-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.allocation-table th, .allocation-table td { border-bottom: 1px solid var(--line); padding: 9px 8px; text-align: left; }
.allocation-table th { font-weight: 800; text-transform: uppercase; font-size: 10px; color: var(--muted); letter-spacing: .05em; }

/* Explain Grid & FAQ (Guides Section) */
.explain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 38px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.explain-grid article {
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 210px;
}
.explain-grid span { font-size: 10px; color: var(--accent); font-weight: 800; }
.explain-grid h3 { margin-top: 18px; font-size: 16px; }
.explain-grid p { color: var(--muted); font-size: 13px; line-height: 1.55; }

.answer-list { margin-top: 30px; border-top: 1px solid var(--line); }
.answer-list article {
  display: grid;
  grid-template-columns: minmax(270px, .75fr) minmax(0, 1.25fr);
  gap: 60px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.answer-list h3 { font-size: 17px; margin: 0; }
.answer-list p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* Sources Section */
.sources-section { padding: 70px 0 82px; border-top: 1px solid var(--line); }
.source-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin-top: 30px;
}
.source-links a {
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.source-links strong { display: block; font-size: 14px; }
.source-links span, .review-date {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

/* CTA Section */
.cta-section { background: #315d50; color: white; padding: 62px 0; }
.cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  gap: 60px;
  align-items: end;
}
.cta-inner p { color: #d5e0db; max-width: 760px; }
.light-button {
  background: white;
  color: var(--ink);
  border-color: white;
  white-space: nowrap;
}

/* Footer */
.site-footer { padding: 48px 0; background: #111813; color: #eef0ed; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 36px;
}
.footer-grid > div { display: grid; align-content: start; gap: 8px; }
.footer-grid strong { font-size: 13px; color: #fff; }
.footer-grid p, .footer-grid a { color: #b9c0bc; font-size: 11px; margin: 0; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.copyright {
  font-size: 10px;
  color: #7b857f;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #232c25;
}

/* Responsive */
@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .hero-grid, .section-head, .two-col-heading { grid-template-columns: 1fr; gap: 28px; }
  .source-badge { justify-self: start; }
  .intent-grid, .explain-grid { grid-template-columns: 1fr 1fr; }
  .metrics, .simple-metrics { grid-template-columns: 1fr 1fr; }
  .source-links { grid-template-columns: 1fr; }
  .cta-inner { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .property-grid { grid-template-columns: 1fr; }
  .grid, .grid3, .expense-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .doc-list { columns: 1; }
}

@media (max-width: 680px) {
  .site-shell { width: min(100% - 26px, 1180px); }
  .site-header { position: static; }
  .brand-tag { display: none; }
  .hero { padding: 38px 0; }
  .breadcrumb { margin-bottom: 25px; }
  .hero h1 { font-size: 44px; }
  .hero-copy { font-size: 17px; }
  .intent-grid, .explain-grid, .metrics, .simple-metrics, .footer-grid { grid-template-columns: 1fr; }
  .intent-grid a { border-left: 1px solid var(--line); }
  .tool-section, .content-section { padding: 56px 0; }
  .tool-panel { padding: 18px 14px; }
  .grid, .grid3, .expense-grid, .choice-grid { grid-template-columns: 1fr; }
  .span2, .span4 { grid-column: auto; }
  .steps { grid-template-columns: 1fr 1fr; }
  .answer-list article { grid-template-columns: 1fr; gap: 6px; }
  .cta-section { padding: 48px 0; }
}

@media print {
  .site-header, .intent-strip, .hero-actions, .steps, .actions, .content-section, .sources-section, .cta-section, .site-footer, #toolFeedbackSection, #privacyTransparency, .no-print {
    display: none !important;
  }
  body { background: #fff; }
  .site-shell { width: 100%; }
  .tool-panel { border: 0; padding: 0; background: #fff; }
}
