/* The Investing Concierge — client situation form
   Palette is brand only: deep navy ground, sage accent. */

:root {
  --navy:        #031826;
  --navy-lift:   #072232;
  --navy-input:  #0A2A3C;
  --sage:        #9DBF9E;
  --sage-soft:   rgba(157, 191, 158, 0.72);
  --sage-faint:  rgba(157, 191, 158, 0.16);
  --ink:         #E7EFE9;
  --line:        rgba(157, 191, 158, 0.22);
  --alert:       #D9A08E;
  --radius:      10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: 140px;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--sage); color: var(--navy); padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- masthead + progress ---------- */

.masthead {
  position: sticky; top: 0; z-index: 20;
  background: rgba(3, 24, 38, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  max-width: 760px; margin: 0 auto;
  padding: 14px var(--gutter) 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand-logo { height: 44px; width: auto; display: block; }

.saved-indicator {
  font-size: 12px; color: var(--sage-soft); opacity: 0;
  transition: opacity .3s ease; text-align: right; max-width: 55%;
}
.saved-indicator.is-on { opacity: 1; }
.saved-indicator.is-warn { color: var(--alert); opacity: 1; }

.progress { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter) 12px; }
.progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sage-soft); margin-bottom: 6px;
}
.progress-track { height: 3px; background: var(--sage-faint); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--sage); transition: width .35s ease; }

/* ---------- layout ---------- */

.screen { max-width: 760px; margin: 0 auto; padding: 36px var(--gutter) 0; outline: none; }
.step { animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-title {
  font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.2;
  color: var(--sage); margin: 0 0 8px;
}
.lede { color: var(--sage-soft); margin: 0 0 28px; max-width: 58ch; }

.section { margin: 0 0 8px; }
.section-title {
  font-family: var(--serif); font-weight: 400; font-size: 18px; color: var(--sage);
  margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}

/* ---------- fields ---------- */

.field { margin: 0 0 28px; }
.field[hidden] { display: none; }

.field-label {
  display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; font-weight: 500;
}
.optional {
  font-size: 12px; color: var(--sage-soft); font-weight: 400;
  margin-left: 8px; letter-spacing: .03em; text-transform: uppercase;
}
.field-help {
  margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--sage-soft); max-width: 62ch;
}
.field-error { margin: 8px 0 0; font-size: 14px; color: var(--alert); }

.input {
  width: 100%; min-height: 52px; padding: 13px 14px;
  background: var(--navy-input); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 16px; line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: rgba(231, 239, 233, 0.35); }
.input:focus {
  outline: none; border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-faint);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }

.select {
  background-image: linear-gradient(45deg, transparent 50%, var(--sage) 50%),
                    linear-gradient(135deg, var(--sage) 50%, transparent 50%);
  background-position: calc(100% - 20px) 23px, calc(100% - 14px) 23px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}
.select option { background: var(--navy-input); color: var(--ink); }

.has-error .input,
.has-error .combo-input { border-color: var(--alert); }

input[type="date"], input[type="month"] { min-height: 52px; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(72%) sepia(14%) saturate(500%) hue-rotate(70deg); }

/* radio + checkbox */

.radio-group { display: grid; gap: 10px; }
.radio-row, .checkbox-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; min-height: 52px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--navy-lift); cursor: pointer;
}
.radio-row:has(input:checked), .checkbox-row:has(input:checked) {
  border-color: var(--sage); background: rgba(157, 191, 158, 0.08);
}
.radio, .checkbox {
  width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sage); flex: none;
}
.checkbox-row span { line-height: 1.45; }

/* currency + percent */

.money { position: relative; display: flex; align-items: center; }
.money-symbol {
  position: absolute; left: 14px; font-size: 14px; color: var(--sage-soft);
  pointer-events: none; letter-spacing: .02em;
}
.money-input { padding-left: 62px; font-variant-numeric: tabular-nums; }
.money--suffix .money-input { padding-left: 14px; padding-right: 44px; }
.money-symbol--suffix { left: auto; right: 16px; }

.calc-value {
  font-family: var(--serif); font-size: 28px; color: var(--sage);
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(157, 191, 158, 0.06); font-variant-numeric: tabular-nums;
}
.field--calculated .field-label { color: var(--sage-soft); font-size: 14px; }

