/* =============================================================
   Lumina — chat assistant (uses the site's tokens from styles.css)
   ============================================================= */
.lc { --lc-gap: 20px; font-family: var(--sans); color: var(--ink); }
.lc *, .lc *::before, .lc *::after { box-sizing: border-box; }
.lc [hidden] { display: none !important; }

/* ---------- Launcher ---------- */
.lc-launcher {
  position: fixed; right: max(var(--lc-gap), env(safe-area-inset-right)); bottom: max(var(--lc-gap), env(safe-area-inset-bottom)); z-index: 95;
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: var(--dark); color: var(--accent-2);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .5s var(--ease-out), box-shadow .4s, opacity .35s, background-color .3s;
  animation: lcIn .9s var(--ease-out) 1.2s both;
}
@keyframes lcIn { from { opacity: 0; transform: translateY(20px) scale(.8); } }
.lc-launcher:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 24px 50px -14px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(201, 169, 122, .4); }
.lc-launcher:active { transform: scale(.96); }
.lc-launcher svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--ease-out), opacity .3s; }
.lc-launcher .lc-ico-close { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
.lc.is-open .lc-launcher .lc-ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.lc.is-open .lc-launcher .lc-ico-close { opacity: 1; transform: none; }
.lc-launcher::after { /* soft halo pulse until first open */
  content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(201, 169, 122, .45);
  animation: lcHalo 2.6s var(--ease-out) 2.5s infinite;
}
.lc.was-opened .lc-launcher::after { animation: none; }
@keyframes lcHalo { 0% { box-shadow: 0 0 0 0 rgba(201, 169, 122, .45); } 70%, 100% { box-shadow: 0 0 0 16px rgba(201, 169, 122, 0); } }
.lc-badge {
  position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 0 3px var(--dark);
}
.lc.was-opened .lc-badge { display: none; }

/* Greeting bubble next to the launcher */
.lc-greet {
  position: fixed; right: calc(max(var(--lc-gap), env(safe-area-inset-right)) + 76px); bottom: calc(max(var(--lc-gap), env(safe-area-inset-bottom)) + 8px); z-index: 95;
  max-width: 250px; padding: .85rem 2.2rem .85rem 1rem; border-radius: 16px 16px 4px 16px;
  background: var(--surface); color: var(--ink); font-size: .9rem; line-height: 1.4; text-align: left;
  box-shadow: 0 20px 44px -16px rgba(0, 0, 0, .35), inset 0 0 0 1px var(--line);
  opacity: 0; transform: translateX(12px) scale(.96); transform-origin: right bottom; pointer-events: none;
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-out);
}
.lc-greet.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.lc-greet strong { display: block; font-family: var(--display); font-weight: 600; font-size: .95rem; letter-spacing: -.01em; }
.lc-greet-close { position: absolute; top: .4rem; right: .4rem; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.lc-greet-close:hover { background: var(--bg-2); color: var(--ink); }
.lc-greet-close svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* Hide the floating UI while a site modal / drawer / mobile menu is open */
.has-overlay .lc-launcher, .has-overlay .lc-greet { opacity: 0; pointer-events: none; }
.has-overlay .lc-launcher::after { animation-play-state: paused; }

/* ---------- Panel ---------- */
.lc-panel {
  position: fixed; z-index: 110; /* above the site's sticky nav */
  right: max(var(--lc-gap), env(safe-area-inset-right)); bottom: calc(max(var(--lc-gap), env(safe-area-inset-bottom)) + 76px);
  width: 400px; height: min(660px, calc(100dvh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border-radius: 24px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(15, 15, 14, .06);
  transform-origin: calc(100% - 30px) calc(100% + 40px);
  opacity: 0; transform: translateY(16px) scale(.92); visibility: hidden;
  transition: opacity .35s var(--ease-out), transform .55s var(--ease-out), visibility 0s .55s;
}
.lc.is-open .lc-panel { opacity: 1; transform: none; visibility: visible; transition: opacity .35s var(--ease-out), transform .55s var(--ease-out), visibility 0s; }

.lc-head {
  position: relative; display: flex; align-items: center; gap: .8rem; padding: 1rem 1rem 1rem 1.1rem;
  background: var(--dark); color: var(--cream); flex-shrink: 0;
}
.lc-head::after { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 169, 122, .28), transparent 70%); pointer-events: none; }
.lc-avatar { position: relative; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg, var(--accent-2), var(--accent)); flex-shrink: 0; }
.lc-avatar svg { width: 22px; height: 22px; }
.lc-avatar::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #3ecf7a; box-shadow: 0 0 0 3px var(--dark); }
.lc-title { flex: 1; min-width: 0; }
.lc-title strong { display: block; font-family: var(--display); font-weight: 500; font-size: 1.05rem; letter-spacing: -.015em; line-height: 1.2; }
.lc-title span { font-size: .78rem; color: rgba(245, 243, 239, .62); }
.lc-hbtn { position: relative; z-index: 1; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: rgba(245, 243, 239, .75); transition: background-color .3s, color .3s, transform .4s var(--ease-out); }
.lc-hbtn:hover { background: rgba(255, 255, 255, .1); color: var(--cream); }
.lc-hbtn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.lc-hbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lc-hbtn[data-lc-reset]:hover svg { transform: rotate(-120deg); transition: transform .5s var(--ease-out); }

