/* =================================================================
   BC Lead Qualifier Widget
   Estilos scoped con prefijo .bcq- para no chocar con la página
   ================================================================= */

:root {
  --bcq-navy: #001A72;
  --bcq-navy-700: #001460;
  --bcq-navy-900: #000933;
  --bcq-green: #00C288;
  --bcq-green-light: #99EED9;
  --bcq-green-bg: #E5FBF5;
  --bcq-pink: #DA1884;
  --bcq-white: #FFFFFF;
  --bcq-bg: #F4F6FB;
  --bcq-grey: #6B7280;
  --bcq-grey-light: #9CA3AF;
  --bcq-border: #E2E6F0;
  --bcq-radius: 16px;
}

/* ============ FLOATING BUBBLE ============ */
.bcq-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  background: var(--bcq-navy);
  color: var(--bcq-white);
  border: none;
  border-radius: 999px;
  padding: 16px 24px 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 26, 114, 0.25), 0 4px 12px rgba(0, 26, 114, 0.15);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s, background 0.25s;
  max-width: calc(100vw - 48px);
}
.bcq-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(0, 26, 114, 0.3);
  background: var(--bcq-navy-700);
}
.bcq-bubble.bcq-hidden { display: none; }

.bcq-bubble-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bcq-green);
  box-shadow: 0 0 12px var(--bcq-green);
  flex-shrink: 0;
  animation: bcq-pulse 1.8s ease-in-out infinite;
}
@keyframes bcq-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.bcq-bubble-text { white-space: nowrap; }
.bcq-bubble-text strong { color: var(--bcq-green); }

@media (max-width: 480px) {
  .bcq-bubble { padding: 14px 18px 14px 16px; font-size: 13px; bottom: 16px; right: 16px; }
}

/* ============ CHAT PANEL ============ */
.bcq-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 48px);
  z-index: 99999;
  background: var(--bcq-white);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0, 26, 114, 0.32), 0 8px 24px rgba(0, 26, 114, 0.16);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  animation: bcq-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.bcq-panel.bcq-open { display: flex; }
@keyframes bcq-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .bcq-panel { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; bottom: 0; right: 0; border-radius: 0; }
}

/* ============ HEADER ============ */
.bcq-head {
  background: var(--bcq-navy);
  color: var(--bcq-white);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.bcq-head::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 194, 136, 0.18), transparent 60%);
  pointer-events: none;
}
.bcq-head-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bcq-green), #1de69e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--bcq-navy);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.bcq-head-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.bcq-head-name { font-family: 'Roboto', sans-serif; font-weight: 900; font-size: 16px; letter-spacing: -0.3px; line-height: 1.1; }
.bcq-head-status { font-size: 12px; color: rgba(255, 255, 255, 0.7); font-weight: 500; display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.bcq-head-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bcq-green); box-shadow: 0 0 6px var(--bcq-green); }
.bcq-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--bcq-white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.bcq-close:hover { background: rgba(255, 255, 255, 0.2); }

/* ============ MESSAGES AREA ============ */
.bcq-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bcq-bg);
  scroll-behavior: smooth;
}
.bcq-messages::-webkit-scrollbar { width: 6px; }
.bcq-messages::-webkit-scrollbar-track { background: transparent; }
.bcq-messages::-webkit-scrollbar-thumb { background: var(--bcq-border); border-radius: 3px; }

.bcq-msg {
  max-width: 85%;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: bcq-msg-in 0.3s ease;
}
@keyframes bcq-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bcq-msg-bot {
  align-self: flex-start;
  background: var(--bcq-white);
  color: var(--bcq-navy);
  padding: 14px 18px;
  border-radius: 18px 18px 18px 4px;
  border: 1px solid var(--bcq-border);
}
.bcq-msg-user {
  align-self: flex-end;
  background: var(--bcq-navy);
  color: var(--bcq-white);
  padding: 14px 18px;
  border-radius: 18px 18px 4px 18px;
}

