/* Brazos Protest — stylesheet */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-dark:   #500000;
  --blue-mid:    #7A1F1F;
  --blue-light:  #F5ECEC;
  --green-dark:  #27500A;
  --green-mid:   #3B6D11;
  --green-light: #EAF3DE;
  --green-border:#C0DD97;
  --amber-light: #FAEEDA;
  --amber-mid:   #854F0B;
  --red-mid:     #A32D2D;
  --gray-bg:     #F8F7F4;
  --gray-border: #D3D1C7;
  --gray-text:   #5F5E5A;
  --text:        #1a1a18;
  --white:       #ffffff;
  --radius:      10px;
  --radius-sm:   6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header { background: var(--blue-dark); position: sticky; top: 0; z-index: 100; }
.header-inner {
  max-width: 760px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 34px; height: 34px; background: var(--blue-mid);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.logo-name { font-size: 15px; font-weight: 600; color: white; }
.logo-sub  { font-size: 11px; color: #C9A0A0; }
.tag { font-size: 11px; padding: 3px 10px; background: #3D0000; color: #C9A0A0; border-radius: 20px; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.main { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }

/* ── Steps ───────────────────────────────────────────────────────────────── */
.steps { display: flex; align-items: center; margin-bottom: 28px; gap: 0; }
.step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aaa; flex: 1; }
.step.active { color: var(--text); font-weight: 600; }
.step.done   { color: var(--gray-text); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #ccc; background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.step.active .step-num { background: var(--blue-mid); border-color: var(--blue-mid); color: white; }
.step-line { flex: 1; height: 1px; background: #ddd; margin: 0 4px; }

/* ── Screens ─────────────────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }
h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.screen-sub { color: var(--gray-text); margin-bottom: 20px; font-size: 14px; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: white; border: 0.5px solid var(--gray-border);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-row { display: flex; gap: 14px; }
.form-row.two-col > * { flex: 1; }
.form-group { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
label { font-size: 13px; font-weight: 500; color: var(--gray-text); }
.required { color: var(--red-mid); }
input[type="text"], input[type="number"] {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--gray-border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: white; outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus {
  border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(122,31,31,0.1);
}
.dollar-input { position: relative; }
.dollar-sign { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--gray-text); font-size: 14px; }
.dollar-input input { padding-left: 22px; }
.form-hint { font-size: 12px; color: #888; margin-bottom: 14px; line-height: 1.5; }
.form-hint a { color: var(--blue-mid); }
.notice-hint { background: var(--blue-light); padding: 8px 10px; border-radius: var(--radius-sm); color: var(--blue-dark); }
.hint-success { background: var(--green-light); padding: 8px 10px; border-radius: var(--radius-sm); color: var(--green-dark); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.btn {
  padding: 9px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-border); background: transparent;
  font-size: 14px; cursor: pointer; color: var(--text); font-family: inherit;
  transition: background 0.15s;
}
.btn:hover { background: var(--gray-bg); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue-mid); border-color: var(--blue-mid); color: white; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.arrow { margin-left: 4px; }

/* ── Loading ─────────────────────────────────────────────────────────────── */
.loading-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--blue-light); font-size: 13px; color: var(--blue-dark);
  margin-top: 12px;
}
.spinner {
  width: 16px; height: 16px; border: 2px solid #D4A0A0;
  border-top-color: var(--blue-mid); border-radius: 50%;
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { height: 5px; background: var(--gray-border); border-radius: 3px; margin: 16px 0; overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue-mid); border-radius: 3px; width: 0%; transition: width 0.5s ease; }
.progress-step { font-size: 13px; color: var(--gray-text); }

/* ── Error ───────────────────────────────────────────────────────────────── */
.error-box {
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: #FCEBEB; border: 0.5px solid #F09595;
  color: var(--red-mid); font-size: 13px; margin-top: 10px;
}
.hidden { display: none !important; }

/* ── Search results ──────────────────────────────────────────────────────── */
.result-item {
  padding: 14px 16px; margin-bottom: 8px;
  border: 1px solid var(--gray-border); border-radius: var(--radius-sm);
  background: white; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.result-item:hover { border-color: var(--blue-mid); background: var(--blue-light); }
.result-item .r-address { font-weight: 600; font-size: 14px; }
.result-item .r-meta { font-size: 12px; color: var(--gray-text); margin-top: 2px; }
.result-item .r-values {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; flex-wrap: wrap;
}
.r-value-label { font-size: 11px; color: var(--gray-text); }
.r-value { font-size: 13px; font-weight: 600; color: var(--blue-mid); }
.r-value.val-unavailable { color: var(--amber-mid); font-style: italic; font-weight: 400; }
.r-value-sep { font-size: 11px; color: #ccc; }

/* ── Property confirm card ───────────────────────────────────────────────── */
.prop-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px; margin-top: 12px;
}
.prop-cell { background: var(--gray-bg); border-radius: var(--radius-sm); padding: 10px 12px; }
.prop-cell-label { font-size: 11px; color: var(--gray-text); margin-bottom: 2px; }
.prop-cell-val { font-size: 15px; font-weight: 600; }
.prop-cell-val.red { color: var(--red-mid); }
.text-muted { color: var(--amber-mid); font-style: italic; font-size: 13px; font-weight: 400; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.badge-green { background: var(--green-light); color: var(--green-mid); }
.badge-amber { background: var(--amber-light); color: var(--amber-mid); }

/* ── Savings banner ──────────────────────────────────────────────────────── */
.savings-banner {
  background: var(--green-light); border: 0.5px solid var(--green-border);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.savings-label { font-size: 12px; color: var(--green-mid); }
.savings-big   { font-size: 28px; font-weight: 700; color: var(--green-dark); }
.savings-right { text-align: right; }
.savings-small-label { font-size: 12px; color: var(--green-mid); }
.savings-small-val   { font-size: 20px; font-weight: 700; color: var(--green-dark); }

/* ── Comp table ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.comp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.comp-table th {
  text-align: left; padding: 7px 8px;
  font-size: 11px; font-weight: 600; color: white;
  background: var(--blue-mid); border-bottom: none;
}
.comp-table td { padding: 8px 8px; border-bottom: 0.5px solid var(--gray-border); vertical-align: middle; }
.comp-table tr.subject-row td { background: var(--blue-light); font-weight: 600; }
.comp-table tr.best-row td    { background: var(--green-light); }
.comp-table .psf-red   { color: var(--red-mid); font-weight: 700; }
.comp-table .psf-green { color: var(--green-mid); font-weight: 700; }
.comp-table .psf-muted { color: #bbb; font-weight: 400; }
.comp-table tr.secondary-comp-row td { color: #aaa; background: #fafaf9; }
.comp-table tr.secondary-comp-row td:first-child { color: #bbb; }
.comp-badge { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #C0DD97; color: var(--green-dark); margin-left: 4px; }
.size-outlier-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  color: #999; background: #f0f0ee; border: 1px solid #ddd;
  border-radius: 3px; padding: 1px 5px; margin-left: 5px;
  vertical-align: middle; letter-spacing: 0.02em;
}
.subj-badge { display: inline-block; font-size: 9px; padding: 1px 5px; border-radius: 3px; background: var(--blue-light); color: var(--blue-mid); margin-right: 6px; font-weight: 700; letter-spacing: 0.03em; }
#marketSalesCard { border-left: 4px solid var(--green-mid); }
.alert { padding: 12px 16px; border-radius: 6px; font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.alert-blue { background: var(--blue-light); border-left: 4px solid var(--blue-mid); color: var(--blue-dark); }
.alert-green { background: var(--green-light); border-left: 4px solid var(--green-mid); color: var(--green-dark); }
.alert-amber { background: #FAEEDA; border-left: 4px solid #EF9F27; color: #854F0B; }
#marketSalesCard .comp-table th { background: var(--green-dark); }
.subj-badge { display: block; font-size: 10px; color: var(--blue-mid); font-weight: 600; }

/* ── Math card ───────────────────────────────────────────────────────────── */
.math-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-bottom: 0.5px solid var(--gray-border); font-size: 14px;
}
.math-row:last-child { border-bottom: none; }
.math-label { color: var(--gray-text); }
.math-val   { font-weight: 600; }
.math-val.green { color: var(--green-dark); }
.math-val.red   { color: var(--red-mid); }
.verdict-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--green-light); border: 0.5px solid var(--green-border);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 12px;
}
.verdict-label { font-size: 13px; color: var(--green-mid); }
.verdict-val   { font-size: 22px; font-weight: 700; color: var(--green-dark); }
.verdict-sub   { font-size: 12px; color: var(--green-mid); }

/* ── Report card ─────────────────────────────────────────────────────────── */
.report-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.report-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.report-desc  { font-size: 13px; color: var(--gray-text); }

/* ── Checklist ───────────────────────────────────────────────────────────── */
.checklist { list-style: none; }
.checklist li {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 0.5px solid var(--gray-border);
  font-size: 14px; align-items: flex-start;
}
.checklist li:last-child { border-bottom: none; }
.check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-light); color: var(--green-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; margin-top: 1px;
}

/* ── Autocomplete dropdown ───────────────────────────────────────────────── */
.suggest-dropdown {
  background: white;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.suggest-item {
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--gray-border);
  transition: background 0.1s;
}
.suggest-item:last-of-type { border-bottom: none; }
.suggest-item:hover,
.suggest-item.focused { background: var(--blue-light); }
.suggest-address {
  font-size: 14px; font-weight: 500; color: var(--text);
}
.suggest-fallback {
  padding: 10px 16px;
  font-size: 12px; color: var(--gray-text);
  background: var(--gray-bg);
  cursor: pointer;
  border-top: 1px solid var(--gray-border);
}
.suggest-fallback:hover { color: var(--blue-mid); }
.suggest-fallback span { color: var(--blue-mid); font-weight: 500; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .main { padding: 20px 14px 60px; }

  /* Step bar — hide labels, keep numbers */
  .steps { gap: 0; overflow: hidden; }
  .step span { display: none; }
  .step-num { width: 24px; height: 24px; font-size: 10px; }
  .step-line { margin: 0 2px; }

  /* Cards */
  .card { padding: 16px 14px; }
  h2 { font-size: 20px; }
  h3 { font-size: 15px; }

  /* Forms */
  .form-row.two-col { flex-direction: column; }

  /* Comp table — horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .comp-table { min-width: 480px; font-size: 12px; }
  .comp-table th, .comp-table td { padding: 6px 6px; }

  /* Prop grid */
  .prop-grid { grid-template-columns: repeat(2, 1fr); }
  .prop-cell-val { font-size: 14px; }

  /* Savings banner */
  .savings-banner { flex-direction: column; gap: 10px; align-items: flex-start; }
  .savings-big { font-size: 26px; }
  .savings-right { text-align: left; }

  /* Buttons — full width on mobile */
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; text-align: center; display: flex; align-items: center; justify-content: center; }

  /* Math card */
  .math-row { font-size: 13px; }
  .verdict-row { flex-direction: column; gap: 8px; }
  .verdict-val { font-size: 20px; }

  /* Alerts */
  .alert { font-size: 12px; padding: 10px 12px; }

  /* Error box */
  .error-box { font-size: 12px; }

  /* Loading screen */
  .progress-step { font-size: 12px; }
  #loadingTitle { font-size: 18px; }
}