/* Widget chat — colores corporativos VR */
body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.aevr-chatbot-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  font-family: var(--font-body, system-ui, sans-serif);
}

.aevr-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, #67a244, #215b49);
  color: #fff;
  box-shadow: 0 10px 28px rgba(33, 91, 73, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aevr-chat-launcher__icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  opacity: 0.96;
}

.aevr-chat-launcher__icon svg {
  display: block;
}

.aevr-chat-launcher__label {
  white-space: nowrap;
}

.aevr-chat-launcher:hover:not([disabled]) {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(103, 162, 68, 0.45);
}

.aevr-chat-launcher[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.aevr-chat-panel {
  position: absolute;
  right: 0;
  bottom: 3.5rem;
  width: min(380px, calc(100vw - 2rem));
  max-height: min(520px, 70vh);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(53, 114, 75, 0.2);
  box-shadow: 0 20px 50px rgba(33, 91, 73, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.aevr-chat-panel.is-open {
  display: flex;
}

.aevr-chat-panel header,
.aevr-chat-panel__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, #215b49, #35724b);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.aevr-chat-panel__head-icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
  color: rgba(255, 255, 255, 0.94);
}

.aevr-chat-panel__head-icon svg {
  display: block;
}

.aevr-chat-panel__head-title {
  flex: 1;
  min-width: 0;
}

.aevr-chat-panel .body {
  padding: 0.9rem 0.9rem 0.75rem;
  overflow-y: auto;
  font-size: 0.95rem;
  color: #3d5346;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 180px;
}

.aevr-chat-msg {
  max-width: 92%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  line-height: 1.4;
}

.aevr-chat-msg--bot {
  align-self: flex-start;
  background: #f1f5f9;
  color: #1f2937;
}

.aevr-chat-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #96d43d, #67a244);
  color: #0f2419;
}

.aevr-chat-composer {
  border-top: 1px solid #e5efe0;
  padding: 0.75rem 0.9rem 0.85rem;
  background: #fff;
}

.aevr-chat-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: #64748b;
}

.aevr-chat-status[hidden] {
  display: none !important;
}

.aevr-chat-status__spinner {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid #d4e5cf;
  border-top-color: #67a244;
  border-radius: 50%;
  animation: aevr-chat-spin 0.7s linear infinite;
}

@keyframes aevr-chat-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aevr-chat-status__spinner {
    animation: none;
    border-top-color: #d4e5cf;
    opacity: 0.7;
  }
}

.aevr-chat-panel textarea {
  width: 100%;
  min-height: 72px;
  margin-top: 0;
  border-radius: 10px;
  border: 1px solid #d4e5cf;
  padding: 0.5rem 0.65rem;
  font: inherit;
}

.aevr-chat-panel textarea:focus {
  outline: none;
  border-color: #67a244;
  box-shadow: 0 0 0 3px rgba(150, 212, 61, 0.35);
}

.aevr-chat-panel .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.aevr-chat-panel button.send {
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #96d43d, #67a244);
  color: #0f2419;
  font-weight: 750;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.aevr-chat-panel button.send:hover:not([disabled]) {
  filter: brightness(1.05);
}