/* phone */

.phone-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.phone-number { font-variant-numeric: tabular-nums; }

/* combobox */

.combo { position: relative; }
.combo-input { cursor: text; }
.combo-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--navy-lift); border: 1px solid var(--sage-faint);
  border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.combo-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 6px; cursor: pointer; font-size: 15px;
}
.combo-item.is-active, .combo-item:hover { background: rgba(157, 191, 158, 0.14); }
.combo-hint { font-size: 12px; color: var(--sage-soft); }
.combo-empty { padding: 12px; color: var(--sage-soft); font-size: 14px; }

/* ---------- intro ---------- */

.privacy-note {
  border: 1px solid var(--line); border-left: 3px solid var(--sage);
  border-radius: var(--radius); padding: 20px 22px; margin: 0 0 26px;
  background: rgba(157, 191, 158, 0.05);
}
.privacy-note h3 {
  font-family: var(--serif); font-weight: 400; font-size: 18px;
  color: var(--sage); margin: 0 0 10px;
}
.privacy-note ul { margin: 0; padding-left: 20px; color: var(--sage-soft); }
.privacy-note li { margin-bottom: 8px; }
.privacy-note li:last-child { margin-bottom: 0; }

.intro-facts { display: grid; gap: 14px; margin-bottom: 28px; }
.fact {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.fact strong {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: 18px; color: var(--sage); margin-bottom: 2px;
}
.fact span { font-size: 14px; color: var(--sage-soft); }

.resume-card {
  border: 1px solid var(--sage); border-radius: var(--radius);
  padding: 20px 22px; margin: 0 0 22px; background: rgba(157, 191, 158, 0.07);
}
.resume-card p { margin: 0 0 14px; }
.resume-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.intro-restore { margin-bottom: 8px; }

/* ---------- review ---------- */

.review-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 20px 16px; margin-bottom: 18px;
}
.review-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; border-bottom: 1px solid var(--line); padding: 14px 0 12px; margin-bottom: 10px;
}
.review-head h3 {
  font-family: var(--serif); font-weight: 400; font-size: 19px; color: var(--sage); margin: 0;
}
.review-list { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 18px; }
.review-list dt { color: var(--sage-soft); font-size: 14px; padding: 7px 0; }
.review-list dd {
  margin: 0; padding: 7px 0; font-size: 15px;
  overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.review-table { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 14px; }
.review-table th, .review-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.review-table th { color: var(--sage-soft); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- buttons + nav ---------- */

.nav { max-width: 760px; margin: 0 auto; padding: 8px var(--gutter) 40px; }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; }
.nav-aux { margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 26px;
  border-radius: var(--radius); border: 1px solid var(--sage);
  background: transparent; color: var(--sage);
  font-family: inherit; font-size: 16px; cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.btn:hover { background: rgba(157, 191, 158, 0.12); }
.btn:focus-visible { outline: 3px solid var(--sage-faint); outline-offset: 2px; }
.btn--primary { background: var(--sage); color: var(--navy); font-weight: 600; }
.btn--primary:hover { background: #AECFAF; }
.btn--primary:disabled { opacity: .6; cursor: default; }
.btn--quiet { border-color: var(--line); color: var(--sage-soft); }
.btn--ghost { min-height: 44px; padding: 10px 18px; font-size: 15px; }
.btn--large { width: 100%; min-height: 62px; font-size: 17px; margin: 6px 0 20px; text-align: center; }

.link-btn {
  background: none; border: none; padding: 6px 0; cursor: pointer;
  color: var(--sage); font-family: inherit; font-size: 15px;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: #BEDABF; }

.step-error {
  border: 1px solid var(--alert); border-radius: var(--radius);
  padding: 14px 16px; color: var(--alert); font-size: 15px; margin: 0 0 4px;
}

/* ---------- confirmation ---------- */

.done-check {
  border: 1px solid var(--sage); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 20px; background: rgba(157, 191, 158, 0.07);
}
.done-check p { margin: 0; }
.done-file { font-family: var(--serif); font-size: 19px; color: var(--sage); overflow-wrap: anywhere; }

.warn-card {
  border: 1px solid var(--alert); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 22px; background: rgba(217, 160, 142, 0.07);
}
.warn-card h3 {
  font-family: var(--serif); font-weight: 400; font-size: 20px;
  color: var(--alert); margin: 0 0 10px;
}
.warn-card ol { margin: 12px 0 0; padding-left: 22px; }
.warn-card li { margin-bottom: 8px; }

.done-aux { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.done-note { font-size: 14px; color: var(--sage-soft); border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- help footer ---------- */

.help-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: rgba(3, 24, 38, 0.97);
  backdrop-filter: saturate(140%) blur(8px);
  border-top: 1px solid var(--line);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
}
.help-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.help-text { color: var(--sage-soft); font-size: 15px; }

.colophon {
  max-width: 760px; margin: 0 auto; padding: 0 var(--gutter) 24px;
  font-size: 12px; color: rgba(157, 191, 158, 0.45); text-align: center;
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .step-title { font-size: 25px; }
  .review-list { grid-template-columns: 1fr; gap: 0; }
  .review-list dt { padding-bottom: 0; }
  .review-list dd { padding-top: 2px; padding-bottom: 12px; }
  .nav-row { flex-direction: column-reverse; align-items: stretch; }
  .nav-row .btn { width: 100%; }
  .phone-row { grid-template-columns: 1fr; }
  .help-inner { gap: 8px; }
  .help-text { width: 100%; font-size: 14px; }
  body { padding-bottom: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- repeating sections ---------- */

.repeater { margin: 34px 0 8px; }
.repeater[hidden] { display: none; }
.repeater-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.repeater-head .section-title { border: none; margin: 0 0 8px; padding: 0; }
.repeater-count {
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sage-soft); white-space: nowrap;
}
.repeater-error {
  border: 1px solid var(--alert); border-radius: var(--radius);
  padding: 12px 14px; color: var(--alert); font-size: 14px; margin: 0 0 14px;
}
.entry-empty { color: var(--sage-soft); font-size: 14px; margin: 0 0 16px; }

.entry-list { display: grid; gap: 10px; margin-bottom: 16px; }

.entry {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--navy-lift); overflow: hidden;
}
.entry.is-open { border-color: var(--sage); background: rgba(157, 191, 158, 0.05); }

.entry-summary {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 12px 16px;
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.entry-summary:focus-visible { outline: 3px solid var(--sage-faint); outline-offset: -3px; }
.entry-index {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--sage-soft);
  display: grid; place-items: center; font-size: 12px;
}
.entry-text { flex: 1 1 auto; overflow-wrap: anywhere; }
.entry-toggle {
  flex: none; color: var(--sage); font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px;
}

.entry-body { display: none; padding: 4px 16px 18px; border-top: 1px solid var(--line); }
.entry.is-open .entry-body { display: block; }
.entry-body .field { margin-bottom: 22px; }

.entry-calc {
  margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius);
  background: rgba(157, 191, 158, 0.08); color: var(--sage);
  font-family: var(--serif); font-size: 18px; font-variant-numeric: tabular-nums;
}
.entry-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px;
}
.remove-btn { color: var(--alert); }
.remove-btn:hover { color: #E8BCAC; }

.add-btn { width: 100%; }

.totals {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 18px; margin-top: 18px; background: rgba(157, 191, 158, 0.05);
}
.total-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.total-row:last-child { border-bottom: none; }
.total-label { color: var(--sage-soft); }
.total-value {
  color: var(--sage); font-variant-numeric: tabular-nums;
  font-family: var(--serif); font-size: 17px; text-align: right;
}

.review-subhead {
  font-family: var(--serif); font-weight: 400; font-size: 16px;
  color: var(--sage); margin: 18px 0 4px;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 8px; }
.table-scroll .review-table { min-width: 100%; white-space: nowrap; }

.total-row--note .total-value {
  font-family: var(--sans); font-size: 13px; line-height: 1.5;
  color: var(--sage-soft); text-align: left; max-width: 46ch;
}

/* radio options that carry an explanatory line */
.radio-row--noted { align-items: flex-start; padding: 16px; }
.radio-text { display: block; }
.radio-title { display: block; }
.radio-note {
  display: block; margin-top: 4px; font-size: 14px; line-height: 1.5;
  color: var(--sage-soft);
}
