:root {
  --yellow: #ffd400;
  --yellow-dark: #e6bf00;
  --charcoal: #484e53;
  --charcoal-dark: #363b3f;
  --stone: #646366;
  --cool-grey: #989798;
  --bg: #f7f7f5;
  --border: #e0dfdc;
  --text: #2a2d2f;
  --text-muted: #6b6d6f;
  --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}

.page-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,212,0,0.14), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(72,78,83,0.08), transparent 45%),
    var(--bg);
}

/* --- Privacy consent gate --- */
.consent-shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.consent-logo {
  height: 72px;
  margin-bottom: 32px;
}

.consent-card {
  background: white;
  border-radius: 10px;
  padding: 36px 40px;
  box-shadow: 0 8px 24px rgba(72,78,83,0.1);
  border: 1px solid var(--border);
  width: 100%;
}

.consent-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.consent-text h2 {
  margin-top: 0;
}

.consent-text a {
  color: var(--charcoal);
  font-weight: 600;
}

.consent-checkbox {
  margin: 20px 0;
  align-items: flex-start;
}

.consent-checkbox input {
  margin-top: 3px;
  flex: 0 0 auto;
}

/* --- App shell --- */
.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: none;
  background: var(--charcoal);
  padding: 20px 32px;
}

.app-header-logo {
  height: 48px;
  margin-bottom: 16px;
}

.progress-label {
  font-size: 13px;
  color: #cfd2d4;
  margin-bottom: 8px;
}

/* Mobile step nav (fixed 2026-07-20) - the sidebar step list is desktop
   only (see .step-nav's max-width:900px rule below); on mobile, tapping
   the progress label opens the same list as a full-screen overlay, so
   applicants aren't stuck going Back one step at a time to fix something
   earlier. Reset to a plain button since .progress-label is normally a div. */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.mobile-nav-chevron {
  font-size: 16px;
  line-height: 1;
}

.mobile-nav-close {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--charcoal);
  cursor: pointer;
  padding: 0 4px;
}

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--yellow);
  width: 9%;
  transition: width 0.25s ease;
}

.app-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding: 40px 32px;
}

.step-nav {
  flex: 0 0 240px;
  position: sticky;
  top: 40px;
  background: var(--charcoal);
  border-radius: 10px;
  padding: 24px 22px;
  color: white;
  box-shadow: 0 8px 24px rgba(72,78,83,0.2);
}

.step-nav-logo-wrap {
  background: white;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-nav-logo {
  height: 44px;
  width: auto;
  display: block;
}

.step-nav-list {
  list-style: none;
  margin: 0;
  padding-top: 16px;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #b7b9ba;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.step-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.step-nav-dot {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #b7b9ba;
}

.step-nav-item.active {
  color: white;
  background: rgba(255,255,255,0.08);
  font-weight: 600;
}

.step-nav-item.active .step-nav-dot {
  background: var(--yellow);
  color: var(--charcoal-dark);
}

.step-nav-item.completed .step-nav-dot {
  background: rgba(255,212,0,0.45);
  color: white;
}

.step-nav-item.completed {
  color: #d9dadb;
}

.app-main {
  flex: 1;
  min-width: 0;
  background: white;
  padding: 36px 40px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(72,78,83,0.08);
  border: 1px solid rgba(72,78,83,0.08);
}

h1 {
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--charcoal);
}

h2 {
  font-size: 16px;
  margin: 24px 0 8px;
  color: var(--charcoal);
}

.section-spacer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.step-intro {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.field-wide {
  grid-column: 1 / -1;
}

label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  background: white;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--charcoal);
  box-shadow: 0 0 0 3px rgba(72,78,83,0.1);
}

textarea {
  resize: vertical;
}

.toggle-row {
  margin: 20px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.checkbox-row-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 10px 0 20px;
}

.sub-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

/* --- Money fields (text inputs with live comma formatting + $ prefix) --- */
.money-field {
  position: relative;
  display: flex;
  align-items: center;
}

.money-prefix {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.money-input {
  padding-left: 24px !important;
  width: 100%;
}

/* --- Property cards (Step 3) --- */
.property-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 20px;
  background: var(--bg);
  position: relative;
}

.property-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.property-card-header h3 {
  margin: 0;
  font-size: 15px;
  color: var(--charcoal);
}

.property-card .field-grid {
  margin-bottom: 8px;
}

.property-card .field-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
  line-height: 1.4;
}

/* --- Per-applicant document sections --- */
.doc-applicant-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.doc-applicant-group > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  background: var(--bg);
  list-style: none;
}

.doc-applicant-group > summary::-webkit-details-marker {
  display: none;
}

.doc-applicant-group > summary::before {
  content: "▸ ";
  color: var(--charcoal);
}

.doc-applicant-group[open] > summary::before {
  content: "▾ ";
}

.doc-applicant-group-body {
  padding: 18px;
}

.checklist-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  text-decoration: none;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 16px;
}

.checklist-download:hover {
  background: var(--bg);
}

/* --- Signature blocks (Step 10) --- */
.signature-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 24px;
  background: var(--bg);
}

.signature-block h2 {
  margin-top: 0;
}

