/* =========================================================
   FLUXY CHAT - COMPONENTE ISOLADO
========================================================= */

.fluxy-chat,
.fluxy-chat * {
  box-sizing: border-box;
}

.fluxy-chat {
  width: 100%;
  font-family: 'Inter', Arial, sans-serif;
}

.fluxy-chat__shell {
  width: 100%;
  max-width: 420px;
  height: 620px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.04) 100%);
  box-shadow:
    0 30px 80px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.fluxy-chat__top {
  display: flex;
  justify-content: center;
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
  border-bottom: 1px solid rgba(11,21,38,.06);
}

.fluxy-chat__avatar {
  width: 78px;
  height: 78px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}

.fluxy-chat__avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.fluxy-chat__header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 0 22px;
  text-align: center;
  background:linear-gradient(135deg,#6b9a63 0%,#5b8754 52%,#4c7147 100%);
}

.fluxy-chat__header p {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.fluxy-chat__slot {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
}

.fluxy-chat__container {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fcfdff 0%, #f5f8fc 100%);
}

.fluxy-chat__messages {
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(34, 200, 255, .06), transparent 24%),
    radial-gradient(circle at bottom left, rgba(154, 92, 255, .05), transparent 22%),
    linear-gradient(180deg, #f9fbfe 0%, #f3f7fb 100%);
}

.fluxy-chat__messages::-webkit-scrollbar {
  width: 8px;
}

.fluxy-chat__messages::-webkit-scrollbar-track {
  background: transparent;
}

.fluxy-chat__messages::-webkit-scrollbar-thumb {
  background: rgba(11, 21, 38, .14);
  border-radius: 999px;
}

.fluxy-chat__message {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  max-width: 82%;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 10px 24px rgba(11, 21, 38, .05);
  font-family: 'Inter', Arial, sans-serif;
}

.fluxy-chat__message--user {
  align-self: flex-end;
  background:linear-gradient(135deg,#6b9a63 0%,#5b8754 52%,#4c7147 100%);
  color: #ffffff;
  border-bottom-right-radius: 8px;
}

.fluxy-chat__message--bot {
  align-self: flex-start;
  background: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
  color: #0b1526;
  border: 1px solid rgba(11, 21, 38, .08);
  border-bottom-left-radius: 8px;
}

.fluxy-chat__message a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  width: auto;
  text-decoration: none;
}

.fluxy-chat__message--bot a {
  background:#00C504;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 211, 102, .20);
}

.fluxy-chat__message--bot a i {
  font-size: 16px;
  line-height: 1;
  margin: 0;
}

.fluxy-chat__message--typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.fluxy-chat__message--typing span,
.fluxy-chat__recording-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: block;
  animation: fluxyChatBlink 1s infinite ease-in-out;
}

.fluxy-chat__message--typing span {
  background: #2f8f57;
}

.fluxy-chat__recording-indicator span {
  background: #2f8f57;
}

.fluxy-chat__message--typing span:nth-child(2),
.fluxy-chat__recording-indicator span:nth-child(2) {
  animation-delay: .2s;
}

.fluxy-chat__message--typing span:nth-child(3),
.fluxy-chat__recording-indicator span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes fluxyChatBlink {
  0%, 100% {
    opacity: .25;
    transform: scale(.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.fluxy-chat__message--lead-form {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  line-height: normal;
  white-space: normal;
  box-shadow: none;
}

.fluxy-chat__message--lead-form br {
  display: none;
}

.fluxy-chat__lead-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fluxy-chat__lead-wrap p {
  margin: 0;
}

.fluxy-chat__lead-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.fluxy-chat__lead-group {
  width: 100%;
  margin: 0;
}

.fluxy-chat__lead-form input,
.fluxy-chat__lead-form select {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(11, 21, 38, .10);
  border-radius: 10px;
  outline: none;
  font-size: 13px;
  line-height: 1;
  color: #0b1526;
  background: #ffffff;
}

.fluxy-chat__lead-form input:focus,
.fluxy-chat__lead-form select:focus {
  border-color: rgba(34, 200, 255, .35);
  box-shadow: 0 0 0 3px rgba(34, 200, 255, .10);
}

.fluxy-chat__lead-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: #fff;
  cursor: pointer;
  background:linear-gradient(135deg,#6b9a63 0%,#5b8754 52%,#4c7147 100%);
}

.fluxy-chat__inputbar {
  border-top: 1px solid rgba(11, 21, 38, .08);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  background: #ffffff;
  width: 100%;
  overflow: hidden;
}

.fluxy-chat__inputbar input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(11, 21, 38, .10);
  border-radius: 999px;
  outline: none;
  font-size: 14px;
  color: #0b1526;
  background: #f4f7fb;
  transition: .2s ease;
}

.fluxy-chat__inputbar input::placeholder {
  color: #7c8ba1;
}

.fluxy-chat__inputbar input:focus {
  border-color: rgba(34, 200, 255, .35);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(34, 200, 255, .10);
}

.fluxy-chat__action-btn,
.fluxy-chat__cancel-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 42px;
  transition: .2s ease;
}

.fluxy-chat__action-btn {
  background: #00C504;
  color: #fff;
  box-shadow: 0 10px 20px rgba(18, 56, 103, .18);
}

.fluxy-chat__action-btn:hover {
  transform: translateY(-1px);
}

.fluxy-chat__cancel-btn {
  background: #eef2f7;
  color: #67768b;
  display: none;
}

.fluxy-chat__cancel-btn:hover {
  background: #e3e9f1;
}

.fluxy-chat__action-btn i,
.fluxy-chat__cancel-btn i {
  font-size: 16px;
}

.fluxy-chat__action-btn:disabled,
.fluxy-chat__cancel-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.fluxy-chat__audio-sent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fluxy-chat__audio-sent i {
  color: #fff;
  font-size: 14px;
}

.fluxy-chat__recording-indicator {
  display: none;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
}

@media (max-width: 980px) {
  .fluxy-chat__shell {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .fluxy-chat__shell {
    height: 600px;
    border-radius: 24px;
  }

  .fluxy-chat__top {
    padding: 18px 18px 14px;
  }

  .fluxy-chat__avatar {
    width: 68px;
    height: 68px;
  }

  .fluxy-chat__header {
    min-height: 66px;
    padding: 0 18px;
  }

  .fluxy-chat__header p {
    font-size: 0.95rem;
  }

  .fluxy-chat__messages {
    min-height: 260px;
    padding: 14px 14px 16px;
  }

  .fluxy-chat__message {
    max-width: 88%;
    font-size: 13px;
    padding: 11px 13px;
  }

  .fluxy-chat__message a {
    font-size: 13px;
    padding: 9px 12px;
  }

  .fluxy-chat__message--lead-form {
    padding: 8px 10px;
  }

  .fluxy-chat__lead-wrap {
    gap: 6px;
  }

  .fluxy-chat__lead-form {
    gap: 6px;
  }

  .fluxy-chat__lead-form input,
  .fluxy-chat__lead-form select,
  .fluxy-chat__lead-submit {
    height: 38px;
    font-size: 13px;
  }

  .fluxy-chat__inputbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .fluxy-chat__inputbar input {
    font-size: 13px;
    height: 40px;
  }

  .fluxy-chat__action-btn,
  .fluxy-chat__cancel-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex: 0 0 40px;
  }
}
