/* Benefu Chat Widget — provider-agnostic (navy / indigo — matches site) */
.benefu-chat-widget {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

.benefu-chat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(49, 46, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.benefu-chat-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(30, 27, 75, 0.5);
}
.benefu-chat-btn svg {
  width: 28px;
  height: 28px;
}

.benefu-chat-panel {
  display: none;
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  overflow: hidden;
}
.benefu-chat-panel.open {
  display: flex;
}

.benefu-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.benefu-chat-header .benefu-chat-close {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
}
.benefu-chat-header .benefu-chat-close:hover {
  background: rgba(255,255,255,0.3);
}

.benefu-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.benefu-chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.benefu-chat-msg.user {
  align-self: flex-end;
  background: #312e81;
  color: white;
  border-bottom-right-radius: 4px;
}
.benefu-chat-msg.assistant {
  align-self: flex-start;
  background: white;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.benefu-chat-msg.typing {
  align-self: flex-start;
  color: #64748b;
  font-style: italic;
}

.benefu-chat-input-wrap {
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
}
.benefu-chat-input-wrap form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.benefu-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.95rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  font-family: inherit;
}
.benefu-chat-input:focus {
  outline: none;
  border-color: #312e81;
  box-shadow: 0 0 0 2px rgba(49, 46, 129, 0.25);
}
.benefu-chat-send {
  padding: 12px 20px;
  background: #312e81;
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.benefu-chat-send:hover {
  background: #1e1b4b;
}
.benefu-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.benefu-chat-watermark {
  text-align: center;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 8px;
}
.benefu-chat-watermark a {
  color: #312e81;
  text-decoration: none;
}
.benefu-chat-watermark a:hover {
  color: #1e1b4b;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .benefu-chat-widget {
    bottom: 16px;
    right: 16px;
  }
  .benefu-chat-panel {
    width: calc(100vw - 32px);
    right: -8px;
  }
}
