/* The Mamar assistant — launcher + chat window. Uses the site's tokens (site.css :root), so it follows light and dark. */

.mc-launch{ position:fixed; z-index:950; bottom:calc(18px + env(safe-area-inset-bottom)); left:18px; width:58px; height:58px; padding:0;
  display:grid; place-items:center; border:1px solid var(--line-2); border-radius:50%; cursor:pointer;
  background:radial-gradient(circle at 50% 35%, var(--surface-3), var(--surface)); color:var(--ink);
  box-shadow:0 18px 40px -14px rgba(0,0,0,.85);
  transition:transform .45s var(--e), opacity .3s, border-color .3s, box-shadow .3s; }
.mc-launch__bot{ font-size:30px; line-height:1; font-family:'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif;
  transform:translateY(1px); transition:transform .4s var(--e2); }
.mc-launch:hover{ border-color:rgba(255,74,43,.7); }
.mc-launch:hover .mc-launch__bot{ transform:translateY(-1px) rotate(-8deg) scale(1.08); }
.mc-launch:focus-visible{ outline:2px solid var(--red); outline-offset:3px; }
.mc-launch.off{ opacity:0; transform:translateY(16px) scale(.9); pointer-events:none; }
/* the glow: a red ring around the button and two rings pulsing outward */
.mc-launch.glow{ border-color:var(--red); box-shadow:0 0 0 2px rgba(255,74,43,.35), 0 0 26px rgba(255,74,43,.55), 0 18px 40px -14px rgba(0,0,0,.85);
  animation:mcBreath 2.4s ease-in-out infinite; }
.mc-launch.glow::before, .mc-launch.glow::after{ content:''; position:absolute; inset:-2px; border-radius:50%; border:2px solid var(--red);
  pointer-events:none; animation:mcRing 2.4s cubic-bezier(.2,.7,.2,1) infinite; }
.mc-launch.glow::after{ animation-delay:1.2s; }
@keyframes mcRing{ 0%{ transform:scale(1); opacity:.85; } 100%{ transform:scale(1.85); opacity:0; } }
@keyframes mcBreath{ 0%,100%{ box-shadow:0 0 0 2px rgba(255,74,43,.35), 0 0 18px rgba(255,74,43,.4), 0 18px 40px -14px rgba(0,0,0,.85); }
  50%{ box-shadow:0 0 0 3px rgba(255,74,43,.55), 0 0 34px rgba(255,74,43,.75), 0 18px 40px -14px rgba(0,0,0,.85); } }

.mc{ position:fixed; z-index:960; bottom:calc(18px + env(safe-area-inset-bottom)); left:18px; width:392px; height:min(640px, calc(100dvh - 44px));
  display:flex; flex-direction:column; border:1px solid var(--line-2); border-radius:26px; overflow:hidden;
  background:var(--card); color:var(--ink); font-family:var(--ff-b);
  box-shadow:0 40px 90px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.03) inset;
  opacity:0; transform:translateY(18px) scale(.97); transform-origin:0 100%;
  transition:opacity .3s var(--e), transform .45s var(--e); }
.mc.on{ opacity:1; transform:none; }
.mc[hidden]{ display:none; }
.mc::before{ content:''; position:absolute; inset:0 0 auto; height:3px; background:var(--red); }