/* ---------- Messages ---------- */
.lc-log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1.2rem 1rem .6rem;
  display: flex; flex-direction: column; gap: .7rem; scroll-behavior: smooth;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(201, 169, 122, .08), transparent 60%),
    var(--bg);
}
.lc-log::-webkit-scrollbar { width: 6px; }
.lc-log::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }
.lc-day { align-self: center; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .2rem 0 .3rem; }

.lc-msg { display: flex; flex-direction: column; gap: .5rem; max-width: 88%; animation: lcMsg .45s var(--ease-out) both; }
@keyframes lcMsg { from { opacity: 0; transform: translateY(8px); } }
.lc-msg--bot { align-self: flex-start; }
.lc-msg--user { align-self: flex-end; align-items: flex-end; }
.lc-bubble {
  padding: .75rem .95rem; border-radius: 18px; font-size: .93rem; line-height: 1.55; overflow-wrap: anywhere;
}
.lc-msg--bot .lc-bubble { background: var(--surface); border-bottom-left-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.lc-msg--user .lc-bubble { background: var(--ink); color: var(--cream); border-bottom-right-radius: 6px; }
.lc-bubble p + p, .lc-bubble p + ul, .lc-bubble ul + p { margin-top: .55rem; }
.lc-bubble ul { list-style: none; display: grid; gap: .35rem; margin: .1rem 0 0; padding: 0; }
.lc-bubble li { position: relative; padding-left: 1rem; }
.lc-bubble li::before { content: ""; position: absolute; left: .1rem; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.lc-bubble strong { font-weight: 700; }
.lc-bubble a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.lc-msg--user .lc-bubble a { color: var(--accent-2); }
.lc-caret { display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--accent); animation: lcBlink 1s steps(2) infinite; }
@keyframes lcBlink { 50% { opacity: 0; } }

/* Typing indicator */
.lc-typing { display: inline-flex; gap: 5px; align-items: center; padding: .95rem 1rem; }
.lc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: lcDot 1.2s var(--ease-soft) infinite; }
.lc-typing span:nth-child(2) { animation-delay: .15s; }
.lc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes lcDot { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Quick replies */
.lc-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .1rem; }
.lc-chip {
  padding: .55rem .85rem; border-radius: 999px; font-size: .84rem; font-weight: 600; text-align: left; line-height: 1.25;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color .3s, color .3s, box-shadow .3s, transform .4s var(--ease-out);
  animation: lcMsg .5s var(--ease-out) both;
}
.lc-chip:nth-child(2) { animation-delay: .06s; } .lc-chip:nth-child(3) { animation-delay: .12s; } .lc-chip:nth-child(4) { animation-delay: .18s; }
.lc-chip:hover { background: var(--ink); color: var(--cream); box-shadow: none; transform: translateY(-1px); }

