/* ============================================================
   Asset & Income Preservation — page-specific styles
   Builds on top of ../assessment/assessment.css (shared intro/
   question/results shell) and ../assets/site.css (tokens).
   ============================================================ */

#results-title {
  font-family: var(--font-display);
  color: var(--navy-deep);
}

/* ---------- Age question ---------- */
.age-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  max-width: 560px;
}
.age-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 8px;
}
.age-field input[type="number"] {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 14px 16px;
  font: 500 16px var(--font-body);
  color: var(--ink);
  transition: border-color .15s ease;
}
.age-field input[type="number"]:focus {
  outline: 3px solid var(--gold-soft);
  outline-offset: 1px;
  border-color: var(--gold);
}
.field-asterisk {
  color: var(--gold);
  font-weight: 800;
  cursor: help;
}
.field-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Current-income sub-questions ---------- */
.sub-question {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  max-width: 560px;
}
.sub-question[hidden] {
  display: none;
}
.sub-question-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-deep);
  margin: 0 0 10px;
}
.sub-opts {
  gap: 8px;
}
.sub-opts .opt {
  padding: 12px 14px;
}

/* ---------- Asset brackets question ---------- */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px 20px;
  max-width: 720px;
}
.asset-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-deep);
  margin-bottom: 8px;
}
.asset-field select.state-select { width: 100%; }

/* ---------- Starting position card ---------- */
.cost-estimate {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
}

/* ---------- Depletion chart ---------- */
.depletion-chart-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px 24px;
}
.chart-svg svg {
  display: block;
  width: 100%;
  height: auto;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
}
.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.util-tab {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  background: #fff;
  border: 2px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.util-tab:hover {
  background: #f7f7f5;
}
.util-tab.is-active {
  background: #fff;
}

/* ---------- Care type comparison cards ---------- */
.care-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.care-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 22px 20px;
}
.care-card-title {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--navy-deep);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--gold);
}
.care-card .cost-row {
  padding: 8px 0;
  font-size: 13.5px;
}
.care-card-flag {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
  line-height: 1.5;
}
.care-card-flag-ok {
  color: var(--green);
}

/* ---------- Surviving spouse / inheritance impact ---------- */
.load-guidance {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
}
.load-guidance p {
  font-size: 15.5px;
  color: var(--ink);
  line-height: 1.7;
  margin: 0 0 14px;
}
.load-guidance p:last-child { margin-bottom: 0; }
.load-guidance a { color: var(--navy-deep); }

/* ---------- Cost rows (shared pattern) ---------- */
.cost-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 12px;
  padding: 10px 0;
  font-size: 14.5px;
  color: var(--ink);
}
.cost-row-label { flex: 1 1 260px; font-weight: 500; }
.cost-row-value { flex: 0 0 auto; font-weight: 600; color: var(--navy-deep); white-space: nowrap; }
.cost-row + .cost-row { border-top: 1px solid var(--border); }
.cost-row-total {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 2px solid var(--gold) !important;
}
.cost-row-total .cost-row-label { font-weight: 700; color: var(--navy-deep); }
.cost-row-total .cost-row-value { font-size: 19px; font-weight: 800; color: var(--gold); }

.cost-note {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.cost-note a { color: var(--navy-deep); }

@media (max-width: 640px) {
  .cost-estimate,
  .depletion-chart-wrap,
  .care-card,
  .load-guidance { padding: 20px; }
  .cost-row { flex-direction: column; gap: 2px; }
  .cost-row-total .cost-row-value { font-size: 17px; }
  .asset-grid, .age-inputs { grid-template-columns: 1fr; }
}