.mc__hd{ display:flex; align-items:center; gap:12px; padding:20px 16px 16px 18px; border-bottom:1px solid var(--line); }
.mc__mk{ flex:0 0 40px; height:40px; border-radius:13px; display:grid; place-items:center; background:var(--bg); border:1px solid var(--line); }
.mc__mk svg{ width:22px; height:22px; fill:none; stroke:var(--red); stroke-width:2.8; stroke-linecap:round; stroke-linejoin:round; }
.mc__ti{ flex:1; min-width:0; }
.mc__ti b{ display:block; font:400 24px/1.05 var(--ff-d); letter-spacing:-.01em; }
.mc__ti small{ display:block; margin-top:4px; font:500 10.5px/1.2 var(--ff-m); letter-spacing:.12em; text-transform:uppercase; color:var(--mut); }
html[lang="ar"] .mc__ti b{ font-size:19px; font-weight:600; line-height:1.4; }
html[lang="ar"] .mc__ti small{ font-family:var(--ff-b); letter-spacing:0; text-transform:none; font-size:11.5px; }
.mc__reset{ border:1px solid var(--line-2); background:none; color:var(--ink-2); border-radius:100px; padding:7px 11px; font:500 12px/1 var(--ff-b); cursor:pointer; white-space:nowrap; }
.mc__reset:hover{ color:var(--ink); border-color:var(--ink-2); }
.mc__x{ flex:0 0 38px; height:38px; border-radius:50%; border:1px solid var(--line); background:none; cursor:pointer; display:grid; place-items:center; }
.mc__x svg{ width:16px; height:16px; stroke:var(--ink-2); stroke-width:2; stroke-linecap:round; }
.mc__x:hover{ border-color:var(--line-2); } .mc__x:hover svg{ stroke:var(--ink); }

