/* Assistente PersonAligner — padrão LeiUP, cores do projeto */
.pa-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2100;
  width: 59px;
  height: 59px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 12px 30px rgba(183, 54, 159, 0.32);
  animation: pulse 3s infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pa-chat-fab:hover {
  transform: scale(1.04);
  box-shadow: 0 14px 34px rgba(183, 54, 159, 0.4);
}

.pa-chat-fab:focus-visible {
  outline: 2px solid var(--cyan, #27c5da);
  outline-offset: 2px;
}

.pa-chat-fab svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.pa-chat-fab[aria-expanded='true'] {
  animation: none;
  opacity: 0.94;
}

.pa-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 2090;
  width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(118, 38, 199, 0.12);
  box-shadow: 0 18px 48px rgba(61, 34, 91, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.pa-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.pa-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--gradient);
  color: #fff;
}

.pa-chat-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pa-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}

.pa-chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pa-chat-title {
  min-width: 0;
}

.pa-chat-title strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  font-family: Montserrat, sans-serif;
  line-height: 1.2;
}

.pa-chat-title small {
  display: block;
  font-size: 10px;
  opacity: 0.9;
  margin-top: 2px;
}

.pa-chat-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pa-chat-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.pa-chat-body {
  flex: 1;
  min-height: 200px;
  max-height: 340px;
  overflow-y: auto;
  padding: 12px;
  background: #faf7ff;
}

.pa-chat-msg {
  max-width: 92%;
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.pa-chat-msg.bot {
  background: #fff;
  color: var(--text, #2a2d4d);
  border: 1px solid rgba(118, 38, 199, 0.1);
  border-bottom-left-radius: 4px;
  text-align: justify;
  white-space: normal;
}

.pa-chat-msg.bot strong {
  font-weight: 700;
  color: inherit;
}

.pa-chat-msg.user {
  margin-left: auto;
  background: var(--purple, #7626c7);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.pa-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.pa-chat-quick button {
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid rgba(118, 38, 199, 0.18);
  background: #fff;
  color: var(--purple, #7626c7);
  cursor: pointer;
}

.pa-chat-quick button:hover {
  background: var(--soft-purple, #f7f1ff);
}

.pa-chat-quick.is-hidden {
  display: none;
}

.pa-chat-typing {
  display: none;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.pa-chat-typing.is-visible {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pa-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, #74778c);
  animation: pa-chat-dot 1.2s infinite ease-in-out;
}

.pa-chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.pa-chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pa-chat-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.pa-chat-footer {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(118, 38, 199, 0.1);
  background: #fff;
}

.pa-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pa-chat-input-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid rgba(118, 38, 199, 0.16);
  border-radius: 10px;
}

.pa-chat-input-row input:focus {
  outline: none;
  border-color: var(--purple, #7626c7);
  box-shadow: 0 0 0 2px rgba(118, 38, 199, 0.12);
}

.pa-chat-input-row input:disabled {
  opacity: 0.65;
  background: #f5edff;
}

.pa-chat-send {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--purple, #7626c7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pa-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pa-chat-send svg {
  width: 16px;
  height: 16px;
}

.pa-chat-note {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted, #74778c);
  text-align: center;
}

@media (max-width: 480px) {
  .pa-chat-fab {
    right: 14px;
    bottom: 14px;
    width: 52px;
    height: 52px;
  }

  .pa-chat-panel {
    right: 14px;
    bottom: 76px;
    width: calc(100vw - 28px);
  }
}
