/* ===== CHAT SLOT ===== */
.chat-slot {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
}

.chat-container {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fcfdff 0%, #f5f8fc 100%);
  font-family: 'Inter', Arial, sans-serif;
}

.chat-container * {
  box-sizing: border-box;
}

/* ===== CHAT MESSAGES ===== */
.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%);
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

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

/* ===== MESSAGE BASE ===== */
.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;
}

.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #22c8ff 0%, #9a5cff 100%);
  color: #ffffff;
  border-bottom-right-radius: 8px;
}

.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;
}

.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;
}

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

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

/* ===== TYPING ===== */
.message.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.message.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0b1526;
  display: block;
  animation: blink 1s infinite ease-in-out;
}

.message.typing span:nth-child(2) {
  animation-delay: .2s;
}

.message.typing span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes blink {
  0%, 100% {
    opacity: .25;
    transform: scale(.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ===== LEAD FORM MESSAGE ===== */
.message.bot.lead-form-message {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  line-height: normal;
  white-space: normal;
  box-shadow: none;
}

.message.bot.lead-form-message br {
  display: none;
}

.lead-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-form-wrap p {
  margin: 0;
}

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

.lead-form__group {
  width: 100%;
  margin: 0;
}

.lead-form input,
.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;
  box-sizing: border-box;
}

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

.lead-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #22c8ff 0%, #59a8ff 30%, #9a5cff 70%, #b66bff 100%);
}

/* ===== CHAT INPUT ===== */
.chat-input {
  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;
}

.chat-input 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;
}

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

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

/* ===== BUTTONS ===== */
.chat-btn,
.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;
}

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

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

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

.cancel-btn:hover {
  background: #e3e9f1;
}

.chat-btn i,
.cancel-btn i {
  font-size: 16px;
}

.chat-btn:disabled,
.cancel-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ===== AUDIO / RECORDING ===== */
.audio-sent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

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

.recording-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #123867;
  display: block;
  animation: blink 1s infinite ease-in-out;
}

.recording-indicator span:nth-child(2) {
  animation-delay: .2s;
}

.recording-indicator span:nth-child(3) {
  animation-delay: .4s;
}

/* ===== MOBILE ===== */
@media (max-width: 520px) {
  .chat-messages {
    min-height: 260px;
    padding: 14px 14px 16px;
  }

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

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

  .message.bot.lead-form-message {
    padding: 8px 10px;
  }

  .lead-form-wrap {
    gap: 6px;
  }

  .lead-form {
    gap: 6px;
  }

  .lead-form input,
  .lead-form select,
  .lead-form__submit {
    height: 38px;
    font-size: 13px;
  }

  .chat-input {
    padding: 8px 10px;
    gap: 6px;
  }

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

  .chat-btn,
  .cancel-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex: 0 0 40px;
  }
}