/* ============================================================
   AGENTE RUTE — Chat Widget (Landing Page)
   ============================================================ */

/* ── Botão flutuante ── */
.rute-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.rute-bubble-hint {
  background: #fff;
  color: #FF5A7A;
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px 20px 4px 20px;
  box-shadow: 0 4px 20px rgba(255,90,122,0.2);
  white-space: nowrap;
  animation: bounceIn 0.5s ease, pulse 3s 1s infinite;
  cursor: pointer;
}
@keyframes bounceIn {
  0%   { opacity:0; transform:scale(0.5) translateY(20px); }
  70%  { transform:scale(1.05) translateY(-4px); }
  100% { opacity:1; transform:scale(1) translateY(0); }
}
@keyframes pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(255,90,122,0.2); }
  50%      { box-shadow: 0 4px 28px rgba(255,90,122,0.45); }
}

.rute-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF5A7A, #FF8FAB);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255,90,122,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}
.rute-btn:hover { transform: scale(1.08); box-shadow: 0 10px 32px rgba(255,90,122,0.55); }
.rute-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.rute-btn .rute-online {
  position: absolute;
  bottom: 3px; right: 3px;
  width: 14px; height: 14px;
  background: #43A047;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ── Janela do chat ── */
.rute-chat {
  position: fixed;
  bottom: 108px;
  right: 28px;
  width: 360px;
  max-height: 560px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(15,15,26,0.18);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  font-family: 'Poppins', sans-serif;
}
.rute-chat.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}
@media (max-width: 420px) {
  .rute-chat { width: calc(100vw - 24px); right: 12px; bottom: 100px; }
}

/* Header */
.rute-header {
  background: linear-gradient(135deg, #FF5A7A, #FF8FAB);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.rute-header-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  object-fit: cover;
  flex-shrink: 0;
}
.rute-header-info { flex: 1; }
.rute-header-name { font-size: 0.95rem; font-weight: 700; color: #fff; }
.rute-header-status {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.rute-header-status::before {
  content: '';
  width: 7px; height: 7px;
  background: #A5D6A7;
  border-radius: 50%;
  display: inline-block;
}
.rute-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.rute-close:hover { background: rgba(255,255,255,0.35); }

/* Mensagens */
.rute-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FFF8FA;
}
.rute-messages::-webkit-scrollbar { width: 4px; }
.rute-messages::-webkit-scrollbar-thumb { background: #F0C0CC; border-radius: 4px; }

.msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}
.msg.bot { justify-content: flex-start; }
.msg.user { justify-content: flex-end; }

.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.85rem;
  line-height: 1.55;
}
.msg.bot  .msg-bubble {
  background: #fff;
  color: #333;
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.msg.user .msg-bubble {
  background: linear-gradient(135deg, #FF5A7A, #FF8FAB);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}

/* Typing indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  width: fit-content;
}
.typing-dots span {
  width: 7px; height: 7px;
  background: #F48FB1;
  border-radius: 50%;
  animation: typingDot 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%,60%,100% { transform:translateY(0); opacity:0.4; }
  30%          { transform:translateY(-6px); opacity:1; }
}

/* Quick replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 14px 10px;
}
.qr-btn {
  padding: 7px 14px;
  background: #fff;
  border: 1.5px solid #F48FB1;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #FF5A7A;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
}
.qr-btn:hover { background: #FFF0F5; transform: translateY(-1px); }

/* Input */
.rute-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #F5E6EA;
  background: #fff;
  flex-shrink: 0;
}
.rute-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #F0D0D8;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: 'Poppins', sans-serif;
  outline: none;
  color: #333;
  transition: border-color 0.2s;
}
.rute-input:focus { border-color: #FF8FAB; }
.rute-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF5A7A, #FF8FAB);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.rute-send:hover { transform: scale(1.1); }
