/* The Home Offer - multi-step seller form (v2) */

:root {
  --tho-navy: #0F3A71;
  --tho-orange: #E45F23;
  --tho-orange-dark: #C74A12;
  --tho-ink: #1A2733;
  --tho-muted: #61708B;
  --tho-border: #E3E8F0;
  --tho-bg: #F4F6F9;
  --tho-card-shadow: 0 1px 2px rgba(16, 30, 54, .04), 0 8px 28px rgba(16, 30, 54, .07);
}

* { box-sizing: border-box; }

html { height: 100%; }

body.tho-msf-body {
  margin: 0;
  font-family: 'Roboto', Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(228, 95, 35, .07), transparent 60%),
    radial-gradient(900px 420px at 0% 110%, rgba(15, 58, 113, .06), transparent 60%),
    var(--tho-bg);
  color: var(--tho-ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ------------------------------------------------------------- top bar */
.tho-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tho-border);
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tho-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.tho-topbar-left img { height: 30px; display: block; }
#thoTopAddress {
  font-weight: 700;
  font-size: 14px;
  color: var(--tho-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1px solid var(--tho-border);
  padding-left: 14px;
}
#thoTopAddress:empty { display: none; }
.tho-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}
#thoSaved {
  font-size: 13px;
  color: #16A34A;
  font-weight: 700;
  opacity: 0;
  transition: opacity .3s;
}
#thoSaved.tho-saved-show { opacity: 1; }
.tho-topbar-phone {
  font-weight: 700;
  font-size: 14px;
  color: var(--tho-ink);
  text-decoration: none;
}
.tho-topbar-phone i { color: var(--tho-orange); margin-right: 6px; }
@media (max-width: 640px) {
  .tho-topbar { padding: 0 14px; }
  .tho-topbar-phone span { display: none; }
  #thoTopAddress { font-size: 13px; }
}

/* ---------------------------------------------------------------- main */
.tho-main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 130px; /* room for the fixed bottom bar */
}
@media (max-width: 640px) {
  .tho-main { padding: 16px 12px 120px; }
}

/* Question flow with the sidebar: wide two-panel layout on desktop */
.tho-sidebar { display: none; }
body.tho-has-sidebar .tho-sidebar { display: block; }

