/* ============================================================
   HomeTax Survey Modal v3
   survey-modal.css

   Included by both:
     - onboarding.js (post-signup case signals)
     - portal/property.html (property survey)

   Uses HomeTax brand CSS variables already defined in portal.css.
   Safe to include even if portal.css isn't loaded -- all variables
   have hard-coded fallbacks.
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.ht-survey-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(7, 34, 63, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 20px 16px 40px;
  align-items: flex-start;
  justify-content: center;
}
.ht-survey-overlay.ht-open {
  display: flex;
}

/* ── Modal box ───────────────────────────────────────────── */
.ht-survey-box {
  width: 100%;
  max-width: 580px;
  background: #fff;
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
  margin: auto;
  animation: htSurveySlideUp 0.22s ease;
}
@keyframes htSurveySlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ──────────────────────────────────────────────── */
.ht-survey-head {
  background: var(--navy-900, #07223f);
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ht-survey-head-text {}
.ht-survey-title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.ht-survey-subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  margin-top: 3px;
}
.ht-survey-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.ht-survey-close:hover { background: rgba(255,255,255,0.22); }

/* ── Property navigator (case signals multi-property) ─────── */
.ht-prop-nav {
  background: var(--gray-50, #f7fafc);
  border-bottom: 1px solid var(--gray-100, #edf2f7);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.ht-prop-nav .ht-prop-label {
  font-weight: 600;
  color: var(--navy-900, #07223f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.ht-prop-nav .ht-prop-count {
  color: var(--gray-400, #a0aec0);
  font-size: 12px;
  white-space: nowrap;
  margin-left: 12px;
}

/* ── Step progress bar ────────────────────────────────────── */
.ht-survey-progress {
  padding: 12px 22px 8px;
  background: var(--gray-50, #f7fafc);
  border-bottom: 1px solid var(--gray-100, #edf2f7);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ht-step-pip {
  height: 4px;
  border-radius: 2px;
  background: var(--gray-200, #e2e8f0);
  flex: 1;
  transition: all 0.25s;
}
.ht-step-pip.ht-done  { background: var(--green-400, #48bb78); }
.ht-step-pip.ht-active { background: var(--navy-700, #1b2a4a); flex: 1.6; }
.ht-step-count {
  font-size: 11px;
  color: var(--gray-400, #a0aec0);
  font-weight: 600;
  white-space: nowrap;
  margin-left: 8px;
}

/* ── Body ────────────────────────────────────────────────── */
.ht-survey-body {
  padding: 24px 22px 20px;
  min-height: 280px;
  max-height: 65vh;
  overflow-y: auto;
}
.ht-step { display: none; }
.ht-step.ht-step-active { display: block; }

.ht-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-900, #07223f);
  margin-bottom: 4px;
  line-height: 1.35;
}
.ht-step-hint {
  font-size: 13px;
  color: var(--gray-600, #718096);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── MLS detected banner ─────────────────────────────────── */
.ht-mls-banner {
  background: var(--blue-50, #ebf8ff);
  border: 1px solid #bee3f8;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ht-mls-banner .ht-mls-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.ht-mls-banner .ht-mls-title { font-weight: 600; color: #2b6cb0; font-size: 14px; }
.ht-mls-banner .ht-mls-body  { font-size: 13px; color: #2c5282; margin-top: 2px; }

/* ── Question blocks ─────────────────────────────────────── */
.ht-q { margin-bottom: 18px; }
.ht-q:last-child { margin-bottom: 0; }

.ht-q-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-700, #4a5568);
  margin-bottom: 8px;
  line-height: 1.4;
}
.ht-q-label strong { color: var(--navy-900, #07223f); }
.ht-q-hint {
  font-size: 0.78rem;
  color: var(--gray-400, #a0aec0);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* ── Radio chips ─────────────────────────────────────────── */
.ht-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ht-radio-group.ht-vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.ht-radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--gray-200, #e2e8f0);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--gray-700, #4a5568);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.13s, background 0.13s, color 0.13s;
  white-space: nowrap;
}
.ht-radio-chip:hover {
  border-color: var(--navy-600, #2d3e5f);
  color: var(--navy-900, #07223f);
}
.ht-radio-chip.ht-sel {
  border-color: var(--navy-900, #07223f);
  background: var(--navy-50, #f3f5f9);
  color: var(--navy-900, #07223f);
  font-weight: 600;
}
.ht-radio-group.ht-vertical .ht-radio-chip {
  width: 100%;
  max-width: 420px;
}

/* ── Checkbox chips ──────────────────────────────────────── */
.ht-check-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.ht-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1.5px solid var(--gray-200, #e2e8f0);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--gray-700, #4a5568);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.13s, background 0.13s;
  width: 100%;
  max-width: 420px;
}
.ht-check-chip:hover { border-color: var(--navy-600, #2d3e5f); }
.ht-check-chip.ht-sel {
  border-color: var(--navy-900, #07223f);
  background: var(--navy-50, #f3f5f9);
  color: var(--navy-900, #07223f);
  font-weight: 500;
}
.ht-check-chip .ht-check-box {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-300, #cbd5e0);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.13s;
  background: #fff;
}
.ht-check-chip.ht-sel .ht-check-box {
  border-color: var(--navy-900, #07223f);
  background: var(--navy-900, #07223f);
}
.ht-check-chip.ht-sel .ht-check-box::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
/* "None" chip — softer style */
.ht-check-chip.ht-none-chip {
  border-style: dashed;
  color: var(--gray-500, #718096);
}
.ht-check-chip.ht-none-chip.ht-sel {
  border-style: solid;
  border-color: var(--gray-400, #a0aec0);
  background: var(--gray-50, #f7fafc);
  color: var(--gray-600, #718096);
  font-weight: 400;
}

/* ── Conditional sections ────────────────────────────────── */
.ht-cond {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100, #edf2f7);
}
.ht-cond.ht-cond-open { display: block; }

/* ── Inputs ──────────────────────────────────────────────── */
.ht-input,
.ht-textarea,
.ht-select {
  width: 100%;
  border: 1.5px solid var(--gray-200, #e2e8f0);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--gray-900, #1a202c);
  background: #fff;
  outline: none;
  transition: border-color 0.13s;
  box-sizing: border-box;
}
.ht-input:focus,
.ht-textarea:focus,
.ht-select:focus { border-color: var(--navy-900, #07223f); }
.ht-input::placeholder,
.ht-textarea::placeholder { color: var(--gray-400, #a0aec0); }
.ht-textarea { resize: vertical; min-height: 70px; }
.ht-input-sm { max-width: 180px; }
.ht-input-md { max-width: 260px; }
.ht-input-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.ht-price-row { display: flex; align-items: center; gap: 6px; }
.ht-price-row .ht-currency { font-size: 0.9rem; color: var(--gray-600, #718096); font-weight: 500; }

/* ── Upload zone ─────────────────────────────────────────── */
.ht-upload-zone {
  border: 2px dashed var(--gray-300, #cbd5e0);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: var(--gray-50, #f7fafc);
  transition: all 0.18s;
  margin-top: 10px;
}
.ht-upload-zone:hover,
.ht-upload-zone.ht-drag-over {
  border-color: var(--navy-600, #2d3e5f);
  background: var(--navy-50, #f3f5f9);
}
.ht-upload-zone input[type="file"] { display: none; }
.ht-upload-icon { font-size: 1.3rem; flex-shrink: 0; }
.ht-upload-text {}
.ht-upload-label { font-size: 0.85rem; font-weight: 600; color: var(--navy-900, #07223f); }
.ht-upload-hint  { font-size: 0.76rem; color: var(--gray-400, #a0aec0); margin-top: 2px; }

/* Uploaded file tags */
.ht-uploaded-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ht-file-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-50, #f0fff4);
  border: 1px solid #9ae6b4;
  border-radius: 20px;
  padding: 3px 10px 3px 8px;
  font-size: 12px;
  color: var(--green-600, #2d8c3c);
}
.ht-file-tag-remove {
  cursor: pointer;
  color: var(--gray-400, #a0aec0);
  font-size: 1rem;
  line-height: 1;
  border: none;
  background: none;
  padding: 0;
}
.ht-file-tag-remove:hover { color: var(--red-500, #e53e3e); }

/* ── Urgency pill ────────────────────────────────────────── */
.ht-urgency-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red-50, #fff5f5);
  border: 1px solid #feb2b2;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--red-500, #e53e3e);
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Success completion screen ───────────────────────────── */
.ht-survey-complete {
  padding: 32px 22px;
  text-align: center;
}
.ht-survey-complete .ht-complete-icon { font-size: 2.5rem; margin-bottom: 12px; }
.ht-survey-complete .ht-complete-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-600, #2d8c3c);
  margin-bottom: 6px;
}
.ht-survey-complete .ht-complete-body {
  font-size: 13px;
  color: var(--gray-600, #718096);
  line-height: 1.5;
}

/* ── Footer ──────────────────────────────────────────────── */
.ht-survey-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--gray-100, #edf2f7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}
.ht-foot-skip {
  font-size: 12px;
  color: var(--gray-400, #a0aec0);
  cursor: pointer;
  text-decoration: underline;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
}
.ht-foot-skip:hover { color: var(--gray-600, #718096); }
.ht-foot-right { display: flex; gap: 8px; align-items: center; }

.ht-btn-back {
  background: transparent;
  color: var(--gray-600, #718096);
  border: 1.5px solid var(--gray-200, #e2e8f0);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.13s;
}
.ht-btn-back:hover { border-color: var(--gray-400, #a0aec0); }

.ht-btn-next {
  background: var(--navy-900, #07223f);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.13s;
}
.ht-btn-next:hover { background: var(--navy-700, #1b2a4a); }
.ht-btn-next:disabled { background: var(--gray-300, #cbd5e0); cursor: not-allowed; }
.ht-btn-next.ht-green { background: var(--green-600, #2d8c3c); }
.ht-btn-next.ht-green:hover { background: var(--green-500, #38a169); }
.ht-btn-next .ht-arrow {
  transition: transform 0.13s;
  font-size: 0.9rem;
}
.ht-btn-next:not(:disabled):hover .ht-arrow { transform: translateX(3px); }

/* ── Saving spinner ──────────────────────────────────────── */
.ht-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: htSpin 0.6s linear infinite;
}
@keyframes htSpin { to { transform: rotate(360deg); } }

/* ── Error message ───────────────────────────────────────── */
.ht-error-msg {
  background: var(--red-50, #fff5f5);
  border: 1px solid #feb2b2;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--red-500, #e53e3e);
  margin-top: 10px;
  display: none;
}
.ht-error-msg.ht-visible { display: block; }

/* ── Section divider ─────────────────────────────────────── */
.ht-divider {
  border: none;
  border-top: 1px solid var(--gray-100, #edf2f7);
  margin: 16px 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .ht-survey-overlay { padding: 0; }
  .ht-survey-box {
    border-radius: 14px 14px 0 0;
    margin-top: auto;
    margin-bottom: 0;
    max-width: 100%;
  }
  .ht-radio-group.ht-vertical .ht-radio-chip { max-width: 100%; }
  .ht-check-chip { max-width: 100%; }
}

/* ── Upload guidance text ─────────────────────────────────── */
.ht-upload-guidance {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: #718096;
  line-height: 1.5;
}
