/* ============================================================
   LUXITO — branded AI chat, full-screen overlay
   Vanilla port of the prebuilt Framer chatbot. No deps.
   Opens over ANY page from a #/luxito trigger (js/luxito.js);
   there is no dedicated route/page.
   ============================================================ */

/* while the chat is open, lock the page behind it */
body.luxito-open{overflow:hidden}
body.luxito-open .chat{display:none}

/* ---------- overlay shell (fills the viewport) ---------- */
.luxito-overlay{
  position:fixed;inset:0;z-index:500;
  display:flex;flex-direction:column;
  background:
    radial-gradient(900px 440px at 50% -8%, rgba(var(--accent-rgb),.10), transparent 70%),
    var(--lx-deep);
  animation:luxitoIn .26s var(--ease-out);   /* runs each time it's shown */
}
.luxito-overlay[hidden]{display:none}
.luxito-overlay.is-closing{animation:luxitoOut .2s var(--ease-out) forwards}

/* pulsing inset border glow while Luxito is generating a reply */
.luxito-overlay::after{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:-1;
  box-shadow:inset 0 0 80px 0 rgba(var(--accent-rgb),0);
  transition:box-shadow .45s var(--ease-out);
}
.luxito-overlay.is-thinking::after{
  box-shadow:inset 0 0 55px 2px rgba(var(--accent-rgb),.55);
  animation:luxitoGlow 1.7s ease-in-out infinite;
}
@keyframes luxitoGlow{
  0%,100%{box-shadow:inset 0 0 38px 0 rgba(var(--accent-rgb),.42)}
  50%    {box-shadow:inset 0 0 78px 6px rgba(var(--accent-rgb),.78)}
}
@media (prefers-reduced-motion:reduce){
  .luxito-overlay.is-thinking::after{animation:none;box-shadow:inset 0 0 55px 2px rgba(var(--accent-rgb),.55)}
}
/* transform-only entrance so the panel is never invisible if the
   animation is paused (e.g. a backgrounded tab); opacity stays 1 */
@keyframes luxitoIn{from{transform:translateY(8px) scale(.992)}to{transform:none}}
@keyframes luxitoOut{from{opacity:1}to{opacity:0}}
@media (prefers-reduced-motion:reduce){
  .luxito-overlay,.luxito-overlay.is-closing{animation:none}
}

/* ---------- top bar: Luxera header (logo · trusted-by · book a call · close) ---------- */
/* 3 columns so the trusted-by carousel sits dead-centre with whitespace either side */
.luxito-overlay__bar{
  flex:none;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:var(--space-6);
  padding:var(--space-5) clamp(var(--space-6),4vw,var(--space-10));
  border-bottom:1px solid var(--border-hairline);
}
.luxito-overlay__logo{justify-self:start;display:flex;align-items:center}
.luxito-overlay__logo img{height:28px;width:auto;display:block}
.luxito-overlay__trust{justify-self:center;min-width:0;display:flex;align-items:center;gap:var(--space-5)}
.luxito-overlay__trust-label{flex:none;color:var(--text-muted);font-family:var(--font-display);font-size:14px;white-space:nowrap}
.luxito-overlay__trust-mq{width:420px;max-width:100%}      /* short & centred, edges fade via .mq mask */
.luxito-overlay__trust-mq .mq__track{gap:52px}
.luxito-overlay__trust-mq img{height:18px}
.luxito-overlay__actions{justify-self:end;display:flex;align-items:center;gap:var(--space-4)}
.luxito-overlay__close{
  flex:none;width:44px;height:44px;border-radius:var(--radius-full);
  border:1px solid var(--border-hairline);background:var(--surface-hover);color:var(--text-body);
  cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  transition:color var(--dur-fast) var(--ease-out),border-color var(--dur-fast) var(--ease-out),
             background var(--dur-fast) var(--ease-out);
}
.luxito-overlay__close:hover{color:var(--lx-ice);border-color:var(--lx-ice);background:rgba(var(--accent-rgb),.12)}
.luxito-overlay__close svg{width:18px;height:18px}