@media (min-width: 1000px) {
  body.tho-has-sidebar .tho-main {
    max-width: 1180px;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  body.tho-has-sidebar .tho-content { min-width: 0; }
  body.tho-has-sidebar .tho-groups { display: none; } /* sidebar replaces segments */
  body.tho-has-sidebar .tho-card { margin: 0; }
  /* Align the bottom bar controls with the content column */
  body.tho-has-sidebar .tho-bottombar-inner {
    max-width: 1180px;
    padding-left: 328px;
  }
}

/* Sidebar panel */
.tho-sidebar {
  background: #fff;
  border: 1px solid var(--tho-border);
  border-radius: 16px;
  box-shadow: var(--tho-card-shadow);
  padding: 18px;
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}
.tho-side-block {
  border-bottom: 1px solid var(--tho-border);
  padding: 4px 4px 14px;
  margin-bottom: 12px;
  position: relative;
}
.tho-side-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9AA7BC;
  margin-bottom: 4px;
}
.tho-side-strong { font-weight: 700; font-size: 14px; line-height: 1.35; }
.tho-side-dim { color: var(--tho-muted); font-size: 13px; margin-top: 2px; }
.tho-side-group { padding: 6px 0; }
.tho-side-group-h {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tho-ink);
  padding: 5px 4px;
  border-radius: 8px;
}
.tho-side-group-h i { font-size: 14px; color: #C3CCDA; }
.tho-side-group-click { cursor: pointer; user-select: none; }
.tho-side-group-click:hover { background: #F5F8FB; }
.tho-side-chev {
  margin-left: auto;
  font-size: 11px !important;
  color: #A5B0C2 !important;
  transition: transform .2s ease;
}
.tho-side-collapsed .tho-side-chev { transform: rotate(-90deg); }
.tho-side-collapsed .tho-side-q { display: none; }
.tho-side-count {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--tho-muted);
  background: #EEF2F7;
  border-radius: 99px;
  padding: 2px 8px;
}
.tho-side-count + .tho-side-chev { margin-left: 8px; }
.tho-side-done .tho-side-group-h i,
.tho-side-visited .tho-side-group-h i { color: #16A34A; }
.tho-side-current .tho-side-group-h { color: var(--tho-orange); }
.tho-side-current .tho-side-group-h i { color: var(--tho-orange); }
.tho-side-locked .tho-side-group-h { color: #A5B0C2; }

.tho-side-q {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid var(--tho-border);
  margin-left: 10px;
  padding: 7px 10px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
}
.tho-side-q:hover { background: #F5F8FB; }
.tho-side-q-t {
  display: block;
  font-size: 12.5px;
  color: var(--tho-muted);
  line-height: 1.35;
}
.tho-side-q-a {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--tho-ink);
  margin-top: 1px;
}
.tho-side-q-current { border-left-color: var(--tho-orange); background: #FFF6F1; }
.tho-side-q-current:hover { background: #FFF0E7; }
.tho-side-q-current .tho-side-q-t { color: var(--tho-orange); font-weight: 700; }
.tho-side-q-now { color: var(--tho-orange); font-weight: 700; font-size: 12px; }

.tho-side-help {
  margin-top: 10px;
  background: #F7F9FC;
  border: 1px solid var(--tho-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--tho-muted);
  line-height: 1.6;
}
.tho-side-help a { color: var(--tho-navy); font-weight: 700; text-decoration: none; }

/* Mobile: sidebar becomes a slide-in drawer */
.tho-answers-toggle {
  display: none;
  background: #fff;
  border: 1.5px solid var(--tho-border);
  border-radius: 10px;
  width: 38px; height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--tho-navy);
  font-size: 15px;
  cursor: pointer;
}
.tho-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 30, 54, .45);
  z-index: 40;
}
@media (max-width: 999px) {
  body.tho-has-sidebar .tho-answers-toggle { display: flex; }
  body.tho-has-sidebar .tho-sidebar {
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: min(320px, 86vw);
    max-height: none;
    border-radius: 0 16px 16px 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  body.tho-sidebar-open .tho-sidebar { transform: translateX(0); }
  body.tho-sidebar-open .tho-backdrop { display: block; }
}

.tho-view { opacity: 0; transform: translateY(10px); transition: opacity .22s ease, transform .22s ease; }
.tho-view.tho-enter-forward { transform: translateX(22px); }
.tho-view.tho-enter-back { transform: translateX(-22px); }
.tho-view.tho-in { opacity: 1; transform: translate(0, 0); }
.tho-view.tho-shake { animation: tho-shake .3s; }
@keyframes tho-shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Card */
.tho-card {
  background: #fff;
  border: 1px solid var(--tho-border);
  border-radius: 18px;
  box-shadow: var(--tho-card-shadow);
  padding: 34px 38px;
  max-width: 720px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .tho-card { padding: 22px 18px; border-radius: 14px; }
}

.tho-view h1 {
  font-size: 27px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 10px;
  color: var(--tho-ink);
}
@media (max-width: 640px) {
  .tho-view h1 { font-size: 21px; }
}
.tho-sub { color: var(--tho-muted); font-size: 15px; margin: 0 0 20px; line-height: 1.5; }
.tho-optional-note {
  font-size: 13px;
  color: var(--tho-muted);
  margin: -2px 0 16px;
}
.tho-req { color: #E11D48; }

/* Group segments (progress by section) */
.tho-groups {
  display: flex;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto 14px;
  padding: 0 4px;
}
.tho-seg { flex: 1; min-width: 0; }
.tho-seg span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9AA7BC;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tho-seg i {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: #DDE4EE;
}
.tho-seg.tho-seg-done i { background: var(--tho-orange); opacity: .45; }
.tho-seg.tho-seg-current span { color: var(--tho-orange); }
.tho-seg.tho-seg-current i { background: var(--tho-orange); }
@media (max-width: 640px) {
  .tho-seg span { display: none; }
  .tho-seg.tho-seg-current span { display: block; }
}

/* ------------------------------------------------------------ controls */
.tho-error {
  display: none;
  color: #B91C1C;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}

.tho-options { display: flex; flex-direction: column; gap: 10px; }
.tho-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
@media (max-width: 480px) {
  .tho-options-grid { grid-template-columns: repeat(2, 1fr); }
}
.tho-option {
  text-align: left;
  background: #fff;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.3;
  font-family: inherit;
  color: var(--tho-ink);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.tho-options-grid .tho-option { padding: 12px 14px; font-size: 14px; }
.tho-option:hover { border-color: var(--tho-navy); }
.tho-option.tho-selected {
  border-color: var(--tho-orange);
  box-shadow: inset 0 0 0 1px var(--tho-orange);
  background: #FFF6F1;
  font-weight: 700;
}

.tho-input {
  width: 100%;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--tho-ink);
  background: #fff;
  margin-bottom: 12px;
}
.tho-input:focus { outline: none; border-color: var(--tho-navy); box-shadow: 0 0 0 3px rgba(15, 58, 113, .12); }
select.tho-input { appearance: auto; }

.tho-field-row { display: flex; gap: 12px; }
.tho-field-row .tho-input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .tho-field-row { flex-direction: column; gap: 0; } }

.tho-phone-row { display: flex; gap: 10px; }
.tho-phone-row .tho-cc {
  flex: 0 0 118px;
  padding-left: 10px;
  padding-right: 6px;
  font-size: 15px;
}
.tho-phone-row input { flex: 1; min-width: 0; }

.tho-label { display: block; font-weight: 700; font-size: 15px; margin: 18px 0 8px; }

.tho-consent {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.55;
  color: var(--tho-muted);
  margin: 4px 0 4px;
  cursor: pointer;
}
.tho-consent input { margin-top: 3px; transform: scale(1.2); accent-color: var(--tho-orange); }
.tho-consent a { color: var(--tho-navy); }

.tho-range-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--tho-navy);
  margin-bottom: 10px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--tho-orange);
  margin: 4px 0 16px;
}
.tho-range-edit label {
  display: block;
  font-size: 13px;
  color: var(--tho-muted);
  margin-bottom: 6px;
}

/* Buttons */
.tho-btn {
  background: var(--tho-orange);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  border: 0;
  border-radius: 12px;
  padding: 15px 30px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(228, 95, 35, .25);
  transition: background .15s, transform .1s, opacity .15s;
}
.tho-btn:hover { background: var(--tho-orange-dark); }
.tho-btn:active { transform: scale(.99); }
.tho-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.tho-btn.tho-loading { opacity: .7; cursor: wait; }
.tho-btn-block { width: 100%; display: block; }

.tho-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--tho-navy);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.tho-link:hover { text-decoration: underline; }

