/* Chatbot Mora y Recupero — CVSA (conversational / Santi-like) */
.cvsa-chatbot {
  --cvsa-navy: #232D4F;
  --cvsa-cyan: #0BBAEF;
  --cvsa-teal: #23A19C;
  --cvsa-yellow: #FACE2C;
  --cvsa-text: #191E21;
  --cvsa-muted: #5a6570;
  --cvsa-bg: #eef2f6;
  --cvsa-white: #ffffff;
  --cvsa-border: #dde3ea;
  --cvsa-user-bg: #d9f3fb;
  --cvsa-shadow: 0 12px 40px rgba(35, 45, 79, 0.22);
  font-family: inherit;
}

.cvsa-chatbot__fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 10050;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--cvsa-navy);
  color: var(--cvsa-white);
  box-shadow: var(--cvsa-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.cvsa-chatbot__fab:hover,
.cvsa-chatbot__fab:focus {
  background: #1a2340;
  outline: none;
  transform: translateY(-1px);
}

.cvsa-chatbot__fab i {
  font-size: 1.15rem;
  color: var(--cvsa-cyan);
}

.cvsa-chatbot__fab-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.cvsa-chatbot__panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 10051;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--cvsa-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--cvsa-shadow);
  border: 1px solid var(--cvsa-border);
}

.cvsa-chatbot__panel[hidden] {
  display: none !important;
}

.cvsa-chatbot__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cvsa-navy);
  color: var(--cvsa-white);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--cvsa-teal) 45%, var(--cvsa-yellow) 100%);
  border-image-slice: 1;
  flex-shrink: 0;
}

.cvsa-chatbot__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cvsa-white);
}

.cvsa-chatbot__subtitle {
  margin: 2px 0 0;
  font-size: 0.75rem;
  opacity: 0.85;
}

.cvsa-chatbot__header-actions {
  display: flex;
  gap: 4px;
}

.cvsa-chatbot__icon-btn {
  border: 0;
  background: transparent;
  color: var(--cvsa-white);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}

.cvsa-chatbot__icon-btn:hover,
.cvsa-chatbot__icon-btn:focus {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.cvsa-chatbot__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  background: var(--cvsa-bg);
  scroll-behavior: smooth;
}

.cvsa-chatbot__msg {
  margin-bottom: 12px;
  max-width: 100%;
  display: flex;
}

.cvsa-chatbot__msg--bot {
  justify-content: flex-start;
}

.cvsa-chatbot__msg--user {
  justify-content: flex-end;
}

.cvsa-chatbot__msg--options {
  display: block;
}

.cvsa-chatbot__bubble {
  display: inline-block;
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--cvsa-text);
  background: var(--cvsa-white);
  border: 1px solid var(--cvsa-border);
  box-shadow: 0 1px 2px rgba(35, 45, 79, 0.04);
}

.cvsa-chatbot__bubble p {
  margin: 0 0 0.55em;
}

.cvsa-chatbot__bubble p:last-child {
  margin-bottom: 0;
}

.cvsa-chatbot__msg--bot .cvsa-chatbot__bubble {
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--cvsa-cyan);
}

.cvsa-chatbot__msg--user .cvsa-chatbot__bubble {
  background: var(--cvsa-user-bg);
  border-color: #b6e4f4;
  border-bottom-right-radius: 4px;
  text-align: left;
  font-weight: 600;
  color: var(--cvsa-navy);
}

.cvsa-chatbot__bubble--typing {
  padding: 8px 12px;
}

/* Options card (Santi-like grouped list) */
.cvsa-chatbot__options {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  background: var(--cvsa-white);
  border: 1.5px solid var(--cvsa-navy);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(35, 45, 79, 0.08);
}

.cvsa-chatbot__option {
  display: block;
  width: 100%;
  text-align: center;
  border: 0;
  border-bottom: 1px solid rgba(35, 45, 79, 0.18);
  background: var(--cvsa-white);
  color: var(--cvsa-navy);
  border-radius: 0;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.cvsa-chatbot__option:last-child {
  border-bottom: 0;
}

.cvsa-chatbot__option:hover,
.cvsa-chatbot__option:focus {
  background: #f0fbff;
  color: #0a7fa8;
  outline: none;
}

.cvsa-chatbot__options--locked {
  opacity: 0.55;
  pointer-events: none;
}

.cvsa-chatbot__options--locked .cvsa-chatbot__option {
  cursor: default;
}

.cvsa-chatbot__list {
  margin: 0.4em 0 0.7em;
  padding-left: 1.15em;
}

.cvsa-chatbot__list li {
  margin-bottom: 0.35em;
}

.cvsa-chatbot__form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cvsa-chatbot__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cvsa-muted);
  margin: 0;
}

.cvsa-chatbot__input {
  width: 100%;
  border: 1px solid var(--cvsa-border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.9rem;
  color: var(--cvsa-text);
}

.cvsa-chatbot__input:focus {
  border-color: var(--cvsa-cyan);
  outline: none;
  box-shadow: 0 0 0 2px rgba(11, 186, 239, 0.2);
}

.cvsa-chatbot__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--cvsa-muted);
}

.cvsa-chatbot__primary {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--cvsa-cyan);
  color: var(--cvsa-navy);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
}

.cvsa-chatbot__primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cvsa-chatbot__secondary {
  border: 1px solid var(--cvsa-border);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--cvsa-white);
  color: var(--cvsa-navy);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
}

.cvsa-chatbot__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cvsa-chatbot__actions a.cvsa-chatbot__primary,
.cvsa-chatbot__actions a.cvsa-chatbot__secondary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cvsa-chatbot__code {
  font-family: Consolas, Monaco, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cvsa-navy);
  background: #eef8fc;
  border: 1px dashed var(--cvsa-cyan);
  border-radius: 8px;
  padding: 10px;
  margin: 8px 0;
  word-break: break-all;
}

.cvsa-chatbot__loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--cvsa-muted);
}

.cvsa-chatbot__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #c5eaf6;
  border-top-color: var(--cvsa-cyan);
  border-radius: 50%;
  animation: cvsa-chatbot-spin 0.7s linear infinite;
}

@keyframes cvsa-chatbot-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 575px) {
  .cvsa-chatbot__fab {
    right: 14px;
    bottom: 16px;
    padding: 12px 14px;
  }

  .cvsa-chatbot__fab-label {
    display: none;
  }

  .cvsa-chatbot__panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .cvsa-chatbot__bubble {
    max-width: 94%;
  }

  .cvsa-chatbot__option {
    padding: 14px 12px;
    font-size: 0.9rem;
  }
}
