/* ════════════════════════════════════════════════
   NEXT PLAY — chatbot.css
   ════════════════════════════════════════════════ */

.chat-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 250;
  display: flex; align-items: center; gap: 10px;
  background: var(--lime); color: var(--carbon);
  font-family: var(--f-head); font-weight: 700; font-size: 15px;
  padding: 15px 24px; border-radius: 999px;
  box-shadow: 0 14px 40px rgba(198,241,63,.35);
  transition: transform .25s var(--ease);
}
.chat-fab:hover { transform: translateY(-3px) scale(1.03); }
.chat-fab i { font-style: normal; font-size: 10px; }
.chat-fab.hidden { display: none; }

.chat-panel {
  position: fixed; bottom: 22px; right: 22px; z-index: 320;
  width: min(400px, calc(100vw - 28px));
  height: min(580px, calc(100dvh - 44px));
  background: var(--carbon-2); border: 1px solid var(--hair-d); border-radius: 22px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 50px 120px rgba(0,0,0,.65);
  animation: chatIn .35s var(--ease);
}
@keyframes chatIn { from { opacity: 0; transform: translateY(26px) scale(.96); } }

.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--hair-d);
}
.chat-head strong { font-family: var(--f-head); font-weight: 800; font-size: 15px; display: block; }
.chat-head small { color: var(--grey); font-size: 12px; }
.chat-head button { color: var(--grey); font-size: 15px; padding: 6px; }
.chat-head button:hover { color: var(--white); }

.chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 11px; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.55; }
.msg.bot { background: #1b1b21; border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--lime); color: var(--carbon); font-weight: 500; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.typing { display: flex; gap: 5px; padding: 15px 16px; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--grey); animation: blink 1.1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .18s; }
.msg.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 40% { opacity: .25; } }
.msg a { color: var(--lime); text-decoration: underline; }
.msg.bot b { color: var(--lime); font-weight: 600; }

/* Mini-form de lead dentro del chat */
.chat-leadform { align-self: stretch; background: #1b1b21; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.chat-leadform input, .chat-leadform select {
  width: 100%; background: var(--carbon); border: 1px solid var(--hair-d); border-radius: 9px;
  padding: 10px 13px; color: var(--white); font-family: inherit; font-size: 13.5px; outline: none;
}
.chat-leadform input:focus, .chat-leadform select:focus { border-color: var(--lime); }
.chat-leadform select { cursor: pointer; }
.chat-leadform select option { background: var(--carbon-2); }
.chat-leadform button {
  background: var(--lime); color: var(--carbon); font-weight: 700; font-size: 14px;
  padding: 12px; border-radius: 999px; margin-top: 4px; transition: transform .2s;
}
.chat-leadform button:hover { transform: translateY(-1px); }
.chat-leadform .cl-err { color: #ff8095; font-size: 12px; }
/* Consentimiento dentro del chat: mismo requisito legal que en los formularios */
.cl-consent {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 11px; line-height: 1.45; color: var(--grey); cursor: pointer;
}
.cl-consent input[type="checkbox"] {
  width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px;
  accent-color: var(--lime); cursor: pointer;
}
.cl-consent a { color: var(--white); text-decoration: underline; }
.cl-consent a:hover { color: var(--lime); }

.chat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px; }
.chat-chips button {
  font-size: 12.5px; font-weight: 600; padding: 9px 15px;
  border: 1px solid var(--hair-d); border-radius: 999px; color: var(--grey);
  transition: all .2s;
}
.chat-chips button:hover { border-color: var(--lime); color: var(--white); }

.chat-input { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--hair-d); }
.chat-input input {
  flex: 1; background: var(--carbon); border: 1px solid var(--hair-d); border-radius: 999px;
  padding: 12px 18px; color: var(--white); font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .2s;
}
.chat-input input:focus { border-color: var(--lime); }
.chat-input button {
  width: 44px; height: 44px; border-radius: 50%; background: var(--lime); color: var(--carbon);
  font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform .2s;
}
.chat-input button:hover { transform: scale(1.08); }
.chat-input button:disabled { opacity: .5; cursor: default; transform: none; }
.chat-legal { text-align: center; padding: 0 14px 12px; font-size: 10.5px; color: var(--grey-d); }

@media (max-width: 560px) {
  .chat-fab { bottom: 18px; right: 18px; }
  /* inset:0 por sí solo ya obliga a un fixed a cubrir el viewport real;
     no mezclar con width/height en vw/dvh, que en algunos motores
     se resuelven contra una base distinta y dejan el panel a medias. */
  .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: none; }
}
