/* "Need help?" chat button and window (2026-11-30): livewire/help-chat.blade.php */
.hd-help {
    position: fixed;
    z-index: 80;
    inset-inline-end: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    pointer-events: none;
    font-family: var(--hd-sans);
}

.hd-help > * {
    pointer-events: auto;
}

/* the old WhatsApp bubble of the home page: WhatsApp now lives in the chat */
.hd-wa-fab {
    display: none !important;
}

/* ---------- button ---------- */
.hd-help-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #d2a56c, #a67548 55%, #8a5f37);
    color: #fff;
    box-shadow: 0 16px 34px -10px rgba(138, 95, 55, .65), inset 0 1px 0 rgba(255, 255, 255, .35);
    cursor: pointer;
    opacity: 0;
    transform: scale(.4) translateY(20px);
    visibility: hidden;
    transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .35s, visibility 0s .55s, box-shadow .25s;
}

.hd-help.is-shown .hd-help-btn {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .35s, box-shadow .25s;
}

.hd-help-btn:hover {
    box-shadow: 0 20px 40px -10px rgba(138, 95, 55, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.hd-help-btn:focus-visible {
    outline: 3px solid var(--hd-gold-lite);
    outline-offset: 3px;
}

/* soft ring that calls for attention until the chat has been opened */
.hd-help.is-shown:not(.is-open) .hd-help-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(210, 165, 108, .7);
    animation: hd-help-ring 2.4s cubic-bezier(.16, 1, .3, 1) infinite;
}

@keyframes hd-help-ring {
    0% { transform: scale(1); opacity: .9; }
    80%, 100% { transform: scale(1.55); opacity: 0; }
}

.hd-help-ico {
    position: absolute;
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .25s;
}

.hd-help-ico .dot {
    fill: currentColor;
    stroke: none;
}

.hd-help-ico--close {
    width: 24px;
    height: 24px;
    opacity: 0;
    transform: rotate(-90deg) scale(.6);
}

.hd-help.is-open .hd-help-ico--chat {
    opacity: 0;
    transform: rotate(90deg) scale(.6);
}

.hd-help.is-open .hd-help-ico--close {
    opacity: 1;
    transform: none;
}

.hd-help-badge {
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #d9534f;
    color: #fff;
    font: 700 11px/1 var(--hd-sans);
}

.hd-help.is-open .hd-help-badge {
    display: none;
}

/* ---------- invitation ---------- */
.hd-help-teaser {
    position: relative;
    max-width: 280px;
    margin-inline-end: 4px;
    border: 1px solid var(--hd-line);
    border-radius: 18px 18px 6px 18px;
    background: #fff;
    box-shadow: 0 24px 50px -18px rgba(80, 55, 25, .4);
    transform-origin: bottom right;
}

.hd-help-teaser-in {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 16px 34px 16px 18px;
    border: 0;
    background: none;
    text-align: start;
    cursor: pointer;
}

.hd-help-teaser-in b {
    color: var(--hd-ink);
    font: 700 16px/1.25 var(--hd-serif);
}

.hd-help-teaser-in span {
    color: var(--hd-muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.hd-help-teaser-x {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: var(--hd-canvas);
    color: var(--hd-muted);
    cursor: pointer;
}

.hd-help-teaser-x .hd-i {
    width: 12px;
    height: 12px;
}

/* ---------- chat window ---------- */
.hd-help-panel {
    display: flex;
    flex-direction: column;
    width: 370px;
    max-height: calc(100vh - 130px);
    border: 1px solid var(--hd-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 40px 90px -30px rgba(40, 28, 14, .55), 0 8px 24px -12px rgba(80, 55, 25, .25);
    transform-origin: bottom right;
    overflow: hidden;
}

.hd-help-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 16px 18px;
    background: linear-gradient(135deg, #3a2a1a, #5a3f26);
    color: #fff;
}

.hd-help-avatar {
    flex: none;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border: 2px solid rgba(220, 187, 143, .6);
    border-radius: 50%;
    background: #fff;
}

.hd-help-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hd-help-who {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hd-help-who b {
    font: 700 16px var(--hd-serif);
}

.hd-help-who small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e6d5bd;
    font-size: 12.5px;
}

.hd-help-who small i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4cc38a;
    box-shadow: 0 0 0 3px rgba(76, 195, 138, .25);
}

.hd-help-x {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}

.hd-help-x:hover {
    background: rgba(255, 255, 255, .22);
}

.hd-help-x .hd-i {
    width: 16px;
    height: 16px;
}

.hd-help-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 16px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: radial-gradient(120% 60% at 100% 0, rgba(243, 232, 216, .6), transparent 60%), var(--hd-canvas);
}

.hd-help-msg {
    align-self: flex-start;
    max-width: 88%;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid var(--hd-line);
    border-radius: 4px 16px 16px 16px;
    background: #fff;
    color: var(--hd-ink);
    font-size: 14px;
    line-height: 1.5;
    animation: hd-help-pop .45s cubic-bezier(.16, 1, .3, 1) both;
}

.hd-help-msg + .hd-help-msg {
    animation-delay: .35s;
}

.hd-help-msg--me {
    align-self: flex-end;
    border-color: transparent;
    border-radius: 16px 4px 16px 16px;
    background: var(--hd-gold);
    color: #fff;
}

.hd-help-msg--done {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.hd-help-msg--done .hd-i {
    flex: none;
    margin-top: 1px;
    color: #3d9a6d;
}

@keyframes hd-help-pop {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
}

.hd-help-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
    padding: 16px 14px 14px;
    border: 1px solid var(--hd-line);
    border-radius: 16px;
    background: #fff;
    animation: hd-help-pop .5s .6s cubic-bezier(.16, 1, .3, 1) both;
}

.hd-help-form label,
.hd-help-form .hd-field-tel {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hd-help-form label > span,
.hd-help-form .hd-field-tel > span {
    color: var(--hd-muted);
    font-size: 12.5px;
    font-weight: 600;
}

.hd-help-form input:not([type="text"][tabindex="-1"]) {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--hd-line);
    border-radius: 12px;
    background: var(--hd-canvas);
    color: var(--hd-ink);
    font: 15px var(--hd-sans);
}

.hd-help-form .hd-tel input {
    border: 0;
    border-radius: 0;
    background: none;
}

.hd-help-form input:focus {
    outline: 0;
    border-color: var(--hd-gold-lite);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(220, 187, 143, .25);
}

.hd-help-form .hd-tel input:focus {
    box-shadow: none;
}

.hd-help-form .has-error {
    color: #b4442f;
    font-size: 12.5px;
}

.hd-help-form .hd-btn {
    margin-top: 4px;
}

.hd-help-note {
    color: var(--hd-muted);
    font-size: 11.5px;
    line-height: 1.4;
    text-align: center;
}

.hd-help-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-top: 1px solid var(--hd-line);
    background: #fff;
    color: #1f8a5b;
    font: 700 14px var(--hd-sans);
    text-decoration: none;
}

.hd-help-wa:hover {
    background: #f3faf6;
    color: #17734b;
}

.hd-help-wa .hd-i {
    width: 18px;
    height: 18px;
}

/* a shorter country list inside the small window */
.hd-help .hd-tel-list .hd-tel-items {
    max-height: 200px;
}

/* ---------- open / close ---------- */
.hd-help-enter,
.hd-help-leave {
    transition: opacity .25s, transform .4s cubic-bezier(.16, 1, .3, 1);
}

.hd-help-from {
    opacity: 0;
    transform: translateY(14px) scale(.94);
}

.hd-help-to {
    opacity: 1;
    transform: none;
}

/* ---------- phone ---------- */
@media (max-width: 700px) {
    .hd-help {
        inset-inline-end: 16px;
        bottom: 16px;
    }

    /* above the property page's price bar */
    body:has(.hd-mbar) .hd-help {
        bottom: 84px;
    }

    .hd-help-btn {
        width: 56px;
        height: 56px;
    }

    .hd-help-teaser {
        max-width: min(270px, calc(100vw - 32px));
    }

    /* the chat becomes a sheet over the bottom of the screen */
    .hd-help.is-open {
        inset: auto 0 0;
        align-items: stretch;
        gap: 0;
    }

    .hd-help.is-open .hd-help-btn {
        display: none;
    }

    .hd-help-panel {
        width: 100%;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
        transform-origin: bottom center;
    }

    .hd-help-form input:not([type="text"][tabindex="-1"]) {
        font-size: 16px; /* no zoom on iPhone */
    }
}

@media (prefers-reduced-motion: reduce) {
    .hd-help-btn,
    .hd-help-msg,
    .hd-help-form {
        animation: none;
        transition: none;
    }

    .hd-help.is-shown:not(.is-open) .hd-help-btn::before {
        animation: none;
    }
}

/* dimmed page behind the chat on a phone; a tap on it closes the chat */
.hd-help-dim {
    display: none;
}

@media (max-width: 700px) {
    .hd-help-dim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: -1;
        background: rgba(29, 22, 16, .45);
    }

    body:has(.hd-mbar) .hd-help.is-open {
        bottom: 0;
    }
}

.hd-help button {
    font-family: var(--hd-sans);
}
