/* Homebuyer Qualification App - minimal styling */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px;
}

.topbar {
  background: var(--topbar-bg, #0b1220);
  color: #fff;
  padding: 10px 16px;
}

.topbar .inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { font-weight: 700; letter-spacing: 0.2px; display:flex; align-items:center; gap:10px; }
.brand .logo { height: 28px; width: auto; display:block; }
.brand-link { color:#fff; text-decoration:none; }
.brand-link:hover { text-decoration:none; opacity:0.95; }
.nav a { color: #fff; margin-left: 12px; opacity: 0.9; }
.nav a:hover { opacity: 1; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card + .card { margin-top: 16px; }

.h1 { font-size: 26px; margin: 0 0 6px 0; }
.sub { color: var(--muted); margin: 0 0 16px 0; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}
textarea { min-height: 90px; }

.help { color: var(--muted); font-size: 13px; margin-top: 4px; }

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: var(--primary-hover); }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: #f3f4f6; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { filter: brightness(0.95); }

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: #f9fafb;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { text-align: left; color: var(--muted); font-weight: 700; }

.notice {
  border-left: 4px solid var(--primary);
  background: #eff6ff;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
}

.notice.warn {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.notice.danger {
  border-left-color: var(--danger);
  background: #fef2f2;
}

.small { font-size: 13px; color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}
.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
}
.modal h3 { margin: 0 0 8px 0; }
.modal .btn-row { justify-content: flex-end; }

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  color: #991b1b;
  margin-bottom: 12px;
}

.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #065f46;
  margin-bottom: 12px;
}


/* Forms */
.checkbox { display:flex; gap:10px; align-items:flex-start; font-weight:600; margin: 12px 0; }
.checkbox input { width:auto; margin-top:3px; }
.hidden { display:none; }

/* County/city selectors */
.chips { display:flex; flex-wrap:wrap; gap:8px; border:1px solid var(--border); padding:10px; border-radius:10px; background:#fff; max-height:260px; overflow:auto; }

/* County list: show as full-width rows with the checkbox on the left */
.chips.county-list { display:block; }
.chips.county-list .chip { display:flex; align-items:center; gap:10px; width:100%; border:0; border-bottom:1px solid var(--border); border-radius:0; padding:10px 6px; background:transparent; }
.chips.county-list .chip:last-child { border-bottom:0; }
.chips.county-list .chip input { margin:0; }
.chip { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border:1px solid var(--border); border-radius:999px; cursor:pointer; user-select:none; background:#f9fafb; }
.chip input { width:auto; }
.chip:hover { background:#f3f4f6; }

@media print {
  .topbar, .btn-row, .no-print { display:none !important; }
  body { background:#fff; }
  .card { border:none; box-shadow:none; }
}


/* Admin dashboard charts */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.metric {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.muted {
  color: var(--muted);
}
.barlist .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.barlist .label {
  width: 130px;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barlist .bar {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.barlist .bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  background: #fff;
}
.notice.danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
svg.spark {
  width: 100%;
  height: 110px;
  display: block;
}


/* Footer */
.footer{
  margin-top:30px;
  padding:16px 0;
  background: var(--topbar-bg, #0b1220);
  color:#fff;
  font-size:13px;
}
.footer-inner{
  max-width:980px;
  margin:0 auto;
  padding:0 16px;
}
.footer a{ color:#fff; text-decoration: underline; }
.footer a:hover{ opacity: 0.95; }
/* --- Follow-ups UI enhancements --- */
.table-wrap { overflow-x: auto; }

.btn.tiny {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  margin-left: 6px;
  vertical-align: middle;
}

.pill-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.pill-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.pill-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.pill-muted   { background: #f3f4f6; border-color: #e5e7eb; color: #374151; }

/* Ensure footer isn't hidden behind long content / fixed elements */
.footer { position: relative; z-index: 1; }

/* DownAid Explore V2: contact-gated personalized report */
.gate-card {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: linear-gradient(145deg, #ffffff 0%, #f5f9ff 58%, #fff8ee 100%);
}
.gate-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -100px;
  top: -110px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  pointer-events: none;
}
.gate-progress {
  height: 8px;
  background: #e8eef8;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}
.gate-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #f39e2f);
}
.gate-eyebrow {
  color: #087443;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.gate-title {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 760px;
  margin: 0 0 14px;
}
.gate-lead {
  max-width: 780px;
  font-size: 17px;
  line-height: 1.65;
  color: #475569;
}
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 16px 0;
}
.trust-badges span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid #dbe5f3;
  background: rgba(255,255,255,.82);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.gate-benefits {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dbe5f3;
  background: rgba(255,255,255,.78);
  border-radius: 12px;
}
.gate-benefits h3 { margin: 0 0 12px; }
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}
.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  line-height: 1.45;
}
.benefit-check {
  display: inline-flex;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #e8f8ef;
  color: #087443;
  font-weight: 900;
}
.gate-trust-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid #087443;
  border-radius: 8px;
  background: #f0fbf5;
  color: #285b43;
  font-size: 13px;
  line-height: 1.55;
}
.gate-teaser { font-size: 15px; }
.consent-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fafcff;
}
.captcha-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.captcha-box label { margin-top: 10px; }
.captcha-box input { max-width: 240px; }
.privacy-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.gate-actions { align-items: center; }
.gate-submit {
  min-width: 280px;
  padding: 13px 18px;
  font-size: 15px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 22%, transparent);
}
.gate-submit:disabled { opacity: .75; cursor: wait; }
.results-unlocked-card { border-top: 5px solid var(--primary); }
.result-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.result-facts > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fafcff;
}
.result-facts span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.result-facts strong { display: block; font-size: 15px; line-height: 1.45; }
.completion-card { text-align: center; padding: 30px 24px; }
.completion-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f8ef;
  color: #087443;
  font-size: 34px;
  font-weight: 900;
}
.completion-copy { max-width: 720px; margin: 0 auto 18px; line-height: 1.65; }
.completion-card .btn-row { justify-content: center; }

@media (max-width: 720px) {
  .benefit-grid, .result-facts { grid-template-columns: 1fr; }
  .gate-submit { width: 100%; min-width: 0; }
  .gate-actions .secondary { width: 100%; text-align: center; }
}

/* Explore V2.1 — focused lead assignment workflow */
.assignment-summary {
  margin: 18px 0 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.assignment-context-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  background: #fff;
  min-height: 92px;
}
.assignment-delivery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.assignment-delivery {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 14px;
  background: #fff;
}
.assignment-delivery.is-sent {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.assignment-delivery.is-failed {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
@media (max-width: 720px) {
  .assignment-delivery-grid { grid-template-columns: 1fr; }
}
