/* Website chat bots (S8, 2026-11-15). Same family as the cookie card: deep navy panel, each bot wears its page accent
   (--mxc-accent, set from PHP). Text on navy is #eef3fa / #c9d5e4 (AA); accent fills carry dark ink #10141c. */
.mxc { --mxc-accent: #ff9a2e; --mxc-ink: #10141c; --mxc-bg: #0c1e36; --mxc-bg2: #13294a; --mxc-line: rgba(255,255,255,.12);
  --mxc-text: #eef3fa; --mxc-sub: #c9d5e4; position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 9980;
  font-family: var(--site-font, inherit); color: var(--mxc-text); }
.mxc, .mxc *, .mxc *::before, .mxc *::after { box-sizing: border-box; }
.mxc[dir="rtl"] { font-family: var(--site-font-ar, var(--site-font, inherit)); }
/* the cookie card sits at the bottom: lift the chat while it is shown */
body:has(.mx-consent.is-in) .mxc { bottom: 150px; }

/* launcher = a small 3D-shaded robot in the page accent that floats, blinks and waves (Ali 2026-11-15) */
.mxc-launch { position: relative; width: 86px; height: 94px; padding: 0; border: 0; border-radius: 24px; background: none; cursor: pointer;
  display: block; transition: transform .25s cubic-bezier(.2,.75,.1,1); }
.mxc-launch:hover { transform: translateY(-3px) scale(1.04); }
.mxc-robot { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 10px 14px rgba(4,12,24,.35)); }
.mxc-shadow { fill: rgba(4,12,24,.32); transform-origin: 60px 126px; animation: mxc-shadow 3.4s ease-in-out infinite; }
.mxc-bot { animation: mxc-bob 3.4s ease-in-out infinite; }
.mxc-arm { transform-origin: 92px 84px; }
.mxc-launch.is-waving .mxc-arm { animation: mxc-wave 1.6s ease-in-out 1; }
.mxc-eyes { transform-origin: 60px 48px; animation: mxc-blink 4.6s infinite; }
.mxc-antenna { animation: mxc-pulse 2.2s ease-in-out infinite; }
@keyframes mxc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes mxc-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .7; } }
@keyframes mxc-wave { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-32deg); } 30% { transform: rotate(14deg); }
  45% { transform: rotate(-32deg); } 60% { transform: rotate(14deg); } 78% { transform: rotate(-10deg); } }
@keyframes mxc-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes mxc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.mxc.is-open .mxc-launch, .mxc.is-open .mxc-teaser { display: none; }

.mxc-teaser { position: absolute; bottom: 102px; inset-inline-end: 0; width: max-content; max-width: min(280px, calc(100vw - 40px));
  padding: 12px 38px 12px 14px; border-radius: 16px; background: var(--mxc-bg); border: 1px solid var(--mxc-line);
  box-shadow: 0 14px 34px rgba(4,12,24,.4); font-size: .92rem; line-height: 1.55; cursor: pointer; text-align: start;
  color: var(--mxc-text); opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.mxc[dir="rtl"] .mxc-teaser { padding: 12px 14px 12px 38px; }
.mxc-teaser.is-in { opacity: 1; transform: none; }
.mxc-teaser[hidden] { display: none; }
.mxc-teaser b { color: var(--mxc-accent); }
.mxc-teaser-x { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent;
  color: var(--mxc-sub); font-size: 18px; line-height: 1; cursor: pointer; }

.mxc-panel { position: absolute; bottom: 0; inset-inline-end: 0; width: 384px; height: min(620px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--mxc-bg); border: 1px solid var(--mxc-line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(4,12,24,.55); transform-origin: bottom right; animation: mxc-in .32s cubic-bezier(.2,.75,.1,1); }
.mxc[dir="rtl"] .mxc-panel { transform-origin: bottom left; }
.mxc-panel[hidden] { display: none; }
@keyframes mxc-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.mxc-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--mxc-line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent); }
.mxc-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--mxc-accent);
  color: var(--mxc-ink); font-weight: 800; font-size: 1.05rem; }
.mxc-who { flex: 1; min-width: 0; }
.mxc-name { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; color: #fff; }
.mxc-name span { font: 700 11px/1 var(--site-font-en, sans-serif); padding: 3px 6px; margin-inline-start: 6px; border-radius: 6px;
  background: rgba(255,255,255,.1); color: var(--mxc-accent); vertical-align: 2px; letter-spacing: .04em; }
.mxc-role { margin: 2px 0 0; font-size: .8rem; color: var(--mxc-sub); line-height: 1.4; }
.mxc-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: transparent; color: var(--mxc-sub); cursor: pointer;
  display: grid; place-items: center; }
.mxc-icon:hover { background: rgba(255,255,255,.08); color: #fff; }
.mxc-icon svg { width: 20px; height: 20px; }

.mxc-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth;
  overscroll-behavior: contain; }