/* ---------- scroll area (centered readable column) ---------- */
.luxito__scroll{
  flex:1 1 auto;min-height:0;overflow-y:auto;
  width:100%;max-width:880px;margin-inline:auto;
  /* extra bottom padding so the newest message clears the bottom fade */
  --lx-fade:48px;
  padding:var(--space-10) clamp(var(--space-6),4vw,var(--space-10)) calc(var(--lx-fade) + var(--space-6));
  display:flex;flex-direction:column;gap:var(--space-8);
  /* fade messages into the background at the top & bottom edges as they scroll */
  -webkit-mask:linear-gradient(to bottom,transparent 0,#000 var(--lx-fade),#000 calc(100% - var(--lx-fade)),transparent 100%);
  mask:linear-gradient(to bottom,transparent 0,#000 var(--lx-fade),#000 calc(100% - var(--lx-fade)),transparent 100%);
}

/* welcome (empty state) */
.luxito__welcome{
  flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:var(--space-7);text-align:center;
}
.luxito-overlay.is-active .luxito__welcome{display:none}

/* avatar */
.luxito__avatar{display:block;flex:none}
.luxito__avatar video{width:100%;height:100%;object-fit:cover;display:block;border-radius:var(--radius-full)}
.luxito__avatar img{width:100%;height:100%;object-fit:contain;display:block;
  filter:drop-shadow(0 6px 14px rgba(var(--accent-rgb),.28))}
.luxito__avatar--lg{width:132px;height:132px}
.luxito__avatar--sm{width:36px;height:36px}

/* thread + messages — plain text, no bubbles:
   your question is a big ice headline, Luxito's answer is smaller muted body text. */
/* spacing: tight within a Q&A pair, loose between pairs (base = --space-9) */
.luxito__thread{display:flex;flex-direction:column;gap:0}
.luxito__thread .lx-msg + .lx-msg{margin-top:var(--space-9)}
.luxito__thread .lx-msg--user + .lx-msg--agent{margin-top:calc(var(--space-9) / 2)}   /* your Q → Luxito's A */
.luxito__thread .lx-msg--agent + .lx-msg--user{margin-top:calc(var(--space-9) * 2)}   /* answer → next question */
.lx-msg{display:flex;gap:var(--space-4);max-width:100%}
.lx-msg--user,.lx-msg--agent{flex-direction:row}
.lx-msg--agent .luxito__avatar{align-self:flex-start;margin-top:2px}
/* thinking row: avatar + label vertically centred with each other */
.lx-msg--thinking{align-items:center}
.lx-msg--thinking .luxito__avatar{align-self:center;margin-top:0}
.lx-msg__bubble{
  padding:0;background:none;border:none;border-radius:0;max-width:100%;
  font-family:var(--font-display);word-wrap:break-word;overflow-wrap:anywhere;
}
.lx-msg__bubble p{margin:0}
.lx-msg__bubble p + p{margin-top:.5em}
/* your messages — large ice headline with glow */
.lx-msg--user .lx-msg__bubble{
  font-size:clamp(28px,3.4vw,44px);line-height:1.2;
  color:var(--lx-ice);text-shadow:0 4px 24px rgba(var(--accent-rgb),.25);
}
/* Luxito's messages — smaller muted body, beside the avatar */
.lx-msg--agent .lx-msg__bubble{
  font-size:20px;line-height:1.5;color:rgba(255,255,255,.8);
}
/* blinking caret at the end of the text while a reply types out */
.lx-caret{
  display:inline-block;width:2px;height:1em;
  background:var(--lx-ice);margin-left:3px;vertical-align:-2px;border-radius:1px;
  animation:lxCaret 1s steps(1) infinite;
}
@keyframes lxCaret{50%{opacity:0}}

/* thinking shimmer */
.lx-shimmer{
  background:linear-gradient(90deg,
    rgba(var(--accent-rgb),1) 0%, rgba(var(--accent-rgb),.4) 25%,
    rgba(var(--accent-rgb),1) 50%, rgba(var(--accent-rgb),.4) 75%,
    rgba(var(--accent-rgb),1) 100%);
  background-size:200% 100%;
  -webkit-background-clip:text;background-clip:text;color:transparent;
  animation:lxShimmer 2s linear infinite;
}
@keyframes lxShimmer{0%{background-position:0% center}100%{background-position:200% center}}
@media (prefers-reduced-motion:reduce){.lx-shimmer{animation:none;color:var(--lx-ice)}}

/* inline booking CTA (API showCalendar flag) */
.lx-book{margin-top:var(--space-5)}

/* ---------- composer (centered, matches scroll column) ---------- */
.luxito__composer{
  flex:none;width:100%;max-width:880px;margin-inline:auto;
  display:flex;flex-direction:column;gap:var(--space-5);
  padding:var(--space-6) clamp(var(--space-6),4vw,var(--space-10)) clamp(var(--space-7),4vw,var(--space-10));
  border-top:1px solid var(--border-hairline);
}
/* reserve one chip-row of height even when empty, so the composer never
   changes height (which would otherwise push the newest message below the fold) */
.luxito__suggest{display:flex;flex-wrap:nowrap;gap:var(--space-4);overflow-x:auto;scrollbar-width:none;min-height:35px}
.luxito__suggest::-webkit-scrollbar{display:none}
.lx-chip{
  flex:none;white-space:nowrap;
  border:1px solid rgba(var(--accent-rgb),.28);background:var(--surface-hover);color:var(--text-body);
  padding:8px 14px;border-radius:var(--radius-pill);
  font-family:var(--font-display);font-size:14px;line-height:1.2;cursor:pointer;
  transition:background var(--dur-fast) var(--ease-out),
             border-color var(--dur-fast) var(--ease-out),
             color var(--dur-fast) var(--ease-out);
}
.lx-chip:hover{background:rgba(var(--accent-rgb),.12);border-color:var(--lx-ice);color:var(--lx-ice)}
.lx-chip[disabled]{opacity:.5;cursor:not-allowed}

/* composer: design-system .input field (pill) with the send button nested inside.
   Both fully rounded (--radius-full); a circle at the pill's right end stays concentric. */
.luxito__bar{position:relative;--lx-send-inset:4px}
.luxito__input.input{width:100%;padding-right:56px;border-radius:var(--radius-full)}
.luxito__send{
  position:absolute;top:var(--lx-send-inset);right:var(--lx-send-inset);bottom:var(--lx-send-inset);
  aspect-ratio:1;width:auto;
  border:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  background:var(--lx-ice);color:var(--text-on-accent);
  border-radius:var(--radius-full);
  transition:filter var(--dur-fast) var(--ease-out),opacity var(--dur-fast) var(--ease-out);
}
.luxito__send svg{width:18px;height:18px}
.luxito__send:hover{filter:brightness(1.06)}
.luxito__send:disabled{opacity:.45;cursor:not-allowed}

/* ---------- mobile ---------- */
@media (max-width:809.98px){
  .luxito-overlay__bar{display:flex;justify-content:space-between;padding:var(--space-5) var(--space-6);gap:var(--space-5)}
  .luxito-overlay__trust{display:none}
  .luxito-overlay__logo img{height:24px}
  .luxito__scroll{padding:var(--space-8) var(--space-6);gap:var(--space-7)}
  .luxito__avatar--lg{width:104px;height:104px}
  .luxito__composer{padding:var(--space-5) var(--space-6) var(--space-6)}
  .lx-msg--agent .lx-msg__bubble{font-size:18px}
}

/* ============================================================
   LUXITO — embeddable chat (iframe on the AI-agent page)
   ============================================================ */
/* the standalone luxito-embed.html document */
.luxito-embed{margin:0;min-height:100dvh;background:var(--surface-card);color:var(--text-body)}
.luxito-embed__panel{position:relative;isolation:isolate;display:flex;flex-direction:column;
  height:100dvh;background:var(--surface-card)}
.luxito-embed__panel.is-active .luxito__welcome{display:none}
/* pulsing border glow while Luxito is thinking (mirrors the overlay) */
.luxito-embed__panel::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:-1;
  box-shadow:inset 0 0 80px 0 rgba(var(--accent-rgb),0);transition:box-shadow .45s var(--ease-out)}
.luxito-embed__panel.is-thinking::after{
  box-shadow:inset 0 0 55px 2px rgba(var(--accent-rgb),.55);animation:luxitoGlow 1.7s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){
  .luxito-embed__panel.is-thinking::after{animation:none;box-shadow:inset 0 0 55px 2px rgba(var(--accent-rgb),.55)}
}

/* the framed iframe placed on the service page */
.luxito-frame{margin:var(--space-10) auto 0;
  border:2px solid var(--border-card);border-radius:var(--radius-3xl);overflow:hidden;
  box-shadow:var(--shadow-card);background:var(--surface-card)}
.luxito-frame iframe{display:block;width:100%;height:840px;border:0}
@media (max-width:809.98px){
  .luxito-frame iframe{height:72vh;min-height:460px}
}