.bcq-msg strong { font-weight: 700; }
.bcq-msg em { font-style: italic; }

/* Quick replies bajo el último mensaje del bot */
.bcq-quick-replies {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin-top: -4px;
}
.bcq-quick-replies button {
  background: var(--bcq-white);
  border: 1.5px solid var(--bcq-navy);
  color: var(--bcq-navy);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.bcq-quick-replies button:hover { background: var(--bcq-navy); color: var(--bcq-white); }
.bcq-quick-replies button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Typing indicator */
.bcq-typing {
  align-self: flex-start;
  background: var(--bcq-white);
  border: 1px solid var(--bcq-border);
  padding: 14px 18px;
  border-radius: 18px 18px 18px 4px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.bcq-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bcq-grey);
  animation: bcq-typing 1.3s infinite;
}
.bcq-typing span:nth-child(2) { animation-delay: 0.18s; }
.bcq-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes bcq-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* ============ INPUT AREA ============ */
.bcq-input-wrap {
  padding: 16px 20px;
  background: var(--bcq-white);
  border-top: 1px solid var(--bcq-border);
  display: flex;
  align-items: end;
  gap: 10px;
}
.bcq-input {
  flex: 1;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--bcq-navy);
  background: var(--bcq-bg);
  border: 1px solid var(--bcq-border);
  border-radius: 22px;
  padding: 12px 16px;
  resize: none;
  outline: none;
  max-height: 100px;
  min-height: 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bcq-input:focus { border-color: var(--bcq-navy); box-shadow: 0 0 0 3px rgba(0, 26, 114, 0.08); }
.bcq-input::placeholder { color: var(--bcq-grey-light); }
.bcq-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bcq-green);
  color: var(--bcq-navy);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.bcq-send:hover { background: #1de69e; transform: scale(1.05); }
.bcq-send:disabled { background: var(--bcq-grey-light); cursor: not-allowed; transform: none; }

.bcq-foot-note {
  padding: 8px 20px 12px;
  background: var(--bcq-white);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 10px;
  color: var(--bcq-grey-light);
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.bcq-foot-note a { color: var(--bcq-green); text-decoration: none; }

/* ============ VERDICT CARDS ============ */
.bcq-verdict {
  align-self: stretch;
  background: var(--bcq-white);
  border: 1px solid var(--bcq-border);
  border-radius: 16px;
  padding: 20px;
  margin: 6px 0;
  border-left: 4px solid var(--bcq-green);
}
.bcq-verdict-tag {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--bcq-green);
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}
.bcq-verdict-title {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: var(--bcq-navy);
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.bcq-verdict-body {
  font-size: 14px;
  color: var(--bcq-navy);
  line-height: 1.55;
  margin-bottom: 16px;
}
.bcq-verdict-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bcq-green);
  color: var(--bcq-navy);
  text-decoration: none;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 50px;
  transition: background 0.2s, transform 0.2s;
}
.bcq-verdict-cta:hover { background: #1de69e; transform: translateY(-2px); }
.bcq-verdict-cta-secondary {
  background: transparent;
  color: var(--bcq-navy);
  border: 1.5px solid var(--bcq-navy);
}
.bcq-verdict-cta-secondary:hover { background: var(--bcq-navy); color: var(--bcq-white); }

/* Variants */
.bcq-verdict[data-verdict="asesoria"] { border-left-color: var(--bcq-pink); }
.bcq-verdict[data-verdict="asesoria"] .bcq-verdict-tag { color: var(--bcq-pink); }
.bcq-verdict[data-verdict="nurturing"] { border-left-color: var(--bcq-grey); }
.bcq-verdict[data-verdict="nurturing"] .bcq-verdict-tag { color: var(--bcq-grey); }
.bcq-verdict[data-verdict="nurturing"] .bcq-verdict-cta { background: var(--bcq-navy); color: var(--bcq-white); }
.bcq-verdict[data-verdict="nurturing"] .bcq-verdict-cta:hover { background: var(--bcq-navy-700); }
