/* Builgent Chatbot CSS standalone — vars resueltas con scan global */
/* ═══════════════════════════════════════════════════════════════
   CHATBOT (Apple-tech aesthetic)
   ═══════════════════════════════════════════════════════════════ */
#bgc-launcher {
  position: fixed; bottom: 24px; right: 24px; z-index: 80;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: #000000; border: 0;
  transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 12px 40px -8px rgba(41, 151, 255, 0.5), 0 0 0 0 rgba(41, 151, 255, 0.4);
  animation: bgcPulse 2.6s ease-out infinite;
}

#bgc-launcher:hover { transform: scale(1.06); }

#bgc-launcher::before {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(from 0deg, #2997FF, #BF5AF2, #64D2FF, #2997FF);
  animation: bgcOrbSpin 6s linear infinite; z-index: 0;
}

#bgc-launcher::after {
  content: ''; position: absolute; inset: 2px; border-radius: 50%;
  background: #000000; z-index: 0;
}

#bgc-launcher .icon { color: #fff; transition: transform 0.3s; z-index: 1; position: relative; }

#bgc-launcher.open .icon-chat { display: none; }

#bgc-launcher .icon-close { display: none; }

#bgc-launcher.open .icon-close { display: block; }

#bgc-teaser {
  position: fixed; bottom: 100px; right: 24px; z-index: 79;
  max-width: 280px;
  background: #fff; color: #0B0B0F;
  padding: 14px 18px; border-radius: 18px;
  box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.5);
  transform: translateX(20px); opacity: 0; pointer-events: none;
  transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

#bgc-teaser.show { transform: translateX(0); opacity: 1; pointer-events: auto; }

#bgc-teaser .tlabel {
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: #2997FF;
}

#bgc-teaser .ttext {
  font-size: 14px; font-weight: 500; margin-top: 4px; line-height: 1.35;
}

#bgc-teaser .tclose {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #000000; color: #fff;
  display: grid; place-items: center; font-size: 13px;
  cursor: pointer; transition: transform 0.2s;
}

#bgc-teaser .tclose:hover { transform: scale(1.1); }

#bgc-panel {
  position: fixed; bottom: 100px; right: 24px; z-index: 81;
  width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 140px));
  border-radius: 24px; overflow: hidden;
  background: #000000; border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  transform: translateY(20px) scale(0.96); opacity: 0; pointer-events: none;
  transition: all 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex; flex-direction: column;
}

#bgc-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

@media (max-width: 480px) {
  #bgc-panel { right: 16px; left: 16px; bottom: 88px; width: auto; height: calc(100vh - 120px); }
  #bgc-launcher { right: 16px; bottom: 16px; }
  #bgc-teaser { right: 16px; max-width: calc(100vw - 64px); }
}

.bgc-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(41, 151, 255, 0.05), transparent);
  flex-shrink: 0;
}

.bgc-orb {
  width: 36px; height: 36px; border-radius: 50%; position: relative; overflow: hidden;
  flex-shrink: 0;
}

.bgc-orb::before, .bgc-orb::after {
  content: ''; position: absolute; inset: -30%; border-radius: 50%; filter: blur(18px);
}

.bgc-orb::before { background: conic-gradient(from 0deg, #2997FF, #BF5AF2, #64D2FF, #2997FF); animation: bgcOrbSpin 6s linear infinite; }

.bgc-orb::after { background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), transparent 50%); }

.bgc-orb-sm { width: 28px; height: 28px; }

.bgc-header-info { flex: 1; min-width: 0; }

.bgc-header-name {
  font-family: 'Instrument Serif', 'Times New Roman', serif; font-size: 18px; color: #fff; line-height: 1;
}

.bgc-header-status {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 11px; color: #7E8696; font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace; letter-spacing: 0.05em;
}

.bgc-header-status .dot { width: 6px; height: 6px; border-radius: 50%; background: #30D158; box-shadow: 0 0 8px #30D158; }

.bgc-header-actions { display: flex; gap: 6px; }

.bgc-header-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; color: #A0A8B8;
  background: transparent; transition: all 0.2s; border: 0;
}

.bgc-header-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.bgc-msgs {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}

.bgc-msgs::-webkit-scrollbar { width: 6px; }

.bgc-msgs::-webkit-scrollbar-track { background: transparent; }

.bgc-msgs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 999px; }

