/* Estilos del widget "AgendaBot". Todo prefijado con .lex-widget para
   minimizar colisiones con los estilos del sitio anfitrión (WordPress).

   Paleta y tipografía tomadas del sitio principal (molinaypolancoabogados.cl):
   #6878d6 = color real de los botones de Elementor, #4d61d6 = color real de
   los links, #eff2ff = fondo suave ("ast-global-color-secondary"), Inter =
   fuente del body. Así el widget se siente parte del sitio en vez de un
   elemento pegado encima. */

.lex-widget * {
  box-sizing: border-box;
}

.lex-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --lex-primary: #6878d6;
  --lex-primary-dark: #4d61d6;
  --lex-subtle-bg: #eff2ff;
  --lex-border: #dbe0f7;
}

.lex-widget__bubble {
  position: relative;
  width: 60px !important;
  height: 60px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background: var(--lex-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(104, 120, 214, 0.45);
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lex-widget-breathe 2.6s ease-in-out infinite;
}

.lex-widget__bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(104, 120, 214, 0.5);
  animation: lex-widget-ping 2.6s ease-out infinite;
  pointer-events: none;
}

.lex-widget__bubble--paused,
.lex-widget__bubble--paused::after {
  animation: none;
}

.lex-widget__bubble:hover {
  background: var(--lex-primary-dark);
}

.lex-widget__bubble-badge {
  width: 56px;
  height: 56px;
  border-radius: 50% !important;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.lex-widget__bubble-logo {
  width: 54px;
  height: 54px;
  background-image: url("lex-icon.svg");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

@keyframes lex-widget-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes lex-widget-ping {
  0% { box-shadow: 0 0 0 0 rgba(104, 120, 214, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(104, 120, 214, 0); }
  100% { box-shadow: 0 0 0 0 rgba(104, 120, 214, 0); }
}

.lex-widget__panel {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 18px !important;
  box-shadow: 0 16px 40px rgba(104, 120, 214, 0.22), 0 2px 10px rgba(20, 20, 30, 0.08);
  overflow: hidden;
}

.lex-widget__panel.lex-widget__panel--open {
  display: flex;
}

.lex-widget__header {
  background: linear-gradient(135deg, var(--lex-primary), var(--lex-primary-dark));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lex-widget__header-title {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: 0.1px;
}

.lex-widget__header-subtitle {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

.lex-widget__close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50% !important;
  width: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lex-widget__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lex-widget__disclaimer {
  font-size: 11px;
  color: #5b5f82;
  background: var(--lex-subtle-bg);
  padding: 9px 14px;
  border-bottom: 1px solid var(--lex-border);
}

.lex-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbfbfe;
}

.lex-widget__msg {
  max-width: 85%;
  padding: 9px 13px !important;
  margin: 0 !important;
  border-radius: 14px !important;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.lex-widget__msg--bot {
  align-self: flex-start;
  background: var(--lex-subtle-bg);
  color: #1a1a2e;
  border-bottom-left-radius: 4px !important;
}

.lex-widget__msg--user {
  align-self: flex-end;
  background: var(--lex-primary);
  color: #fff;
  border-bottom-right-radius: 4px !important;
}

.lex-widget__card {
  align-self: stretch;
  background: #fff;
  border: 1px solid var(--lex-border);
  border-radius: 14px !important;
  padding: 12px 14px;
}

.lex-widget__slots-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.lex-widget__slots-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lex-widget__slot-btn {
  background: var(--lex-subtle-bg);
  border: 1px solid var(--lex-border);
  border-radius: 10px !important;
  padding: 6px 11px !important;
  margin: 0 !important;
  min-width: 0 !important;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--lex-primary-dark);
}

.lex-widget__slot-btn:hover {
  background: var(--lex-primary);
  color: #fff;
  border-color: var(--lex-primary);
}

.lex-widget__msg--blocked {
  border-left: 3px solid #b45309;
}

.lex-widget__sources {
  margin-top: 6px;
  font-size: 10.5px;
  opacity: 0.7;
}

.lex-widget__typing {
  align-self: flex-start;
  font-size: 12px;
  color: #7b81a8;
  padding: 0 4px;
}

.lex-widget__inputbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--lex-border);
  background: #fff;
}

.lex-widget .lex-widget__inputbar .lex-widget__textarea {
  flex: 1;
  resize: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 1px solid var(--lex-border) !important;
  border-radius: 10px !important;
  padding: 9px 11px !important;
  margin: 0 !important;
  min-height: 40px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  font-family: inherit !important;
  max-height: 80px;
}

.lex-widget__textarea:focus {
  outline: none;
  border-color: var(--lex-primary);
  box-shadow: 0 0 0 3px rgba(104, 120, 214, 0.15);
}

.lex-widget__send {
  background: var(--lex-primary);
  color: #fff;
  border: none;
  border-radius: 10px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  min-width: 0 !important;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.lex-widget__send:hover:not(:disabled) {
  background: var(--lex-primary-dark);
}

.lex-widget__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lex-widget__hint {
  font-size: 10.5px;
  color: #9a9ec2;
  padding: 0 10px 8px;
  background: #fff;
}
