/* 4Design AI Sales Chat — v1.5
 * Matches the 4Design theme: deep teal, cream, mint and purple.
 * Every class is prefixed "fdc-" so it never collides with theme styles.
 */
.fdc{
  --fdc-deep:#12343b;
  --fdc-teal:#1f5257;
  --fdc-teal-2:#2a6268;
  --fdc-mint:#8fc9c4;
  --fdc-mint-soft:#e3f1ef;
  --fdc-purple:#7b5fae;
  --fdc-purple-2:#6a4f9c;
  --fdc-cream:#faf7f2;
  --fdc-ink:#163a40;
  --fdc-muted:#6b7a7d;
  --fdc-line:#e9e2d8;
  --fdc-wa:#25d366;
  --fdc-serif:"Cormorant Garamond",Georgia,serif;
  position:fixed;
  bottom:24px;
  inset-inline-end:24px;
  z-index:2147483000;
  font-family:"Poppins",system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--fdc-ink);
  line-height:1.55;
  font-size:15px;
  -webkit-font-smoothing:antialiased;
}
.fdc.fdc-rtl{font-family:"Tajawal","Noto Kufi Arabic",system-ui,sans-serif;--fdc-serif:"Noto Kufi Arabic","Tajawal",serif}
.fdc *,.fdc *::before,.fdc *::after{box-sizing:border-box;margin:0}
.fdc button{font:inherit;cursor:pointer}
.fdc svg{display:block}

/* ---------- Launcher ---------- */
.fdc-launcher{
  position:relative;
  width:64px;height:64px;
  border:1px solid rgba(143,201,196,.55);
  border-radius:50%;
  background:radial-gradient(circle at 30% 25%,var(--fdc-teal-2),var(--fdc-deep) 70%);
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 12px 30px rgba(18,52,59,.35),0 0 0 6px rgba(143,201,196,.12);
  transition:transform .3s cubic-bezier(.2,.7,.2,1),box-shadow .3s;
  margin-inline-start:auto;
  padding:0;
}
.fdc-launcher:hover{transform:translateY(-3px);box-shadow:0 16px 36px rgba(18,52,59,.4),0 0 0 8px rgba(143,201,196,.16)}
.fdc-launcher:focus-visible{outline:2px solid var(--fdc-purple);outline-offset:4px}
.fdc-launcher .fdc-ico{position:absolute;width:28px;height:28px;transition:opacity .25s,transform .35s cubic-bezier(.2,.7,.2,1)}
.fdc-launcher .fdc-ico-open{color:var(--fdc-mint)}
.fdc-launcher .fdc-ico-close{opacity:0;transform:rotate(-90deg) scale(.6);width:22px;height:22px}
.fdc-open .fdc-launcher .fdc-ico-open{opacity:0;transform:rotate(90deg) scale(.6)}
.fdc-open .fdc-launcher .fdc-ico-close{opacity:1;transform:none}
.fdc-badge{
  position:absolute;top:-2px;inset-inline-end:-2px;
  width:18px;height:18px;border-radius:50%;
  background:var(--fdc-purple);border:2px solid #fff;
  transform:scale(0);transition:transform .3s cubic-bezier(.3,1.6,.5,1);
}
.fdc-nudge:not(.fdc-open) .fdc-badge{transform:scale(1)}

.fdc-tip{
  position:absolute;
  inset-inline-end:calc(100% + 14px);
  top:50%;
  transform:translateY(-50%);
  white-space:nowrap;
  background:#fff;
  color:var(--fdc-ink);
  border:1px solid var(--fdc-line);
  padding:10px 16px;
  border-radius:999px;
  font-size:14px;font-weight:600;
  box-shadow:0 10px 26px rgba(18,52,59,.14);
  opacity:0;pointer-events:none;
  transition:opacity .3s,transform .3s;
}
.fdc-launcher:hover .fdc-tip,.fdc-nudge:not(.fdc-open) .fdc-tip{opacity:1}
.fdc-open .fdc-tip{display:none}