.bgc-msg {
  display: flex; gap: 10px; max-width: 100%;
  animation: bgcMsgIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.bgc-msg.user { justify-content: flex-end; }

.bgc-msg.user .bgc-orb { display: none; }

.bgc-bubble {
  padding: 12px 16px; border-radius: 18px; max-width: 85%;
  font-size: 14.5px; line-height: 1.5; word-wrap: break-word;
}

.bgc-msg.assistant .bgc-bubble {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px; color: #E6E9F0;
}

.bgc-msg.user .bgc-bubble {
  background: linear-gradient(135deg, #2997FF, #0A6BD8);
  color: #fff; border-top-right-radius: 4px;
}

.bgc-bubble p { margin: 0; }

.bgc-bubble p + p { margin-top: 10px; }

.bgc-bubble strong { color: #fff; font-weight: 600; }

.bgc-bubble ul, .bgc-bubble ol { margin: 8px 0; padding-left: 20px; }

.bgc-bubble li { margin: 4px 0; }

.bgc-bubble code {
  background: rgba(0, 0, 0, 0.4); padding: 2px 6px; border-radius: 4px;
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace; font-size: 13px;
}

.bgc-typing {
  display: inline-flex; gap: 4px; padding: 8px 0;
}

.bgc-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #A0A8B8; opacity: 0.5;
  animation: bgcTyping 1.2s infinite ease-in-out;
}

.bgc-typing span:nth-child(2) { animation-delay: 0.15s; }

.bgc-typing span:nth-child(3) { animation-delay: 0.3s; }

.bgc-welcome { padding: 8px 4px 0; }

.bgc-welcome-title {
  font-family: 'Instrument Serif', 'Times New Roman', serif; font-size: 24px; color: #fff; line-height: 1.1;
}

.bgc-welcome-sub { font-size: 14px; color: #A0A8B8; margin-top: 8px; line-height: 1.5; }

.bgc-welcome-chips {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px;
}

.bgc-chip {
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  color: #C7CCD6; font-size: 13px; line-height: 1.3; text-align: left;
  transition: all 0.15s; cursor: pointer;
}

.bgc-chip:hover { background: rgba(41, 151, 255, 0.08); border-color: rgba(41, 151, 255, 0.3); color: #fff; transform: translateY(-1px); }

.bgc-input-wrap {
  padding: 12px 16px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.bgc-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px;
  transition: border-color 0.2s;
}

.bgc-composer:focus-within { border-color: #2997FF; }

.bgc-textarea {
  flex: 1; min-width: 0; resize: none; max-height: 120px;
  background: transparent; border: 0; outline: 0;
  font-size: 14.5px; line-height: 1.5; color: #fff;
  padding: 6px 0;
}

.bgc-textarea::placeholder { color: #5A6172; }

.bgc-send {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: #2997FF; color: #fff; border: 0;
  display: grid; place-items: center;
  transition: all 0.2s;
}

.bgc-send:hover:not(:disabled) { background: #0A6BD8; transform: scale(1.05); }

.bgc-send:disabled { opacity: 0.4; cursor: not-allowed; }

.bgc-footer {
  text-align: center; margin-top: 8px;
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace; font-size: 10px; letter-spacing: 0.1em; color: #7E8696;
}

/* Lead capture form (inline en chatbot) */
.bgc-lead-form {
  margin: 8px 0 0; padding: 16px; border-radius: 16px;
  background: rgba(41, 151, 255, 0.05); border: 1px solid rgba(41, 151, 255, 0.2);
  display: grid; gap: 10px;
}

.bgc-lead-title {
  font-family: 'Instrument Serif', 'Times New Roman', serif; font-size: 17px; color: #fff;
}

.bgc-lead-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff; font-size: 14px;
}

.bgc-lead-input:focus { outline: none; border-color: #2997FF; }

.bgc-lead-input::placeholder { color: #5A6172; }

.bgc-lead-submit {
  padding: 10px 16px; border-radius: 10px;
  background: linear-gradient(180deg, #F0F7FF, #B7DBFF); color: #04122B;
  font-size: 14px; font-weight: 500; border: 0;
  transition: all 0.2s; cursor: pointer;
}

.bgc-lead-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(41, 151, 255, 0.6); }

.bgc-lead-submit:disabled { opacity: 0.5; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .story-scene { transition: none; }
  #bgc-launcher::before { animation: none; }
  #bgc-launcher { animation: none; }
}

/* Bgc launcher — orbital aurora */
#bgc-launcher::before {
  background: conic-gradient(from 0deg, #06B6D4, #EC4899, #F59E0B, #06B6D4);
}