/* Conexa — chat de vânzări pe site (T79, L2). Fără dependențe; culorile pe variabile ca să
   poată fi aliniate cu fiecare site. Nimic inline în HTML: CSP `script-src 'self'` pe conexaremote. */
.cx-chat{--cx-blue:#1d4ed8;--cx-blue-dark:#1e3a8a;--cx-bg:#ffffff;--cx-fg:#111827;--cx-muted:#6b7280;
  --cx-border:#e5e7eb;--cx-agent:#f3f4f6;--cx-me:#dbeafe;--cx-radius:14px;
  font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--cx-fg);
  position:fixed;right:20px;bottom:20px;z-index:2147483000}
.cx-chat *,.cx-chat *::before,.cx-chat *::after{box-sizing:border-box}
.cx-chat button{font:inherit;cursor:pointer}
.cx-chat button:focus-visible,.cx-chat textarea:focus-visible{outline:3px solid var(--cx-blue);outline-offset:2px}

/* butonul plutitor */
.cx-chat__open{display:inline-flex;align-items:center;gap:8px;border:0;border-radius:999px;
  background:var(--cx-blue);color:#fff;padding:12px 18px;font-weight:600;
  box-shadow:0 6px 20px rgba(0,0,0,.18)}
.cx-chat__open:hover{background:var(--cx-blue-dark)}
.cx-chat__open svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2}
.cx-chat[data-open="true"] .cx-chat__open{display:none}

/* fereastra */
.cx-chat__win{display:none;width:min(380px,calc(100vw - 40px));height:min(560px,calc(100vh - 40px));
  background:var(--cx-bg);border:1px solid var(--cx-border);border-radius:var(--cx-radius);
  box-shadow:0 12px 40px rgba(0,0,0,.22);flex-direction:column;overflow:hidden}
.cx-chat[data-open="true"] .cx-chat__win{display:flex}
.cx-chat__head{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:12px 14px;background:var(--cx-blue);color:#fff}
.cx-chat__title{font-weight:600;font-size:15px;margin:0}
.cx-chat__close{border:0;background:transparent;color:#fff;width:32px;height:32px;border-radius:8px;font-size:22px;line-height:1}
.cx-chat__close:hover{background:rgba(255,255,255,.18)}

/* mesaje */
.cx-chat__log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:#fafafa}
.cx-chat__msg{max-width:88%;padding:10px 12px;border-radius:12px;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere}
.cx-chat__msg--agent,.cx-chat__msg--om{align-self:flex-start;background:var(--cx-agent);border-bottom-left-radius:4px}
.cx-chat__msg--om{border-left:3px solid var(--cx-blue)}
.cx-chat__msg--eu{align-self:flex-end;background:var(--cx-me);border-bottom-right-radius:4px}
.cx-chat__msg--sistem{align-self:center;background:transparent;color:var(--cx-muted);font-size:13px;text-align:center;max-width:100%}
.cx-chat__msg--eroare{align-self:center;background:#fef2f2;color:#991b1b;font-size:13px;max-width:100%}
.cx-chat__msg a{color:var(--cx-blue-dark);text-decoration:underline}
.cx-chat__intro{border:1px solid var(--cx-border);background:#fff}
.cx-chat__intro p{margin:0 0 6px}
.cx-chat__intro p:last-child{margin:0}

/* acțiuni + formular */
.cx-chat__actions{display:flex;gap:8px;padding:8px 14px 0;flex-wrap:wrap}
.cx-chat__actions button{border:1px solid var(--cx-border);background:#fff;color:var(--cx-fg);border-radius:999px;padding:6px 12px;font-size:13px}
.cx-chat__actions button:hover{border-color:var(--cx-blue);color:var(--cx-blue-dark)}
.cx-chat__actions .cx-chat__stop{color:#991b1b}
.cx-chat__form{display:flex;gap:8px;padding:10px 14px 14px;border-top:1px solid var(--cx-border);background:#fff}
.cx-chat__input{flex:1;resize:none;min-height:44px;max-height:120px;padding:10px 12px;border:1px solid var(--cx-border);border-radius:10px;font:inherit}
.cx-chat__send{border:0;background:var(--cx-blue);color:#fff;border-radius:10px;padding:0 16px;font-weight:600}
.cx-chat__send:hover{background:var(--cx-blue-dark)}
.cx-chat__send[disabled],.cx-chat__input[disabled]{opacity:.55;cursor:not-allowed}
.cx-chat__status{padding:0 14px 8px;font-size:12px;color:var(--cx-muted);min-height:16px}
.cx-chat[data-closed="true"] .cx-chat__form,.cx-chat[data-closed="true"] .cx-chat__actions{display:none}
.cx-chat__restart{display:none;margin:0 14px 14px;border:1px solid var(--cx-border);background:#fff;border-radius:10px;padding:10px;font-weight:600}
.cx-chat[data-closed="true"] .cx-chat__restart{display:block}

/* ecran mic */
@media (max-width:480px){
  .cx-chat{right:10px;bottom:10px;left:10px}
  .cx-chat__win{width:100%;height:min(80vh,calc(100vh - 20px))}
  .cx-chat__open{margin-left:auto;display:inline-flex}
  .cx-chat{display:flex;justify-content:flex-end}
}
/* ecran îngust, chat închis (cr-3, 15.09.2026): pastila „Chat with us” de 149×46 și containerul
   întins pe toată lățimea acopereau butoane și text. Rămâne doar iconița rotundă de 56×56
   (textul rămâne numele accesibil al butonului), iar subsolul primește loc dedesubt ca
   ultimul rând de linkuri să nu stea sub ea. */
@media (max-width:600px){
  .cx-chat[data-open="false"]{left:auto;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .cx-chat .cx-chat__open{width:56px;height:56px;padding:0;gap:0;justify-content:center;font-size:0;line-height:0}
  .cx-chat .cx-chat__open svg{width:24px;height:24px}
  .site-footer{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
}
@media (prefers-reduced-motion:no-preference){
  .cx-chat__win{animation:cx-in .18s ease-out}
  @keyframes cx-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
}