/* ---------- Panel ---------- */
.fdc-panel{
  position:absolute;
  inset-inline-end:0;
  bottom:82px;
  width:392px;
  height:min(640px,calc(100vh - 130px));
  display:flex;flex-direction:column;
  background:var(--fdc-cream);
  border:1px solid rgba(18,52,59,.08);
  border-radius:24px;
  box-shadow:0 30px 70px rgba(18,52,59,.28),0 6px 18px rgba(18,52,59,.10);
  overflow:hidden;
  opacity:0;
  transform:translateY(18px) scale(.97);
  transform-origin:bottom right;
  visibility:hidden;pointer-events:none;
  transition:opacity .3s ease,transform .35s cubic-bezier(.2,.8,.2,1),visibility 0s linear .35s;
}
.fdc-rtl .fdc-panel{transform-origin:bottom left}
.fdc-open .fdc-panel{opacity:1;transform:none;visibility:visible;pointer-events:auto;transition:opacity .3s ease,transform .35s cubic-bezier(.2,.8,.2,1)}

/* Header */
.fdc-head{
  position:relative;
  display:flex;align-items:center;gap:12px;
  padding:18px 14px 18px 18px;
  color:#fff;
  background:
    radial-gradient(260px 160px at 100% 0%,rgba(123,95,174,.55),transparent 70%),
    radial-gradient(240px 180px at 0% 120%,rgba(42,98,104,.9),transparent 70%),
    var(--fdc-deep);
  overflow:hidden;
}
.fdc-rtl .fdc-head{padding:18px 18px 18px 14px}
.fdc-head::after{
  content:"";position:absolute;inset:auto -10% -40px -10%;height:80px;
  background:repeating-radial-gradient(ellipse at 50% 100%,transparent 0 10px,rgba(143,201,196,.10) 10px 11px);
  pointer-events:none;
}
.fdc-avatar{
  position:relative;
  width:46px;height:46px;flex:none;
  border-radius:50%;
  background:radial-gradient(circle,#2b6a6d,#1d4f53 70%);
  border:1px solid rgba(143,201,196,.55);
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.fdc-avatar img{width:80%;height:80%;object-fit:contain;mix-blend-mode:screen}
.fdc-avatar-dot{
  position:absolute;bottom:1px;inset-inline-end:1px;
  width:11px;height:11px;border-radius:50%;
  background:#3ddc97;border:2px solid var(--fdc-deep);
}
.fdc-htext{flex:1;min-width:0;position:relative;z-index:1}
.fdc-title{font-family:var(--fdc-serif);font-size:22px;font-weight:600;line-height:1.15;color:#fff;letter-spacing:.01em}
.fdc-rtl .fdc-title{font-size:17px;font-weight:700}
.fdc-status{font-size:12.5px;color:var(--fdc-mint);margin-top:2px}
.fdc-iconbtn{
  position:relative;z-index:1;
  width:36px;height:36px;flex:none;
  border:0;border-radius:50%;
  background:transparent;color:rgba(255,255,255,.75);
  display:flex;align-items:center;justify-content:center;
  transition:background .2s,color .2s;
  padding:0;
}
.fdc-iconbtn svg{width:18px;height:18px}
.fdc-iconbtn:hover{background:rgba(255,255,255,.1);color:#fff}
.fdc-iconbtn:focus-visible{outline:2px solid var(--fdc-mint);outline-offset:1px}

/* Messages */
.fdc-log{
  flex:1;overflow-y:auto;
  padding:20px 16px 10px;
  display:flex;flex-direction:column;gap:12px;
  scrollbar-width:thin;scrollbar-color:rgba(31,82,87,.25) transparent;
  overscroll-behavior:contain;
}
.fdc-day{align-self:center;font-size:11.5px;color:var(--fdc-muted);background:#fff;border:1px solid var(--fdc-line);padding:3px 12px;border-radius:999px}
.fdc-row{display:flex;flex-direction:column;align-items:flex-start;gap:8px;animation:fdc-in .35s cubic-bezier(.2,.7,.2,1) both}
.fdc-user{align-items:flex-end}
@keyframes fdc-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.fdc-bubble{
  max-width:85%;
  padding:11px 15px;
  border-radius:18px;
  font-size:14.5px;
  white-space:pre-wrap;overflow-wrap:anywhere;
  unicode-bidi:plaintext;
}
.fdc-assistant .fdc-bubble{
  background:#fff;
  color:var(--fdc-ink);
  border:1px solid var(--fdc-line);
  border-end-start-radius:6px;
  box-shadow:0 2px 8px rgba(18,52,59,.04);
}
.fdc-user .fdc-bubble{
  background:var(--fdc-teal);
  color:#fff;
  border-end-end-radius:6px;
}
.fdc-typing{display:inline-flex;gap:5px;padding:15px 16px}
.fdc-typing span{width:7px;height:7px;border-radius:50%;background:var(--fdc-mint);animation:fdc-blink 1.2s infinite ease-in-out}
.fdc-typing span:nth-child(2){animation-delay:.15s;background:var(--fdc-teal-2)}
.fdc-typing span:nth-child(3){animation-delay:.3s;background:var(--fdc-purple)}
@keyframes fdc-blink{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

/* WhatsApp handoff */
.fdc-wa{
  display:inline-flex;align-items:center;gap:9px;
  padding:10px 18px;
  border-radius:999px;
  background:var(--fdc-wa);
  color:#fff!important;
  text-decoration:none!important;
  font-weight:600;font-size:14px;
  box-shadow:0 8px 18px rgba(37,211,102,.28);
  transition:transform .2s,box-shadow .2s;
}
.fdc-wa svg{width:18px;height:18px}
.fdc-wa:hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(37,211,102,.35)}

/* Contact card */
.fdc-lead{
  background:#fff;
  border:1px solid var(--fdc-line);
  border-radius:18px;
  padding:16px;
  box-shadow:0 10px 26px rgba(18,52,59,.08);
  display:flex;flex-direction:column;gap:10px;
  animation:fdc-in .4s cubic-bezier(.2,.7,.2,1) both;
}
.fdc-lead-top{display:flex;gap:12px;align-items:flex-start}
.fdc-lead-ic{
  width:38px;height:38px;flex:none;border-radius:50%;
  background:var(--fdc-mint-soft);color:var(--fdc-teal);
  display:flex;align-items:center;justify-content:center;
}
.fdc-lead-ic svg{width:20px;height:20px}
.fdc-lead-top strong{display:block;font-size:15px;color:var(--fdc-ink);margin-bottom:2px}
.fdc-lead-top p{font-size:13px;color:var(--fdc-muted);line-height:1.5}
.fdc-field{display:block}
.fdc-field span{display:block;font-size:12px;font-weight:600;color:var(--fdc-ink);margin-bottom:4px}
.fdc-field input{
  width:100%;
  border:1px solid var(--fdc-line);
  border-radius:12px;
  background:var(--fdc-cream);
  color:var(--fdc-ink);
  font:inherit;font-size:14.5px;
  padding:10px 12px;
  transition:border-color .2s,box-shadow .2s,background .2s;
}
.fdc-rtl .fdc-field input[dir="ltr"]{text-align:right}
.fdc-field input:focus{outline:0;border-color:var(--fdc-teal);background:#fff;box-shadow:0 0 0 3px rgba(31,82,87,.10)}
.fdc-lead-err{font-size:12.5px;color:#a33a3a}
.fdc-lead-err[hidden]{display:none}
.fdc-lead-actions{display:flex;gap:8px;margin-top:2px}
.fdc-lead-send{
  flex:1;border:0;border-radius:999px;
  background:var(--fdc-teal);color:#fff;
  padding:10px 16px;font-weight:600;font-size:14px;
  transition:background .2s,opacity .2s;
}
.fdc-lead-send:hover{background:var(--fdc-deep)}
.fdc-lead-send:disabled{opacity:.55;cursor:default}
.fdc-lead-skip{
  border:1px solid var(--fdc-line);border-radius:999px;
  background:transparent;color:var(--fdc-muted);
  padding:10px 16px;font-size:13.5px;
}
.fdc-lead-skip:hover{color:var(--fdc-ink);border-color:var(--fdc-muted)}
.fdc-lead-note{font-size:11px;color:var(--fdc-muted);line-height:1.5}

/* Contact form before the chat */
.fdc-gate{display:none}
.fdc-gated .fdc-gate{display:block;flex:1;overflow-y:auto;padding:18px 16px;overscroll-behavior:contain}
.fdc-gated .fdc-log,.fdc-gated .fdc-chips,.fdc-gated .fdc-compose,.fdc-gated .fdc-reset{display:none}
.fdc-lead-gate{box-shadow:none;border-color:transparent;background:transparent;padding:4px 2px;gap:12px}
.fdc-lead-gate .fdc-lead-top strong{font-size:17px}
.fdc-lead-gate .fdc-lead-top p{font-size:13.5px}
.fdc-lead-gate .fdc-field input{background:#fff;padding:11px 13px}
.fdc-lead-gate .fdc-lead-send{padding:12px 16px;font-size:15px}
.fdc-req{color:#b4533a;font-weight:700}

/* Quick replies */
.fdc-chips{display:flex;flex-wrap:wrap;gap:8px;padding:2px 16px 12px}
.fdc-chips[hidden]{display:none}
.fdc-chip{
  border:1px solid rgba(31,82,87,.35);
  background:#fff;
  color:var(--fdc-teal);
  padding:8px 14px;border-radius:999px;
  font-size:13px;font-weight:500;
  transition:background .2s,color .2s,border-color .2s;
}
.fdc-chip:hover{background:var(--fdc-teal);border-color:var(--fdc-teal);color:#fff}
.fdc-chip:focus-visible{outline:2px solid var(--fdc-purple);outline-offset:2px}

/* Composer */
.fdc-compose{padding:10px 12px 0;background:var(--fdc-cream);border-top:1px solid var(--fdc-line)}
.fdc-form{
  display:flex;align-items:flex-end;gap:8px;
  padding:6px 6px 6px 14px;
  background:#fff;
  border:1px solid var(--fdc-line);
  border-radius:22px;
  transition:border-color .2s,box-shadow .2s;
}
.fdc-rtl .fdc-form{padding:6px 14px 6px 6px}
.fdc-form:focus-within{border-color:var(--fdc-teal);box-shadow:0 0 0 3px rgba(31,82,87,.10)}
.fdc-input{
  flex:1;resize:none;border:0;outline:0;
  background:transparent;color:var(--fdc-ink);
  font:inherit;font-size:14.5px;line-height:1.45;
  padding:7px 0;max-height:120px;min-height:22px;
}
.fdc-input::placeholder{color:#97a3a5}
.fdc-send{
  width:38px;height:38px;flex:none;
  border:0;border-radius:50%;
  background:var(--fdc-purple);color:#fff;
  display:flex;align-items:center;justify-content:center;
  transition:background .2s,transform .2s,opacity .2s;
  padding:0;
}
.fdc-send svg{width:17px;height:17px}
.fdc-rtl .fdc-send svg{transform:scaleX(-1)}
.fdc-send:not(:disabled):hover{background:var(--fdc-purple-2);transform:scale(1.05)}
.fdc-send:disabled{opacity:.4;cursor:default}
.fdc-foot{display:flex;justify-content:center;align-items:center;gap:6px;font-size:11.5px;color:var(--fdc-muted);padding:9px 0 11px}
.fdc-foot a{color:var(--fdc-teal)!important;text-decoration:none!important;font-weight:600}
.fdc-foot a:hover{color:var(--fdc-purple)!important}

/* ---------- WhatsApp button (same style as the chat launcher) ---------- */
.fdc-has-wa{display:flex;flex-direction:column;align-items:flex-end;gap:14px}
.fdc-wa-btn{text-decoration:none!important;margin-inline-start:0;transition:transform .3s cubic-bezier(.2,.7,.2,1),box-shadow .3s,opacity .25s,visibility .25s}
.fdc-wa-btn .fdc-ico-wa{color:var(--fdc-mint);width:30px;height:30px}
.fdc-wa-btn:hover .fdc-tip{opacity:1}
.fdc-has-wa .fdc-panel{bottom:160px}
.fdc-has-wa.fdc-open .fdc-wa-btn{opacity:0;visibility:hidden;transform:scale(.6)}

/* Phones: wide sheet anchored just above the chat button */
@media (max-width:520px){
  .fdc{bottom:16px;inset-inline-end:16px}
  .fdc-has-wa{gap:12px}
  .fdc-wa-btn .fdc-ico-wa{width:27px;height:27px}
  .fdc-has-wa .fdc-panel{bottom:140px}
  .fdc-launcher{width:58px;height:58px}
  .fdc-panel{
    inset-inline-end:-8px;
    bottom:70px;
    width:calc(100vw - 16px);
    height:min(72vh,calc(100vh - 190px));
    height:min(72dvh,calc(100dvh - 190px));
    border-radius:22px;
  }
  .fdc-tip{display:none}
}

@media (prefers-reduced-motion:reduce){
  .fdc *,.fdc *::before,.fdc *::after{animation:none!important;transition:none!important}
}
