/* KHA Popup Lead - compact Bootstrap-compatible modal. */
.kha-popup-lead,.kha-popup-lead * { box-sizing:border-box; }
.kha-popup-lead { position:fixed; inset:0; z-index:999999; display:flex; align-items:center; justify-content:center; padding:18px; visibility:hidden; opacity:0; pointer-events:none; transition:opacity .2s ease,visibility 0s linear .2s; }
.kha-popup-lead--open { visibility:visible; opacity:1; pointer-events:auto; transition-delay:0s; }
.kha-popup-lead__overlay { position:absolute; inset:0; background:rgba(17,17,17,.52); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
.kha-popup-lead__dialog { position:relative; width:min(430px,100%); max-height:min(93dvh,800px); overflow:auto; border-radius:22px; color:#212529; background:#fff; box-shadow:0 20px 60px rgba(0,0,0,.22); opacity:0; transform:translateY(10px) scale(.98); transition:transform .2s ease,opacity .2s ease; }
.kha-popup-lead--open .kha-popup-lead__dialog { opacity:1; transform:none; }
.cf7-x-btn { position:absolute; top:14px; right:14px; z-index:2; display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; color:#212529; background:#f1f3f5; font-size:22px; line-height:1; cursor:pointer; }
.cf7-x-btn:hover { background:#e5e7eb; }
.cf7-x-btn:focus-visible { outline:3px solid rgba(0,122,255,.38); outline-offset:2px; }
.kha-popup-sending { position:absolute; inset:0; z-index:10; width:100%; height:100%; min-height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:24px; border-radius:inherit; text-align:center; color:#212529; background:rgba(255,255,255,.92); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); }
.kha-popup-sending[hidden] { display:none!important; }
.kha-popup-sending__terminal { width:min(340px,100%); margin-bottom:12px; padding:0; border:0; border-radius:0; color:#5e5ce6; background:transparent; box-shadow:none; overflow:hidden; text-align:left; }
.kha-popup-sending__topbar { display:flex; align-items:center; gap:6px; margin-bottom:12px; }
.kha-popup-sending__topbar i { width:7px; height:7px; border-radius:50%; background:#d6d6da; }
.kha-popup-sending__topbar i:first-child { background:#ff5f57; }.kha-popup-sending__topbar i:nth-child(2) { background:#febc2e; }.kha-popup-sending__topbar i:nth-child(3) { background:#28c840; }
.kha-popup-sending__topbar span { margin-left:auto; color:#aaaab0; font-size:9px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
.kha-popup-sending__terminal > span { display:block; width:0; overflow:hidden; white-space:nowrap; color:#007aff; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11px; line-height:1.85; animation:kha-popup-type 2.55s steps(28,end) infinite; }
.kha-popup-sending__terminal > span:nth-of-type(2) { animation-delay:.58s; }.kha-popup-sending__terminal > span:nth-of-type(3) { animation-delay:1.16s; }.kha-popup-sending__terminal > span:nth-of-type(4) { animation-delay:1.74s; }
.kha-popup-sending__progress { height:4px; margin-top:14px; overflow:hidden; border-radius:999px; background:#ececef; }
.kha-popup-sending__progress i { display:block; width:38%; height:100%; border-radius:inherit; background:linear-gradient(90deg,#007aff,#5e5ce6,#bf5af2,#ff375f); animation:kha-popup-flow 1.4s ease-in-out infinite; }
.kha-popup-sending strong { font-size:17px; }
.kha-popup-sending small { color:#6b7280; font-size:13px; }
.kha-popup-lead--sending .cf7-x-btn { pointer-events:none; opacity:.45; }
.kha-popup-lead__header { padding:26px 50px 14px; text-align:center; }
.kha-popup-lead__title { margin:0; color:#212529; font-size:24px; font-weight:700; line-height:1.25; }
.kha-popup-lead__subtitle { margin:8px 0 0; color:#6b7280; font-size:15px; line-height:1.55; }
.kha-popup-lead__body { padding:0 26px 24px; }
.kha-popup-form[hidden] { display:none!important; }
.kha-popup-loading,.kha-popup-error { margin:16px 0; text-align:center; font-size:14px; }
.kha-popup-error { color:#b42318; }
.cf7-retry-btn { display:block; min-height:40px; margin:0 auto 18px; padding:8px 18px; border:0; border-radius:999px; color:#fff; background:#0f766e; font-weight:600; cursor:pointer; }
.kha-popup-lead--success .kha-popup-lead__header { display:none; }
.kha-popup-lead--success .kha-popup-lead__body { padding:22px 24px 26px; }
.kha-popup-success { width:100%; padding:14px 0 4px; text-align:center; }
.kha-popup-success__check-wrap { display:grid; place-items:center; width:82px; height:82px; margin-bottom:14px; border-radius:50%; background:linear-gradient(145deg,#e8f2ff,#f0e9ff 58%,#ffe9f0); box-shadow:0 10px 28px rgba(94,92,230,.18); }
.kha-popup-success__check { width:68px; height:68px; fill:#fff; stroke:#5e5ce6; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.kha-popup-success strong { color:#202044; font-size:25px; line-height:1.25; letter-spacing:-.3px; }
.kha-popup-success__message { margin-top:6px; color:#59636f; font-size:15px; line-height:1.5; }
.kha-popup-success__hotline { grid-column:1 / -1; justify-content:flex-start; gap:12px; width:100%; min-height:68px; margin-top:20px; padding:10px 13px; border:1px solid #b9c9ff; border-radius:16px; color:#39318c; background:linear-gradient(135deg,#f0f7ff,#f8f1ff 58%,#fff1f5); box-shadow:0 8px 22px rgba(94,92,230,.1); text-align:left; text-decoration:none; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.kha-popup-success__hotline:hover,.kha-popup-success__hotline:focus-visible { color:#39318c; border-color:#8b82ff; box-shadow:0 12px 28px rgba(94,92,230,.18); outline:0; transform:translateY(-1px); text-decoration:none; }
.kha-popup-success__phone-icon { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; border-radius:50%; color:#fff; background:linear-gradient(135deg,#007aff,#5e5ce6); box-shadow:0 6px 14px rgba(94,92,230,.24); }
.kha-popup-success__phone-icon svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.kha-popup-success__hotline-copy { display:flex; flex:1; flex-direction:column; min-width:0; }
.kha-popup-success__hotline-copy small { display:none; color:#68709b; font-size:12px; font-weight:600; line-height:1.35; }
.kha-popup-success__hotline-copy b { color:#39318c; font-size:19px; line-height:1.35; letter-spacing:.2px; }
.kha-popup-success__hotline-copy b { font-size:26px; line-height:1; letter-spacing:.4px; }
.kha-popup-success__actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; width:100%; margin-top:18px; }
.kha-popup-success__hotline { justify-content:center; }
.kha-popup-success__action { display:flex; align-items:center; gap:9px; min-width:0; min-height:64px; padding:10px 12px; border:1px solid #b9c9ff; border-radius:14px; color:#39318c; background:linear-gradient(135deg,#f5f8ff,#fff5fa); text-decoration:none; text-align:left; transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.kha-popup-success__action:hover,.kha-popup-success__action:focus-visible { color:#39318c; border-color:#8b82ff; box-shadow:0 8px 20px rgba(94,92,230,.14); outline:0; transform:translateY(-1px); text-decoration:none; }
.kha-popup-success__action small { display:block; color:#68709b; font-size:11px; line-height:1.25; }
.kha-popup-success__action b { display:block; color:#39318c; font-size:13px; line-height:1.3; }
.kha-popup-success__zalo img,.kha-popup-success__facetime img { flex:0 0 34px; width:34px; height:34px; object-fit:contain; }
.kha-popup-success__zalo b,.kha-popup-success__facetime b { font-size:16px; }
.kha-popup-success__channel-icon { display:grid; place-items:center; flex:0 0 34px; width:34px; height:34px; border-radius:50%; color:#fff; background:linear-gradient(135deg,#5e5ce6,#bf5af2); font-size:18px; }
.kha-popup-success__actions .kha-popup-success__arrow { margin-left:auto; }
.kha-popup-success__arrow { flex:0 0 20px; width:20px; height:20px; fill:none; stroke:#5e5ce6; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.kha-popup-success__trust { display:flex; align-items:center; justify-content:center; gap:7px; margin-top:16px; padding:9px 13px; border-radius:999px; color:#59627d; background:linear-gradient(90deg,#f1f5ff,#faf4ff); font-size:12.5px; }
.kha-popup-success__trust svg { width:18px; height:18px; fill:none; stroke:#5e5ce6; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.kha-popup-lead :where(.wpcf7,.wpcf7-form) { margin:0; }
.kha-popup-lead :where(input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),textarea,select) { width:100%; min-height:46px; padding:11px 14px; border:1px solid #d8dde4; border-radius:12px; color:#212529; background:#fff; font:inherit; font-size:15px; transition:border-color .2s,box-shadow .2s; }
.kha-popup-lead textarea { min-height:82px; max-height:110px; resize:vertical; }
.kha-popup-lead :where(input,textarea,select):focus { border-color:#0f766e; outline:0; box-shadow:0 0 0 3px rgba(15,118,110,.12); }
.kha-popup-lead .wpcf7-acceptance { font-size:14px; line-height:1.5; }
.kha-popup-lead :where(input[type="submit"],button[type="submit"],.wpcf7-submit) { width:100%; min-height:46px; border:0; border-radius:999px; color:#fff; background:#0f766e; font-size:15px; font-weight:600; cursor:pointer; }
.kha-popup-lead .wpcf7-not-valid-tip { margin-top:4px; font-size:13px; }
.kha-popup-lead .wpcf7-response-output { margin:14px 0 0; border-radius:10px; font-size:14px; }
.kha-popup-lead .kha-phone-status { margin-top:4px; font-size:12px; }
html.kha-popup-lead-lock,html.kha-popup-lead-lock body { overflow:hidden; overscroll-behavior:none; }

/* Compact segmented choice for forms with the resale lead type field. */
.kha-popup-lead:has(.kha-popup-form:not([hidden]) [name="lead_type"]) .kha-popup-lead__subtitle { display:none; }
.kha-popup-form:has([name="lead_type"]) .wpcf7-form > p { margin:10px 0; }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] { display:block; margin:4px 0 10px; }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] .wpcf7-radio { position:relative; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:4px; border-radius:12px; background:#f1f3f5; }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] .wpcf7-radio::before { content:""; position:absolute; top:4px; bottom:4px; left:4px; width:calc((100% - 12px)/2); border-radius:9px; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.12); transition:transform .25s cubic-bezier(.2,.8,.2,1); }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] .wpcf7-radio:has(.wpcf7-list-item:nth-child(2) input:checked)::before { transform:translateX(calc(100% + 4px)); }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] .wpcf7-list-item { position:relative; min-width:0; margin:0; }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] label { position:relative; display:flex; min-height:42px; align-items:center; justify-content:center; padding:8px 10px; border-radius:9px; color:#59616d; font-size:14px; font-weight:600; line-height:1.2; text-align:center; cursor:pointer; }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] input { position:absolute; width:1px; height:1px; margin:0; opacity:0; }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] label:has(input:checked) { color:#202124; }
.kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] label:has(input:focus-visible) { outline:2px solid #0f766e; outline-offset:2px; }
.kha-popup-form:has([name="lead_type"]) textarea { min-height:68px; }

/* Desktop form rhythm: compact scan path without reducing control usability. */
@media (min-width:768px) {
 .kha-popup-lead__dialog { width:min(400px,100%); }
 .kha-popup-lead__header { padding:22px 52px 10px; }
 .kha-popup-lead__title { font-size:22px; }
 .kha-popup-lead__subtitle { margin-top:5px; font-size:14px; }
 .kha-popup-lead__body { padding:0 24px 20px; }
 /*.kha-popup-lead .wpcf7-form > p { margin:10px 0; }*/
 .kha-popup-lead .wpcf7-form > p:first-child { margin-top:4px; }
 .kha-popup-lead .radio-apartment { gap:12px 28px; margin:12px auto 16px; }
 .kha-popup-lead :where(input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),textarea,select) { min-height:44px; padding:9px 13px; }
 .kha-popup-lead textarea { min-height:76px; }
 .kha-popup-lead :where(input[type="submit"],button[type="submit"],.wpcf7-submit) { min-height:44px; }
}

/* Form-specific apartment selector retained. */
.kha-popup-lead .radio-apartment { display:grid; grid-template-columns:repeat(2,max-content); justify-content:center; gap:16px 40px; width:max-content; max-width:100%; margin:18px auto 22px; }
.kha-popup-lead .radio-apartment .wpcf7-list-item { margin:0; }
.kha-popup-lead .radio-apartment input[type="radio"] { position:absolute; opacity:0; pointer-events:none; }
.kha-popup-lead .radio-apartment label,.kha-popup-lead .radio-apartment .wpcf7-list-item-label { display:flex; align-items:center; margin:0; white-space:nowrap; cursor:pointer; }
.kha-popup-lead .radio-apartment .wpcf7-list-item-label::before { content:""; flex:0 0 18px; width:18px; height:18px; margin-right:10px; border:2px solid #c5cbd3; border-radius:50%; background:#fff; }
.kha-popup-lead .radio-apartment input[type="radio"]:checked + .wpcf7-list-item-label::before { border:5px solid #0f766e; }
.kha-popup-lead .radio-apartment input[type="radio"]:checked + .wpcf7-list-item-label { color:#0f766e; }

@media (max-width:767px) { .kha-popup-lead { padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); overflow-y:auto; overscroll-behavior:contain; } .kha-popup-lead__dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:22px; transform:translateY(-10%) scale(.98); } .kha-popup-lead--open .kha-popup-lead__dialog { transform:translateY(-10%); } .kha-popup-lead__header { padding:20px 46px 10px; } .kha-popup-lead__body { padding:0 18px 18px; } .kha-popup-lead__title { font-size:20px; } .kha-popup-lead__subtitle { font-size:14px; } .kha-popup-lead :where(input:not([type="submit"]),textarea) { min-height:44px; font-size:16px; } .kha-popup-lead textarea { min-height:72px; } .kha-popup-lead .radio-apartment { gap:14px 24px; } .kha-popup-success__actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .kha-popup-success__action { min-height:58px; padding:9px 10px; } .kha-popup-success__action b { font-size:12px; } }
@media (max-width:767px) { .kha-popup-lead--success .kha-popup-lead__body { padding:18px 18px 22px; } .kha-popup-success__hotline { min-height:66px; } }
@media (prefers-reduced-motion:reduce) { .kha-popup-lead,.kha-popup-lead__dialog { transition:none; } }
@media (prefers-reduced-motion:reduce) { .kha-popup-form .wpcf7-form-control-wrap[data-name="lead_type"] .wpcf7-radio::before { transition:none; } }
@keyframes kha-popup-type { 0% { width:0; opacity:.25; } 15% { opacity:1; } 66%,88% { width:100%; opacity:1; } 100% { width:100%; opacity:0; } }
@keyframes kha-popup-flow { 0% { transform:translateX(-120%); } 100% { transform:translateX(330%); } }
@media (prefers-reduced-motion:reduce) { .kha-popup-sending__terminal > span,.kha-popup-sending__progress i { animation:none; width:100%; } }