/* Property mini cards inside the chat */
.lc-props-wrap { position: relative; max-width: 100%; }
.lc-props { display: flex; gap: .55rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; max-width: 100%; cursor: grab; }
.lc-props::-webkit-scrollbar { display: none; }
.lc-props.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.lc-props.is-dragging img { pointer-events: none; }
.lc-props-nav {
  position: absolute; top: 34px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 14px rgba(0,0,0,.16), inset 0 0 0 1px var(--line);
  transition: opacity .25s, transform .25s, background-color .25s;
}
.lc-props-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lc-props-nav:hover { background: var(--bg-2); }
.lc-props-nav.is-prev { left: -6px; }
.lc-props-nav.is-next { right: -6px; }
.lc-props-wrap[data-start="1"] .lc-props-nav.is-prev,
.lc-props-wrap[data-end="1"] .lc-props-nav.is-next { opacity: 0; pointer-events: none; transform: scale(.8); }
.lc-prop {
  flex: 0 0 214px; scroll-snap-align: start; display: grid; grid-template-columns: 64px 1fr; gap: .1rem .7rem; padding: .55rem;
  border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  animation: lcMsg .5s var(--ease-out) both;
}
.lc-prop img { grid-row: span 3; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--bg-2); }
.lc-prop strong { font-size: .82rem; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-prop small { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-prop-price { font-family: var(--display); font-size: .86rem; font-weight: 600; }
.lc-prop-actions { grid-column: 1 / -1; display: flex; gap: .35rem; margin-top: .45rem; }
.lc-prop-actions button { flex: 1; padding: .45rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line-strong); transition: background-color .3s, color .3s, box-shadow .3s; }
.lc-prop-actions button:hover { background: var(--bg-2); }
.lc-prop-actions button.is-primary { background: var(--ink); color: var(--cream); box-shadow: none; }
.lc-prop-actions button.is-primary:hover { background: var(--accent); }

/* Lead confirmation card */
.lc-lead {
  position: relative; overflow: hidden; padding: 1.1rem; border-radius: 18px; background: var(--dark); color: var(--cream);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .5); animation: lcMsg .6s var(--ease-out) both;
}
.lc-lead::after { content: ""; position: absolute; width: 180px; height: 180px; right: -70px; top: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 169, 122, .35), transparent 70%); pointer-events: none; }
.lc-lead-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.lc-lead-check svg { width: 36px; height: 36px; fill: none; stroke: var(--accent-2); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lc-lead-check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .9s var(--ease-out) .1s forwards; }
.lc-lead-check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s var(--ease-out) .6s forwards; }
.lc-lead-head strong { display: block; font-family: var(--display); font-weight: 500; font-size: 1.05rem; letter-spacing: -.015em; line-height: 1.25; }
.lc-lead-head span { font-size: .78rem; color: rgba(245, 243, 239, .6); }
.lc-lead dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0 0 1rem; padding: .85rem 0 0; border-top: 1px solid var(--dark-line); font-size: .84rem; }
.lc-lead dt { color: rgba(245, 243, 239, .55); }
.lc-lead dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.lc-wa {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: .55rem; width: 100%;
  min-height: 46px; padding: .65rem 1rem; border-radius: 999px; background: #25d366; color: #0b2e17; font-weight: 700; font-size: .92rem;
  transition: transform .45s var(--ease-out), box-shadow .4s, background-color .3s;
}
.lc-wa:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(37, 211, 102, .6); background: #2fe073; }
.lc-wa svg { width: 20px; height: 20px; fill: currentColor; }
.lc-lead .lc-wa { margin-top: .2rem; }

/* Booking form inside the chat */
.lc-fcard {
  display: grid; gap: .65rem; padding: 1rem; border-radius: 18px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px -22px rgba(0, 0, 0, .45); animation: lcMsg .6s var(--ease-out) both;
}
.lc-fhead strong { display: block; font-family: var(--display); font-weight: 500; font-size: 1.05rem; letter-spacing: -.015em; }
.lc-fhead span { font-size: .78rem; color: var(--muted); }
.lc-fprop { display: flex; align-items: center; gap: .7rem; padding: .55rem; border-radius: 14px; background: var(--bg); }
.lc-fprop img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.lc-fprop small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.lc-fprop strong { display: block; font-size: .9rem; line-height: 1.25; }
.lc-fprop span { font-size: .76rem; color: var(--muted); }
.lc-frow { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.lc-frow:has(.lc-field--s) { grid-template-columns: 1fr 88px; }
.lc-field { display: grid; gap: .25rem; min-width: 0; }
.lc-field > span { font-size: .72rem; font-weight: 700; color: var(--ink-2); }
.lc-field input:not([type="radio"]) {
  width: 100%; min-width: 0; min-height: 42px; padding: .5rem .7rem; border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--bg); font: inherit; font-size: 16px; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.lc-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 134, 90, .18); }