.mxc-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: .94rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.mxc-msg.bot { align-self: flex-start; background: var(--mxc-bg2); color: var(--mxc-text); border-end-start-radius: 6px; }
.mxc-msg.me { align-self: flex-end; background: var(--mxc-accent); color: var(--mxc-ink); border-end-end-radius: 6px; font-weight: 500; }
.mxc-msg.note { align-self: center; max-width: 100%; background: transparent; color: var(--mxc-sub); font-size: .82rem; text-align: center; padding: 4px 8px; }
.mxc-typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 13px 14px; border-radius: 16px; background: var(--mxc-bg2); }
.mxc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--mxc-sub); animation: mxc-dot 1.2s infinite ease-in-out; }
.mxc-typing i:nth-child(2) { animation-delay: .15s; } .mxc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes mxc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.mxc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 4px; }
.mxc-chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--mxc-accent) 55%, transparent);
  background: transparent; color: var(--mxc-text); font: inherit; font-size: .85rem; cursor: pointer; text-align: start; }
.mxc-chip:hover { background: color-mix(in srgb, var(--mxc-accent) 18%, transparent); }

.mxc-card { align-self: stretch; background: var(--mxc-bg2); border: 1px solid color-mix(in srgb, var(--mxc-accent) 45%, transparent);
  border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.mxc-card h3 { margin: 0; font-size: .95rem; color: #fff; }
.mxc-card label { display: grid; gap: 4px; font-size: .82rem; color: var(--mxc-sub); }
.mxc-card input[type="text"], .mxc-card input[type="tel"] { min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.22);
  background: #0a1830; color: #fff; font: inherit; font-size: .95rem; }
.mxc-card input[type="tel"] { direction: ltr; text-align: start; }
.mxc[dir="rtl"] .mxc-card input[type="tel"] { text-align: right; }
.mxc-card .mxc-consent { grid-template-columns: auto 1fr; align-items: start; gap: 8px; line-height: 1.6; }
.mxc-card .mxc-consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--mxc-accent); }
.mxc-card a { color: var(--mxc-accent); }
.mxc-card .mxc-err { margin: 0; color: #ffb4a6; font-size: .82rem; }
.mxc-btn { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--mxc-accent); color: var(--mxc-ink);
  font: inherit; font-weight: 700; cursor: pointer; }
.mxc-btn:disabled { opacity: .6; cursor: progress; }
.mxc-wa { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28); color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; align-self: flex-start; }
.mxc-wa:hover { background: rgba(255,255,255,.08); }
.mxc-wa svg { width: 18px; height: 18px; }

.mxc-foot { border-top: 1px solid var(--mxc-line); padding: 10px 12px 8px; }
.mxc-form { display: flex; align-items: flex-end; gap: 8px; }
.mxc-form textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2);
  background: #0a1830; color: #fff; font: inherit; font-size: .95rem; line-height: 1.5; }
.mxc-form textarea::placeholder { color: #9fb0c6; }
.mxc-form textarea:disabled { opacity: .55; }
.mxc-send { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--mxc-accent); color: var(--mxc-ink); cursor: pointer;
  display: grid; place-items: center; }
.mxc-send:disabled { opacity: .45; cursor: default; }
.mxc-send svg { width: 20px; height: 20px; }
.mxc[dir="rtl"] .mxc-send svg { transform: scaleX(-1); }
.mxc-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: .74rem; color: #a9b9cd; line-height: 1.5; }
.mxc-meta a, .mxc-meta button { color: #c9d5e4; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.mxc-count.is-near { color: #ffcf8a; }

.mxc button:focus-visible, .mxc a:focus-visible, .mxc textarea:focus-visible, .mxc input:focus-visible {
  outline: 3px solid #fff; outline-offset: 2px; }
.mxc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
  .mxc { inset-inline-end: 12px; bottom: 12px; }
  .mxc-launch { width: 74px; height: 81px; }
  .mxc-teaser { bottom: 88px; max-width: calc(100vw - 24px); }
  .mxc.is-open { inset: 0; }
  .mxc-panel { position: fixed; inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .mxc-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .mxc-foot { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .mxc-form textarea { font-size: 16px; } /* no zoom on iOS */
}
@media (prefers-reduced-motion: reduce) {
  .mxc-panel { animation: none; } .mxc-launch, .mxc-teaser { transition: none; } .mxc-typing i { animation: none; opacity: .7; }
  .mxc-bot, .mxc-shadow, .mxc-eyes, .mxc-antenna, .mxc-launch.is-waving .mxc-arm { animation: none; }
  .mxc-log { scroll-behavior: auto; }
}

/* Cloudflare Turnstile: hidden; shown above the input only when Cloudflare asks this visitor to tick the box */
.mxc-ts { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mxc-ts.is-on { padding: 8px 0 4px; }
.mxc-ts-hint { margin: 0; color: var(--mxc-sub); font-size: .82rem; text-align: center; line-height: 1.5; }

/* open chat sits above the cookie banner (z 9990) so the input and the Cloudflare box are never covered;
   the banner is still there when the chat is closed */
.mxc.is-open { z-index: 9995; }
