/* ============================================ */
/* CHAT FLUTUANTE - FIN EZZA ODONTOLOGIA */
/* VERSÃO MODIFICADA - FORMULÁRIO DE LEADS */
/* ============================================ */

.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 20px;
  z-index: 9999;
} 

/* Botão flutuante */
.chat-button {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #16BEC4, #0EA9AF);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(22, 190, 196, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: none;
  color: white;
  font-size: 28px;
}

.chat-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(22, 190, 196, 0.4);
}

/* Janela do chat */
.chat-window {
  position: fixed;
  bottom: 30px;
  right: 20px;
  width: 380px;
  height: 650px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  z-index: 9999;
}

.chat-window.open {
  display: flex !important;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cabeçalho do chat */
.chat-header {
  background: linear-gradient(135deg, #16BEC4, #0EA9AF);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-header .chat-status {
  font-size: 11px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-header .chat-status::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.3s;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Área de conteúdo - Mensagem inicial */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bolhas de mensagem */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.message-content {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.user .message-content {
  background: #16BEC4;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot .message-content {
  background: white;
  color: #1a1a2e;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  margin-left: 12px;
  margin-right: 12px;
}

/* ============================================ */
/* FORMULÁRIO DE LEADS (substitui o input area) */
/* ============================================ */
.lead-form-area {
  padding: 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lead-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.5px;
}

.lead-form-group input {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
  font-family: inherit;
}

.lead-form-group input:focus {
  border-color: #16BEC4;
  box-shadow: 0 0 0 2px rgba(22, 190, 196, 0.1);
}

.lead-form-group input.error {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.error-message {
  font-size: 11px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

.error-message.show {
  display: block;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #16BEC4, #0EA9AF);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-whatsapp:hover {
  background: #0EA9AF;
  transform: translateY(-2px);
}

.btn-whatsapp:active {
  transform: translateY(0);
}

.btn-close-lead {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
  margin-top: 8px;
}

.btn-close-lead:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.form-message {
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  display: none;
}

.form-message.show {
  display: block;
}

.form-message.success {
  background: #dcfce7;
  color: #166534;
}

.form-message.error {
  background: #fee2e2;
  color: #991b1b;
}

/* Indicador de carregamento */
.loading-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #16BEC4;
  margin-top: 8px;
}

.loading-indicator.show {
  display: flex;
}

.loading-indicator::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #16BEC4;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsivo - Mobile */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    right: 20px;
    bottom: 80px;
  }

  .chat-button {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .message {
    max-width: 85%;
  }

  .message-content {
    font-size: 13px;
    padding: 8px 12px;
  }

  .lead-form-area {
    padding: 16px;
  }

  .btn-whatsapp,
  .btn-close-lead {
    padding: 10px;
  }
}

/* Rolagem personalizada */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================ */
/* MODAL DE ESCOLHA PARA ORÇAMENTO */
/* ============================================ */
.modal-choice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-choice-overlay.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.modal-choice-container {
  background: white;
  border-radius: 24px;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-choice-header {
  background: linear-gradient(135deg, #16BEC4, #0EA9AF);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-choice-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-choice-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

.modal-choice-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-choice-body {
  padding: 24px 20px;
  text-align: center;
}

.modal-choice-body p {
  margin: 0 0 24px 0;
  font-size: 15px;
  color: #334155;
  line-height: 1.5;
}

.modal-choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-choice-btn {
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.modal-btn-orcamento {
  background: linear-gradient(135deg, #16BEC4, #0EA9AF);
  color: white;
  box-shadow: 0 2px 8px rgba(22, 190, 196, 0.3);
}

.modal-btn-orcamento:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 190, 196, 0.4);
}

.modal-btn-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.modal-btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.modal-choice-btn:active {
  transform: translateY(0);
}

/* Responsivo para mobile */
@media (max-width: 480px) {
  .modal-choice-container {
    width: 90%;
    max-width: 340px;
  }

  .modal-choice-header h3 {
    font-size: 16px;
  }

  .modal-choice-body {
    padding: 20px 16px;
  }

  .modal-choice-body p {
    font-size: 14px;
  }

  .modal-choice-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
}