/* JurisFamiliar Chat Widget — paleta Navy + Dourado */

.jf-chat-root,
.jf-chat-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.jf-hidden { display: none !important; }

/* ========== TRIGGER (FAB + bubble) ========== */
.jf-chat-trigger {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 99998;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.jf-bubble {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 14px 16px;
  max-width: 280px;
  box-shadow: 0 12px 32px rgba(15, 44, 75, 0.18);
  cursor: pointer;
  position: relative;
  text-align: left;
  animation: jf-fade-in 0.4s ease-out;
}
.jf-bubble-text {
  font-size: 14px;
  color: #1A1A1A;
  line-height: 1.45;
}
.jf-bubble-text strong { color: #0F2C4B; font-weight: 700; }
.jf-bubble-tail {
  position: absolute;
  right: -7px;
  bottom: 18px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  transform: rotate(-45deg);
}

.jf-fab {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: #C9A961;
  box-shadow: 0 10px 28px rgba(15, 44, 75, 0.3), 0 0 0 3px rgba(201, 169, 97, 0.25);
  position: relative;
  transition: transform 0.2s ease;
}
.jf-fab:hover { transform: scale(1.08); }
.jf-fab img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.jf-fab-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid #FFFFFF;
}

/* ========== JANELA DO CHAT ========== */
.jf-chat-window {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 99999;
  width: 100%;
  max-width: 400px;
  height: 100dvh;
  background: #FDFBF7;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 48px rgba(15, 44, 75, 0.25);
  animation: jf-slide-up 0.3s ease-out;
}
@media (min-width: 768px) {
  .jf-chat-window {
    bottom: 16px;
    right: 16px;
    height: 620px;
    max-height: calc(100dvh - 32px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
  }
}

/* Header */
.jf-chat-header {
  background: linear-gradient(135deg, #0F2C4B 0%, #1A446F 100%);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.jf-chat-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
}
.jf-chat-header-info { flex: 1; line-height: 1.3; }
.jf-chat-agent {
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
}
.jf-chat-status {
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.jf-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  display: inline-block;
  animation: jf-pulse 2s infinite;
}
.jf-chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}
.jf-chat-close:hover { color: #FFFFFF; }

/* Messages */
.jf-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #FDFBF7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jf-msg {
  display: flex;
  gap: 8px;
  max-width: 100%;
}
.jf-msg-agent {
  align-items: flex-start;
  margin-right: auto;
}
.jf-msg-agent img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}
.jf-msg-user {
  justify-content: flex-end;
}

.jf-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 270px;
  word-wrap: break-word;
  animation: jf-fade-in 0.3s ease-out;
}
.jf-msg-agent .jf-msg-bubble {
  background: #FFFFFF;
  color: #1A1A1A;
  border-top-left-radius: 4px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.jf-msg-agent .jf-msg-bubble strong { color: #0F2C4B; font-weight: 600; }

.jf-msg-user .jf-msg-bubble {
  background: linear-gradient(135deg, #0F2C4B 0%, #1A446F 100%);
  color: #FFFFFF;
  border-top-right-radius: 4px;
  max-width: 240px;
}

/* Options (botões de escolha) */
.jf-options {
  margin: 4px 0 4px 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  animation: jf-fade-in 0.3s ease-out 0.1s both;
}
.jf-option {
  background: linear-gradient(135deg, #C9A961 0%, #A8893F 100%);
  color: #FFFFFF;
  border: none;
  padding: 8px 14px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.2;
}
.jf-option:hover {
  box-shadow: 0 4px 12px rgba(201, 169, 97, 0.35);
  transform: translateY(-1px);
}

/* Typing indicator */
.jf-typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}
.jf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #718096;
  display: inline-block;
  animation: jf-bounce 1.4s infinite ease-in-out both;
}
.jf-dot:nth-child(1) { animation-delay: -0.32s; }
.jf-dot:nth-child(2) { animation-delay: -0.16s; }

/* Input area */
.jf-chat-input-area {
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  padding: 12px 14px;
  flex-shrink: 0;
}
.jf-chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FDFBF7;
  border: 1px solid #E2E8F0;
  border-radius: 22px;
  padding: 4px 4px 4px 14px;
}
.jf-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: #1A1A1A;
  padding: 8px 0;
}
.jf-chat-input::placeholder { color: #718096; }
.jf-chat-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #C9A961 0%, #A8893F 100%);
  color: #FFFFFF;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.jf-chat-send:hover { box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4); }

.jf-chat-complete {
  padding: 12px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  text-align: center;
  font-size: 12px;
  color: #718096;
}

/* ========== ANIMAÇÕES ========== */
@keyframes jf-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes jf-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes jf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes jf-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ========== AJUSTES MOBILE ========== */
@media (max-width: 480px) {
  .jf-chat-trigger { bottom: 14px; right: 12px; }
  .jf-fab { width: 56px; height: 56px; }
  .jf-fab img { width: 56px; height: 56px; }
  .jf-bubble { max-width: 220px; padding: 12px 14px; }
  .jf-bubble-text { font-size: 13px; }
}