/* -------------------------------------------------------- address view */
.tho-hero { max-width: 620px; margin-top: 6vh; text-align: center; }
.tho-hero-badge {
  width: 58px; height: 58px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: #FFF1E8;
  color: var(--tho-orange);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tho-address-row { display: flex; gap: 10px; margin-top: 4px; }
.tho-address-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
  min-width: 0;
}
.tho-address-field:focus-within { border-color: var(--tho-navy); box-shadow: 0 0 0 3px rgba(15, 58, 113, .12); }
.tho-address-field i { color: var(--tho-muted); }
.tho-address-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--tho-ink);
  padding: 15px 0;
  background: transparent;
}
.tho-address-row .tho-btn { white-space: nowrap; }
@media (max-width: 560px) {
  .tho-hero { margin-top: 2vh; }
  .tho-address-row { flex-direction: column; }
  .tho-address-row .tho-btn { width: 100%; }
}
.tho-hero-trust { margin-top: 16px; font-size: 13px; color: var(--tho-muted); }

/* -------------------------------------------------------- confirm view */
.tho-confirm { max-width: 520px; margin-top: 2vh; }
.tho-confirm h1 { font-size: 23px; }
.tho-map {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  background: #E8EEF5;
  margin-bottom: 12px;
  overflow: hidden;
}
@media (max-width: 640px) { .tho-map { height: 160px; } }
.tho-addr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #F7F9FC;
  border: 1px solid var(--tho-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.tho-addr-line1 { font-weight: 700; font-size: 16px; }
.tho-addr-line2 { color: var(--tho-muted); font-size: 14px; margin-top: 2px; }
.tho-confirm .tho-btn-block { margin-top: 16px; }
.tho-confirm .tho-error { margin-top: 12px; }

/* -------------------------------------------------------- contact view */
.tho-contact { max-width: 560px; }

/* ------------------------------------------------------- question view */
body.tho-has-sidebar .tho-qcard { min-height: 340px; }
.tho-qcard h1 { font-size: 24px; }
@media (max-width: 640px) { .tho-qcard h1 { font-size: 20px; } }
.tho-answer { margin-top: 6px; }

/* ----------------------------------------------------------- done view */
.tho-thanks { max-width: 560px; margin-top: 5vh; text-align: center; }
.tho-thanks .tho-check {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: #DCFCE7;
  color: #16A34A;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.tho-thanks p { color: var(--tho-muted); margin: 0 0 10px; line-height: 1.55; }
.tho-thanks a { color: var(--tho-navy); font-weight: 700; }
#thoSubmissionIdWrap { display: none; margin-top: 12px; font-size: 14px; color: var(--tho-muted); }
#thoSubmissionId { font-weight: 700; color: var(--tho-ink); }
.tho-start-over { display: inline-block; margin-top: 24px; }

.tho-spinner {
  width: 36px; height: 36px;
  border: 4px solid var(--tho-border);
  border-top-color: var(--tho-orange);
  border-radius: 50%;
  animation: tho-spin .8s linear infinite;
  margin: 16px auto 0;
}
@keyframes tho-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- bottom bar */
.tho-bottombar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--tho-border);
  display: none; /* shown by JS */
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
}
.tho-progress-track {
  position: absolute;
  top: -3px; left: 0; right: 0;
  height: 3px;
  background: #E6EBF2;
}
#thoProgressBar {
  height: 100%;
  width: 0%;
  background: var(--tho-orange);
  transition: width .4s ease;
}
.tho-bottombar-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#thoBackBtn {
  background: none;
  border: 0;
  color: var(--tho-muted);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 12px 8px;
  visibility: hidden;
}
#thoBackBtn:hover { color: var(--tho-ink); }
#thoNext {
  background: var(--tho-orange);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  border: 1.5px solid var(--tho-orange);
  border-radius: 12px;
  padding: 13px 42px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(228, 95, 35, .25);
  transition: background .15s, color .15s, box-shadow .15s;
}
#thoNext:hover { background: var(--tho-orange-dark); border-color: var(--tho-orange-dark); }
#thoNext:disabled { opacity: .5; cursor: wait; }
/* "Skip" state: quieter, outline style, so the primary look is reserved
   for real answers */
#thoNext.tho-skip {
  background: #fff;
  color: var(--tho-muted);
  border-color: #CBD5E1;
  box-shadow: none;
}
#thoNext.tho-skip:hover { color: var(--tho-ink); border-color: var(--tho-muted); }
@media (max-width: 640px) {
  #thoNext { flex: 1; padding: 14px 20px; }
  #thoBackBtn { flex: 0 0 auto; }
}

/* -------------------------------------------------------------- footer */
.tho-footer-note {
  text-align: center;
  font-size: 13px;
  color: var(--tho-muted);
  padding: 18px 16px 110px;
}
.tho-footer-note a { color: var(--tho-muted); }