.repeat-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* Money column widened (2026-07-21, Darren's feedback - the value box was
   "really small", especially once the ownership-share column also squeezes
   the row for a second applicant). minmax() gives it a real floor instead of
   just a larger fr share, since fr alone can still shrink below readable
   width once every column is fighting for space in a narrow row. */
.repeat-row {
  display: grid;
  grid-template-columns: 1.1fr 1.8fr minmax(110px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
}

.repeat-row select,
.repeat-row input {
  margin: 0;
}

.repeat-row.has-ownership {
  grid-template-columns: 1fr 1.6fr minmax(110px, 1.3fr) 1.7fr auto;
}

.ownership-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ownership-label {
  font-size: 12px;
}

.ownership-input {
  width: 48px;
  padding: 4px 6px;
  text-align: right;
}

.ownership-display {
  font-size: 12px;
}

.remove-row-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  padding: 6px;
}

.total-row {
  margin-top: 20px;
  font-size: 15px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.upload-block {
  margin-bottom: 24px;
}

.upload-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.file-input {
  display: block;
  font-size: 13px;
}

.file-list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Pill button groups (Yes/No, Low/Medium/High) --- */
.pill-group {
  display: flex;
  gap: 0;
  margin: 6px 0 16px;
  width: fit-content;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.pill {
  background: white;
  border: none;
  border-right: 1px solid var(--border);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.pill:last-child {
  border-right: none;
}

.pill:hover {
  background: var(--bg);
}

.pill.active {
  background: var(--charcoal);
  color: white;
}

/* --- Signature pad --- */
.signature-pad-wrap {
  display: inline-block;
}

#signaturePad {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  display: block;
  max-width: 100%;
  touch-action: none;
  cursor: crosshair;
}

.signature-pad-wrap .btn-secondary {
  margin-top: 10px;
}

.signature-doc {
  max-height: 260px;
  overflow-y: auto;
}

.signature-doc p {
  margin: 0 0 12px;
}

/* --- Review summary --- */
.review-summary {
  font-size: 14px;
  line-height: 1.7;
}

.review-summary .review-section {
  margin-bottom: 20px;
}

.review-summary h3 {
  font-size: 14px;
  color: var(--charcoal);
  margin: 0 0 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.review-summary .review-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.review-summary .review-line span:first-child {
  color: var(--text-muted);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-primary, .btn-secondary {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--charcoal);
  color: white;
  margin-left: auto;
}

.btn-primary:hover {
  background: var(--charcoal-dark);
}

.btn-primary:disabled {
  background: var(--cool-grey);
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--charcoal);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.field-error {
  border-color: var(--danger) !important;
}

/* Honeypot field on the public "start a fact find" form - present in the
   DOM for bots to find and fill, invisible and unreachable for real
   visitors (off-screen, not display:none, since some bots skip that). */
.start-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}

.start-error {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0 16px;
}

.save-error-banner {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--danger);
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
}

.save-error-banner a {
  color: white;
  text-decoration: underline;
}

.confirmation {
  text-align: center;
  padding: 60px 20px;
}

.confirmation h1 {
  color: var(--charcoal);
}

.confirmation-checklist {
  text-align: left;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.checklist-block h3 {
  margin: 20px 0 6px;
  font-size: 15px;
}

.checklist-block h3:first-child {
  margin-top: 0;
}

.checklist-block ul {
  margin: 0 0 4px;
  padding-left: 20px;
}

.checklist-block li {
  margin-bottom: 6px;
}

/* --- Footer --- */
.app-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px 48px;
}

.footer-resources h2 {
  font-size: 17px;
  margin: 0 0 16px;
}

.ebook-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.ebook-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ebook-card:hover {
  box-shadow: 0 8px 20px rgba(72,78,83,0.12);
  transform: translateY(-2px);
}

.ebook-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
}

.ebook-card span {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
  flex-wrap: wrap;
}

.footer-broker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-broker img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
}

.footer-broker strong {
  display: block;
  font-size: 14px;
}

.footer-broker span {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-legal {
  text-align: right;
}

.footer-icon {
  height: 24px;
  margin-bottom: 8px;
}

.footer-legal-links {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.footer-legal-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  text-decoration: none;
}

.footer-legal-links a:hover {
  text-decoration: underline;
}

.footer-fine-print {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  max-width: 360px;
}

@media (max-width: 900px) {
  .step-nav {
    display: none;
  }
  .step-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    top: 0;
    z-index: 200;
    border-radius: 0;
    overflow-y: auto;
  }
  .mobile-nav-close {
    display: block;
  }
  .mobile-nav-chevron {
    transform: rotate(90deg);
  }
  .app-header {
    display: block;
  }
  .app-body {
    padding: 0;
  }
  .app-main {
    margin: 16px;
    border-radius: 8px;
  }
  .ebook-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-legal {
    text-align: left;
  }
  .footer-legal-links {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
  .app-main {
    margin: 12px;
    padding: 20px;
  }
  .repeat-row,
  .repeat-row.has-ownership {
    grid-template-columns: 1fr;
  }
  .ebook-grid {
    grid-template-columns: 1fr;
  }
  .consent-card {
    padding: 24px;
  }
}
