/* /css/chat-widget.css */
:root{
  --ta-chat-z: 9999;
  --ta-chat-bg: #0b1220;
  --ta-chat-card: #0f1b33;
  --ta-chat-border: rgba(255,255,255,.10);
  --ta-chat-text: rgba(255,255,255,.92);
  --ta-chat-muted: rgba(255,255,255,.65);
  --ta-chat-accent: #F7CB2D;
  --ta-chat-shadow: 0 18px 60px rgba(0,0,0,.45);
  --ta-chat-radius: 18px;
  --ta-chat-font: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.ta-chat{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--ta-chat-z);
  font-family: var(--ta-chat-font);
}

/* overlay (mobile) */
.ta-chat__overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: calc(var(--ta-chat-z) - 1);
}
.ta-chat__overlay.is-open{
  opacity: 1;
  pointer-events: auto;
}

/* launcher */
.ta-chat__launcher{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  color: #09121f;
  background: linear-gradient(135deg, var(--ta-chat-accent), #ffdf78);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transform: translateZ(0);
}
.ta-chat__launcher:active{ transform: scale(.98); }
.ta-chat__launcherIcon{
  width: 18px; height: 18px; display: inline-block;
}
.ta-chat__launcherText{
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .2px;
}

.ta-chat__badge{
  display: none; /* do futuro: unread */
  min-width: 18px; height: 18px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 12px;
  align-items: center;
  justify-content: center;
}

/* panel */
.ta-chat__panel{
  position: fixed;
  right: 16px;
  bottom: 76px;
  width: min(392px, calc(100vw - 32px));
  height: 520px;
  background: linear-gradient(180deg, var(--ta-chat-bg), #070c16);
  border: 1px solid var(--ta-chat-border);
  border-radius: var(--ta-chat-radius);
  box-shadow: var(--ta-chat-shadow);
  overflow: hidden;

  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.ta-chat__panel.is-open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ta-chat__header{
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--ta-chat-border);
}
.ta-chat__titleWrap{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ta-chat__title{
  color: var(--ta-chat-text);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.1;
}
.ta-chat__sub{
  color: var(--ta-chat-muted);
  font-size: 12px;
  line-height: 1.1;
}

.ta-chat__headerBtns{
  display: flex;
  gap: 8px;
}
.ta-chat__iconBtn{
  width: 34px; height: 34px;
  border-radius: 12px;
  border: 1px solid var(--ta-chat-border);
  background: rgba(255,255,255,.06);
  color: var(--ta-chat-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ta-chat__iconBtn:active{ transform: scale(.98); }
.ta-chat__icon{
  width: 18px; height: 18px; display: inline-block;
}

/* body messages */
.ta-chat__body{
  height: calc(100% - 58px - 64px);
  padding: 12px;
  overflow: auto;
}
.ta-chat__system{
  background: rgba(247,203,45,.14);
  border: 1px solid rgba(247,203,45,.25);
  color: rgba(255,255,255,.88);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.35;
}

/* composer */
.ta-chat__composer{
  height: 64px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--ta-chat-border);
  background: rgba(255,255,255,.03);
}
.ta-chat__input{
  flex: 1;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--ta-chat-border);
  background: rgba(0,0,0,.25);
  color: var(--ta-chat-text);
  padding: 0 12px;
  outline: none;
  font-size: 14px;
}
.ta-chat__input::placeholder{ color: rgba(255,255,255,.45); }

.ta-chat__send{
  width: 44px; height: 44px;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ta-chat-accent), #ffdf78);
  color: #09121f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0,0,0,.35);
}
.ta-chat__send:active{ transform: scale(.98); }

/* mobile: vira “quase full” */
@media (max-width: 576px){
  .ta-chat{ right: 12px; bottom: 12px; }
  .ta-chat__panel{
    right: 12px;
    left: 12px;
    width: auto;
    height: min(70vh, 560px);
    bottom: 70px;
  }
}

.ta-chat__msgRow{ display:flex; margin:8px 0; }
.ta-chat__msgRow--client{ justify-content:flex-end; }
.ta-chat__msgRow--admin{ justify-content:flex-start; }

.ta-chat__msgBubble{
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--ta-chat-border);
  line-height: 1.35;
  font-size: 14px;
}
.ta-chat__msgBubble--client{
  background: rgba(247,203,45,.18);
  border-color: rgba(247,203,45,.25);
  color: var(--ta-chat-text);
}
.ta-chat__msgBubble--admin{
  background: rgba(255,255,255,.06);
  color: var(--ta-chat-text);
}
