
/* HayHomes Tools V4.0 - Correct flow + embedded lead form */
:root{
  --ht-yellow:#ffd400;
  --ht-yellow-hover:#edc500;
  --ht-ink:#111111;
  --ht-text:#202124;
  --ht-muted:#6b7280;
  --ht-bg:#f5f6f8;
  --ht-card:#ffffff;
  --ht-line:#e6e8ec;
  --ht-soft:#f8f9fb;
  --ht-green:#16803c;
  --ht-red:#d83b3b;
  --ht-blue:#2563eb;
  --ht-radius:18px;
  --ht-shadow:0 16px 44px rgba(17,17,17,.08);
  --ht-max:1180px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--ht-bg);
  color:var(--ht-text);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
button,input,select{font:inherit}
button{-webkit-tap-highlight-color:transparent}
.ht-page{min-height:60vh}
.ht-wrap{width:min(calc(100% - 32px),var(--ht-max));margin:0 auto;padding:30px 0 68px}
.ht-hero{
  display:flex;align-items:flex-start;justify-content:space-between;gap:24px;
  padding:10px 0 20px;
}
.ht-eyebrow{
  display:inline-flex;align-items:center;gap:7px;margin-bottom:8px;
  font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#555;
}
.ht-eyebrow::before{content:"";width:18px;height:3px;border-radius:999px;background:var(--ht-yellow)}
.ht-title{margin:0;font-size:clamp(25px,3vw,38px);line-height:1.16;letter-spacing:-.035em;color:var(--ht-ink)}
.ht-desc{max-width:760px;margin:10px 0 0;color:var(--ht-muted);font-size:15px;line-height:1.65}
.ht-hero-cta{flex:0 0 auto;padding-top:6px}
#hayhomesPopupButtonContainer{display:inline-flex}
#hayhomesPopupButtonContainer button,
#hayhomesPopupButtonContainer a,
#hayhomesPopupButtonContainer [role="button"]{
  min-height:44px!important;padding:0 16px!important;border:0!important;border-radius:12px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  background:#111!important;color:#fff!important;text-decoration:none!important;
  font-size:14px!important;font-weight:800!important;box-shadow:none!important;cursor:pointer!important;
}
.ht-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:22px;align-items:start}
.ht-card{
  background:var(--ht-card);border:1px solid var(--ht-line);border-radius:var(--ht-radius);
  box-shadow:0 8px 26px rgba(17,17,17,.045);padding:22px;
}
.ht-card + .ht-card{margin-top:16px}
.ht-section-title{margin:0 0 4px;font-size:17px;color:var(--ht-ink);letter-spacing:-.015em}
.ht-section-desc{margin:0 0 18px;color:var(--ht-muted);font-size:13.5px;line-height:1.55}
.ht-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 16px}
.ht-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.ht-field{min-width:0}
.ht-field--full{grid-column:1/-1}
.ht-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}
.ht-label{font-size:13.5px;font-weight:760;color:#202124}
.ht-unit{font-size:11.5px;color:var(--ht-muted);font-weight:650}
.ht-input,.ht-select{
  width:100%;height:46px;padding:0 13px;border:1px solid var(--ht-line);border-radius:12px;
  background:#fff;color:var(--ht-ink);outline:0;font-size:15px;
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
.ht-input:focus,.ht-select:focus{border-color:#b99b00;box-shadow:0 0 0 3px rgba(255,212,0,.20)}
.ht-input[readonly]{background:#f5f6f8;color:#555}
.ht-help{margin:6px 0 0;color:var(--ht-muted);font-size:12px;line-height:1.45}
.ht-error{display:none;margin:6px 0 0;color:var(--ht-red);font-size:12px}
.ht-field.is-error .ht-input,.ht-field.is-error .ht-select{border-color:var(--ht-red);box-shadow:0 0 0 3px rgba(216,59,59,.10)}
.ht-field.is-error .ht-error{display:block}
.ht-range{width:100%;accent-color:#111;margin:10px 0 0}
.ht-range-meta{display:flex;justify-content:space-between;color:var(--ht-muted);font-size:11px;margin-top:2px}
.ht-actions{display:flex;gap:10px;margin-top:18px}
.ht-btn{
  min-height:48px;padding:0 18px;border:0;border-radius:13px;background:var(--ht-yellow);color:#111;
  font-size:15px;font-weight:850;cursor:pointer;transition:transform .15s ease,background .15s ease,box-shadow .15s ease;
}
.ht-btn:hover{background:var(--ht-yellow-hover);box-shadow:0 10px 24px rgba(17,17,17,.10);transform:translateY(-1px)}
.ht-btn:active{transform:none}
.ht-btn--secondary{background:#f0f1f3;color:#222;box-shadow:none}
.ht-btn--secondary:hover{background:#e6e7e9}
.ht-btn--full{width:100%}
.ht-advanced{margin-top:16px;border-top:1px solid var(--ht-line);padding-top:12px}
.ht-advanced summary{
  min-height:42px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;
  font-size:14px;font-weight:780;color:#222;list-style:none;
}
.ht-advanced summary::-webkit-details-marker{display:none}
.ht-advanced summary::after{content:"+";width:27px;height:27px;border-radius:8px;background:#f1f2f4;display:grid;place-items:center;font-size:19px;font-weight:500}
.ht-advanced[open] summary::after{content:"−";background:#111;color:#fff}
.ht-advanced-body{padding-top:12px}
.ht-summary{position:sticky;top:142px}
.ht-summary-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.ht-summary-title{margin:0;font-size:16px;color:#111}
.ht-badge{padding:5px 8px;border-radius:999px;background:#f1f2f4;font-size:11px;font-weight:800;color:#555}
.ht-kpis{display:grid;gap:9px}
.ht-kpi{padding:14px;border:1px solid var(--ht-line);border-radius:14px;background:#fff}
.ht-kpi-label{margin:0 0 5px;color:var(--ht-muted);font-size:12.5px;font-weight:650}
.ht-kpi-value{margin:0;color:#111;font-size:20px;font-weight:900;letter-spacing:-.025em;overflow-wrap:anywhere}
.ht-kpi-value.is-positive{color:var(--ht-green)}
.ht-kpi-value.is-negative{color:var(--ht-red)}
.ht-kpi-value.is-blue{color:var(--ht-blue)}
.ht-insight{margin-top:12px;padding:13px 14px;border-radius:13px;background:#fff8d9;color:#4c4300;font-size:13px;line-height:1.55}
.ht-insight strong{color:#111}
.ht-result{display:none;margin-top:16px}
.ht-result.is-visible{display:block;animation:htFade .22s ease}
@keyframes htFade{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.ht-result-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.ht-result-box{padding:15px;border:1px solid var(--ht-line);border-radius:14px;background:var(--ht-soft)}
.ht-result-label{display:block;color:var(--ht-muted);font-size:12.5px;font-weight:650;margin-bottom:5px}
.ht-result-value{font-size:18px;font-weight:900;color:#111;overflow-wrap:anywhere}
.ht-note{margin-top:14px;padding:14px;border-radius:13px;background:#f8f9fb;border:1px solid var(--ht-line);font-size:13px;line-height:1.6;color:#555}
.ht-table-wrap{margin-top:15px;border:1px solid var(--ht-line);border-radius:14px;overflow:auto;max-height:460px}
.ht-table{width:100%;border-collapse:collapse;min-width:640px}
.ht-table th{position:sticky;top:0;background:#181818;color:#fff;font-size:12.5px;font-weight:750;padding:10px;text-align:right}
.ht-table td{padding:10px;border-bottom:1px solid var(--ht-line);font-size:12.5px;text-align:right;white-space:nowrap}
.ht-table th:first-child,.ht-table td:first-child{text-align:center}
.ht-related{margin-top:22px}
.ht-related-title{margin:0 0 11px;font-size:16px}
.ht-related-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.ht-related-link{
  min-height:76px;padding:13px;border:1px solid var(--ht-line);border-radius:14px;background:#fff;
  color:#222;text-decoration:none;display:flex;flex-direction:column;justify-content:center;
  transition:border-color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.ht-related-link:hover{border-color:#c8a900;transform:translateY(-1px);box-shadow:0 8px 20px rgba(17,17,17,.06)}
.ht-related-link strong{font-size:13.5px}.ht-related-link span{margin-top:3px;color:var(--ht-muted);font-size:12px}
.ht-inline-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.ht-mini-btn{min-height:38px;padding:0 12px;border:1px solid var(--ht-line);border-radius:10px;background:#fff;font-size:12.5px;font-weight:750;cursor:pointer}
.ht-mini-btn:hover{border-color:#b99b00}
@media(max-width:980px){
  .ht-layout{grid-template-columns:1fr}
  .ht-summary{position:static}
  .ht-summary .ht-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:720px){
  .ht-wrap{width:min(calc(100% - 24px),var(--ht-max));padding:20px 0 48px}
  .ht-hero{display:block;padding:4px 0 16px}
  .ht-hero-cta{margin-top:12px}
  #hayhomesPopupButtonContainer,
  #hayhomesPopupButtonContainer button,
  #hayhomesPopupButtonContainer a,
  #hayhomesPopupButtonContainer [role="button"]{width:100%!important}
  .ht-card{padding:16px;border-radius:16px}
  .ht-grid,.ht-grid-3{grid-template-columns:1fr;gap:13px}
  .ht-actions{display:grid;grid-template-columns:1fr}
  .ht-summary .ht-kpis{grid-template-columns:1fr}
  .ht-result-grid{grid-template-columns:1fr}
  .ht-related-grid{grid-template-columns:1fr}
  .ht-title{font-size:25px}
  .ht-desc{font-size:14px}
  .ht-table-wrap{max-height:390px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}


/* V3.1 runtime compatibility */
.ht-input[type="number"]{
  appearance:textfield;
  -moz-appearance:textfield;
}
.ht-input[type="number"]::-webkit-inner-spin-button,
.ht-input[type="number"]::-webkit-outer-spin-button{
  opacity:.55;
}
@supports not (height:100dvh){
  .ht-page{min-height:60vh}
}


/* ===== FORM CUỐI LUỒNG ===== */
.ht-lead-section{margin-top:22px;scroll-margin-top:110px}
.ht-lead-card{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:30px;padding:28px;background:#111;color:#fff;border-color:#111;box-shadow:0 20px 60px rgba(17,17,17,.14)}
.ht-lead-copy{padding:8px 4px}
.ht-lead-kicker{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;background:var(--ht-yellow);color:#111;font-size:11px;font-weight:900;letter-spacing:.06em;text-transform:uppercase}
.ht-lead-copy h2{margin:16px 0 10px;font-size:clamp(24px,3vw,34px);line-height:1.18;letter-spacing:-.035em;color:#fff}
.ht-lead-copy p{margin:0;color:#c9cbd0;font-size:14px;line-height:1.7}
.ht-lead-proof{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.ht-lead-proof span{padding:7px 9px;border:1px solid rgba(255,255,255,.14);border-radius:10px;color:#f3f4f6;font-size:12px;font-weight:700}
.ht-lead-form{padding:20px;border-radius:16px;background:#fff;color:var(--ht-text)}
.ht-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 15px}
.ht-lead-form .ht-label b{color:var(--ht-red)}
.ht-textarea{width:100%;min-height:94px;padding:12px 13px;border:1px solid var(--ht-line);border-radius:12px;background:#fff;color:var(--ht-ink);outline:0;font:inherit;resize:vertical;transition:border-color .18s ease,box-shadow .18s ease}
.ht-textarea:focus{border-color:#b99b00;box-shadow:0 0 0 3px rgba(255,212,0,.20)}
.ht-consent{display:flex;align-items:flex-start;gap:9px;margin:14px 0;color:#666;font-size:12px;line-height:1.5;cursor:pointer}
.ht-consent input{width:17px;height:17px;margin:1px 0 0;accent-color:#111;flex:0 0 auto}
.ht-submit-btn{position:relative}
.ht-submit-btn.is-loading span{opacity:.55}
.ht-submit-btn.is-loading::after{content:"";position:absolute;width:18px;height:18px;border:2px solid rgba(17,17,17,.25);border-top-color:#111;border-radius:50%;animation:htSpin .7s linear infinite}
@keyframes htSpin{to{transform:rotate(360deg)}}
.ht-form-status{display:none;margin-top:11px;padding:10px 12px;border-radius:10px;font-size:12.5px;line-height:1.45}
.ht-form-status.is-loading,.ht-form-status.is-error,.ht-form-status.is-success{display:block}
.ht-form-status.is-loading{background:#f5f6f8;color:#555}
.ht-form-status.is-error{background:#fff0f0;color:#a42121;border:1px solid #f4caca}
.ht-form-status.is-success{background:#edf9f2;color:#126335;border:1px solid #c9ead6}
@media(max-width:820px){.ht-lead-card{grid-template-columns:1fr;gap:18px;padding:20px}.ht-lead-copy{padding:2px}.ht-form-grid{grid-template-columns:1fr}}
@media(max-width:560px){.ht-lead-section{margin-top:16px}.ht-lead-card{padding:15px;border-radius:16px}.ht-lead-form{padding:15px}.ht-lead-copy h2{font-size:24px}.ht-lead-proof{display:grid;grid-template-columns:1fr 1fr}.ht-lead-proof span:last-child{grid-column:1/-1}}


/* V10 - Shared HayHomes form loader */
.ht-contact-section{margin-top:28px;scroll-margin-top:90px}
#hayhomesFormContainer{width:100%;min-height:1px}
@media (max-width:720px){.ht-contact-section{margin-top:20px}}