.mc__log{ flex:1; overflow-y:auto; padding:18px 16px 8px; display:flex; flex-direction:column; gap:10px; scroll-behavior:smooth; overscroll-behavior:contain; }
.mc__log::-webkit-scrollbar{ width:6px; } .mc__log::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:3px; }
.mc__b{ max-width:86%; padding:11px 14px; border-radius:18px; font-size:14.5px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
html[lang="ar"] .mc__b{ font-size:14px; line-height:1.85; }
.mc__b--bot{ align-self:flex-start; background:var(--surface-3); border:1px solid var(--line); border-end-start-radius:6px; color:var(--ink); }
.mc__b--me{ align-self:flex-end; background:var(--red); color:#fff; border-end-end-radius:6px; }
.mc__b a{ color:inherit; text-decoration:underline; text-decoration-color:rgba(255,74,43,.7); text-underline-offset:3px; }
.mc__b--me a{ text-decoration-color:rgba(255,255,255,.7); }
.mc__b--typing{ display:flex; gap:5px; align-items:center; padding:15px 16px; }
.mc__b--typing i{ width:7px; height:7px; border-radius:50%; background:var(--mut); animation:mcDot 1.1s infinite ease-in-out; }
.mc__b--typing i:nth-child(2){ animation-delay:.15s; } .mc__b--typing i:nth-child(3){ animation-delay:.3s; }
@keyframes mcDot{ 0%,80%,100%{ opacity:.3; transform:translateY(0); } 40%{ opacity:1; transform:translateY(-3px); } }

.mc__chips{ display:flex; flex-wrap:wrap; gap:7px; padding:4px 16px 12px; }
.mc__chips[hidden]{ display:none; }
.mc__chip{ border:1px solid var(--line-2); background:none; color:var(--ink); border-radius:100px; padding:8px 12px; font:500 13px/1.2 var(--ff-b); cursor:pointer; transition:border-color .2s, background .2s; }
.mc__chip:hover{ border-color:var(--red); background:rgba(255,74,43,.08); }

.mc__in{ display:flex; align-items:flex-end; gap:8px; margin:0 12px; padding:6px 6px 6px 14px; border:1px solid var(--line-2); border-radius:22px; background:var(--surface); transition:border-color .2s; }
.mc[dir="rtl"] .mc__in{ padding:6px 14px 6px 6px; }
.mc__in:focus-within{ border-color:rgba(255,74,43,.7); }
.mc__in textarea{ flex:1; resize:none; border:0; outline:0; background:none; color:var(--ink); font:400 15px/1.45 var(--ff-b); padding:8px 0; max-height:120px; }
.mc__in textarea::placeholder{ color:var(--mut); }
.mc__send{ flex:0 0 40px; height:40px; border:0; border-radius:50%; background:var(--red); cursor:pointer; display:grid; place-items:center; transition:opacity .2s, transform .2s; }
.mc__send svg{ width:18px; height:18px; fill:none; stroke:#fff; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.mc[dir="rtl"] .mc__send svg{ transform:scaleX(-1); }
.mc__send:disabled{ opacity:.45; cursor:default; }
.mc__send:not(:disabled):hover{ transform:scale(1.05); }
.mc__fine{ margin:0; padding:10px 18px 14px; font-size:11.5px; line-height:1.4; color:var(--mut); }
.mc__fine a{ color:var(--ink-2); text-decoration:underline; text-underline-offset:3px; }

/* phones: the launcher sits above the WhatsApp bar; the window becomes a full-height sheet */
@media (max-width:900px){
  .mc-launch__bot{ font-size:28px; }
}
@media (max-width:560px){
  .mc{ inset:0; width:auto; height:100dvh; border-radius:0; border:0; transform:translateY(40px); }
  .mc__in textarea{ font-size:16px; }                 /* no iOS zoom-on-focus */
  html.mc-open, html.mc-open body{ overflow:hidden; }
}
@media (prefers-reduced-motion:reduce){
  .mc, .mc-launch{ transition:none; } .mc__b--typing i{ animation:none; opacity:.6; }
  .mc-launch.glow{ animation:none; } .mc-launch.glow::before, .mc-launch.glow::after{ animation:none; opacity:0; }
}

/* "talk to a person": the footer link and the form card in the conversation */
.mc__fine em{ font-style:normal; }
.mc__leave{ border:0; background:none; padding:0; color:var(--ink-2); font:inherit; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.mc__leave:hover, .mc__fine a:hover{ color:var(--ink); }
.mc__form{ align-self:stretch; display:flex; flex-direction:column; gap:10px; padding:16px; border-radius:18px;
  background:var(--surface-2); border:1px solid var(--acc-line); box-shadow:0 0 0 4px var(--acc-soft); }
.mc__ft{ margin:0; font:400 22px/1.1 var(--ff-d); color:var(--ink); }
html[lang="ar"] .mc__ft{ font-size:17px; font-weight:600; line-height:1.5; }
.mc__fs{ margin:-4px 0 2px; font-size:12.5px; color:var(--ink-2); }
.mc__form label{ display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:500; color:var(--ink-2); }
.mc__form input, .mc__form textarea{ width:100%; box-sizing:border-box; border:1px solid var(--line-2); border-radius:12px; background:var(--surface);
  color:var(--ink); font:400 15px/1.4 var(--ff-b); padding:10px 12px; outline:0; resize:none; transition:border-color .2s; }
.mc__form input[dir="ltr"]{ text-align:left; font-family:var(--ff-m); font-size:14.5px; }
.mc__form input:focus, .mc__form textarea:focus{ border-color:rgba(255,74,43,.75); }
.mc__form input::placeholder, .mc__form textarea::placeholder{ color:var(--mut); }
.mc__hp{ position:absolute !important; left:-9999px; width:1px; height:1px; opacity:0; }
.mc__ferr{ margin:0; font-size:12.5px; line-height:1.5; color:#FF8A73; }
.mc__ferr:empty{ display:none; }
.mc__ferr a{ color:inherit; }
.mc__fb{ display:flex; gap:8px; flex-wrap:wrap; }
.mc__fsend{ flex:1; min-width:150px; height:44px; border:0; border-radius:100px; background:var(--red); color:#fff; font:600 14.5px/1 var(--ff-b); cursor:pointer; }
.mc__fsend:disabled{ opacity:.55; cursor:default; }
.mc__fx{ height:44px; padding:0 16px; border:1px solid var(--line-2); border-radius:100px; background:none; color:var(--ink-2); font:500 13.5px/1 var(--ff-b); cursor:pointer; }
.mc__ffine{ margin:0; font-size:11.5px; color:var(--mut); }
.mc__b--ok{ border-color:rgba(61,220,151,.45); background:rgba(61,220,151,.08); }
@media (max-width:560px){ .mc__form input, .mc__form textarea{ font-size:16px; } }
