/* Chatbot Credativa */
.chatbot-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #0f5c4a, #159376);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 92, 74, 0.35);
  display: grid;
  place-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-toggle:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 16px 32px rgba(15, 92, 74, 0.4);
}

.chatbot-toggle.open {
  background: #0a4538;
}

.chatbot-window {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 1000;
  width: min(400px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 130px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 92, 74, 0.22);
  border: 1px solid #dfe7e3;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: Inter, system-ui, sans-serif;
}

.chatbot-window.open {
  display: flex;
  animation: chatSlideIn 0.25s ease;
}

@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-header {
  background: linear-gradient(135deg, #0a4538, #0f5c4a);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chatbot-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.chatbot-header-text {
  flex: 1;
  min-width: 0;
}

.chatbot-header-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.chatbot-header-text span {
  font-size: 12px;
  opacity: 0.85;
}

.chatbot-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}

.chatbot-close:hover {
  background: rgba(255,255,255,0.12);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: #f6f8f7;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.chat-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #dfe7e3;
  border-bottom-left-radius: 4px;
  color: #18302a;
}

.chat-msg.user {
  align-self: flex-end;
  background: #0f5c4a;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg .msg-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.7;
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  align-self: flex-start;
}

.chat-option-btn {
  border: 1.5px solid #0f5c4a;
  background: #fff;
  color: #0f5c4a;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}

.chat-option-btn:hover {
  background: #0f5c4a;
  color: #fff;
}

.chat-option-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-input-area {
  border-top: 1px solid #dfe7e3;
  padding: 12px 14px;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chatbot-input-area input[type="text"],
.chatbot-input-area input[type="date"],
.chatbot-input-area input[type="tel"] {
  flex: 1;
  border: 1px solid #dfe7e3;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  background: #fafbfa;
}

.chatbot-input-area input:focus {
  border-color: #0f5c4a;
  box-shadow: 0 0 0 3px rgba(15, 92, 74, 0.1);
}

.chatbot-input-area input.input-valid {
  border-color: #0f5c4a;
  background: #edf7f3;
}

.chatbot-input-area input.input-invalid {
  border-color: #c0392b;
  background: #fdf2f1;
}

.chatbot-input-area input.input-valid:focus {
  box-shadow: 0 0 0 3px rgba(15, 92, 74, 0.15);
}

.chatbot-input-area input.input-invalid:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.chat-field-hint {
  font-size: 12px;
  margin: 0;
  padding: 0 2px;
  min-height: 18px;
  line-height: 1.3;
}

.chat-field-hint.ok {
  color: #0f5c4a;
  font-weight: 600;
}

.chat-field-hint.err {
  color: #c0392b;
  font-weight: 600;
}

.chat-field-hint.neutral {
  color: #66746f;
}

.chatbot-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #0f5c4a;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: 0.15s;
}

.chatbot-send:hover:not(:disabled) {
  background: #0a4538;
}

.chatbot-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chatbot-file-zone {
  border: 1.5px dashed #b8c9c2;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background: #fafbfa;
  cursor: pointer;
  transition: 0.15s;
}

.chatbot-file-zone:hover,
.chatbot-file-zone.dragover {
  border-color: #0f5c4a;
  background: #edf7f3;
}

.chatbot-file-zone input[type="file"] {
  display: none;
}

.chatbot-file-zone .file-hint {
  font-size: 13px;
  color: #66746f;
  margin: 0;
}

.chatbot-file-zone .file-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f5c4a;
  margin-top: 6px;
}

.chat-progress {
  display: flex;
  gap: 4px;
  padding: 0 16px 8px;
  background: #f6f8f7;
  flex-shrink: 0;
}

.chat-progress-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #dfe7e3;
  transition: background 0.2s;
}

.chat-progress-dot.done {
  background: #0f5c4a;
}

.chat-progress-dot.current {
  background: #d6b25e;
}

.chat-typing {
  align-self: flex-start;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #dfe7e3;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  font-size: 13px;
  color: #66746f;
}

.chat-typing span {
  display: inline-block;
  animation: typingDot 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.chat-success-card {
  background: #edf7f3;
  border: 1px solid #b8e0d0;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.chat-success-card strong {
  display: block;
  color: #0f5c4a;
  font-size: 15px;
  margin-bottom: 6px;
}

.chat-success-card p {
  margin: 0;
  font-size: 13px;
  color: #4f625b;
}

@media (max-width: 480px) {
  .chatbot-window {
    right: 10px;
    bottom: 86px;
    width: calc(100vw - 20px);
    height: min(70vh, 560px);
  }
  .chatbot-toggle {
    right: 14px;
    bottom: 14px;
  }
}


.chatbot-file-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-cam-btn {
  flex: 1;
  min-width: 120px;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #0f5c4a;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.chat-cam-btn:hover {
  background: #0a4538;
}

.chat-cam-btn.secondary {
  background: #fff;
  color: #0f5c4a;
  border: 1.5px solid #0f5c4a;
}

.chat-cam-btn.secondary:hover {
  background: #edf7f3;
}