.lc-field.is-bad input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(181, 72, 59, .12); }
.lc-fseg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg-2); }
.lc-fseg label { flex: 1; min-width: 0; }
.lc-fseg input { position: absolute; opacity: 0; pointer-events: none; }
.lc-fseg span {
  display: block; padding: .45rem .3rem; border-radius: 9px; text-align: center; font-size: .8rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color .25s, color .25s, box-shadow .25s;
}
.lc-fseg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, .25); }
.lc-fseg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.lc-ferr { font-size: .8rem; font-weight: 600; color: var(--danger); }
.lc-ferr[hidden] { display: none; }
.lc-fsubmit {
  min-height: 46px; border-radius: 999px; background: var(--ink); color: var(--cream); font-weight: 700; font-size: .92rem;
  transition: background-color .3s, transform .3s var(--ease-out);
}
.lc-fsubmit:hover { background: var(--accent); }
.lc-fsubmit:disabled { opacity: .6; cursor: wait; }
.lc-fnote { font-size: .7rem; color: var(--muted); text-align: center; }
@media (max-width: 380px) { .lc-frow { grid-template-columns: 1fr; } .lc-frow:has(.lc-field--s) { grid-template-columns: 1fr 80px; } }

/* Error */
.lc-msg--error .lc-bubble { background: #fbf1ee; box-shadow: inset 0 0 0 1px rgba(181, 72, 59, .25); color: #6d2a22; }
.lc-err-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.lc-err-actions .lc-wa { width: auto; min-height: 38px; padding: .45rem .9rem; font-size: .84rem; }
.lc-retry { padding: .45rem .9rem; border-radius: 999px; font-size: .84rem; font-weight: 700; box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); }
.lc-retry:hover { background: var(--bg-2); }

/* ---------- Composer ---------- */
.lc-foot { flex-shrink: 0; padding: .7rem .8rem calc(.7rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.lc-form { display: flex; align-items: flex-end; gap: .5rem; padding: .3rem .3rem .3rem .9rem; border-radius: 22px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .25s; }
.lc-form:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgba(168, 134, 90, .12); }
.lc-input {
  flex: 1; min-width: 0; max-height: 120px; padding: .6rem 0; border: 0; outline: none; resize: none; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink);
}
.lc-input::placeholder { color: var(--muted); }
.lc-send {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; transition: transform .4s var(--ease-out), background-color .3s, opacity .3s;
}
.lc-send:hover:not(:disabled) { transform: scale(1.06); background: var(--ink); }
.lc-send:disabled { opacity: .35; cursor: not-allowed; }
.lc-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lc-meta { display: flex; justify-content: space-between; gap: .8rem; margin-top: .45rem; padding: 0 .3rem; font-size: .7rem; color: var(--muted); }
.lc-count.is-warn { color: var(--danger); font-weight: 700; }
.lc-demo { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--accent); }

/* Highlight a property card on the page when the chat points to it */
.prop.lc-highlight .prop-media { animation: lcHighlight 2.2s var(--ease-out); }
@keyframes lcHighlight { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 122, 0); } 20%, 60% { box-shadow: 0 0 0 4px var(--accent-2); } }

/* ---------- Mobile: full screen ---------- */
@media (max-width: 539px) {
  .lc { --lc-gap: 14px; }
  .lc-launcher { width: 58px; height: 58px; }
  .lc-greet { display: none; }
  .lc-panel {
    inset: 0; right: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0;
    transform: translateY(40px); transform-origin: 50% 100%;
  }
  .lc.is-open .lc-launcher { opacity: 0; pointer-events: none; }
  .lc-head { padding-top: calc(1rem + env(safe-area-inset-top)); }
  .lc-msg { max-width: 92%; }
  html.lc-lock, html.lc-lock body { overflow: hidden; }
}

/* Tasador teaser sits above the chat launcher instead of under it */
.teaser { bottom: calc(max(20px, env(safe-area-inset-bottom)) + 76px); }
@media (max-width: 539px) { .teaser { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px); } }
html.lc-open .teaser { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .lc-launcher::after, .lc-caret { animation: none; }
}
