/* Moezza Chat Widget — VÉRTICE Productions */
:root {
  --mz-cyan:    #00F0FF;
  --mz-purple:  #A855F7;
  --mz-bg:      rgba(10,10,15,0.96);
  --mz-surface: rgba(255,255,255,0.04);
  --mz-border:  rgba(168,85,247,0.25);
  --mz-text:    rgba(255,255,255,0.88);
  --mz-dim:     rgba(255,255,255,0.45);
  --mz-radius:  18px;
}

#mz-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 14px;
}

/* ── FAB ──────────────────────────────────────────────────────── */
#mz-fab {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1.5px solid var(--mz-border);
  background: rgba(10,10,15,0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.15),
    0 8px 32px rgba(168,85,247,0.20),
    0 0 0 0 rgba(168,85,247,0.4);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: mz-pulse-ring 3s ease-in-out infinite;
}
#mz-fab:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.30),
    0 12px 40px rgba(168,85,247,0.35),
    0 0 32px rgba(0,240,255,0.12);
  animation: none;
}
@keyframes mz-pulse-ring {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(168,85,247,0.15),
      0 8px 32px rgba(168,85,247,0.20),
      0 0 0 0 rgba(168,85,247,0.4);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(168,85,247,0.25),
      0 8px 32px rgba(168,85,247,0.28),
      0 0 0 8px rgba(168,85,247,0.0);
  }
}

#mz-fab video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
#mz-fab-fallback {
  display: none;
  width: 36px;
  height: 36px;
  color: var(--mz-cyan);
}

/* ── Panel ─────────────────────────────────────────────────────── */
#mz-panel {
  position: absolute;
  bottom: 84px;
  right: 0;
  width: 340px;
  display: flex;
  flex-direction: column;
  background: var(--mz-bg);
  border: 1px solid var(--mz-border);
  border-radius: var(--mz-radius);
  box-shadow:
    0 32px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(168,85,247,0.08),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
}
#mz-panel.mz-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ────────────────────────────────────────────────────── */
#mz-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(168,85,247,0.12);
  background: rgba(168,85,247,0.04);
}
#mz-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(168,85,247,0.30);
  flex-shrink: 0;
  position: relative;
}
#mz-avatar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#mz-header-info {
  flex: 1;
  min-width: 0;
}
#mz-header-info .mz-name {
  font-weight: 600;
  color: var(--mz-text);
  font-size: 13.5px;
  line-height: 1.2;
}
#mz-header-info .mz-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  color: var(--mz-dim);
  margin-top: 2px;
}
#mz-header-info .mz-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px rgba(16,185,129,0.7);
  animation: mz-blink 2s ease-in-out infinite;
}
@keyframes mz-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
#mz-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--mz-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
#mz-close:hover {
  color: var(--mz-text);
  background: rgba(255,255,255,0.06);
}

/* ── Badge vertical etiqueta ───────────────────────────────────── */
#mz-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(168,85,247,0.08);
  background: rgba(168,85,247,0.03);
}
#mz-badge span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--mz-purple);
  text-transform: uppercase;
}
#mz-badge::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mz-purple);
  flex-shrink: 0;
}

/* ── Mensajes ──────────────────────────────────────────────────── */
#mz-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,0.15) transparent;
}
#mz-messages::-webkit-scrollbar { width: 3px; }
#mz-messages::-webkit-scrollbar-thumb {
  background: rgba(168,85,247,0.2);
  border-radius: 2px;
}

.mz-msg {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 13px;
  line-height: 1.55;
  font-size: 13.5px;
}
.mz-msg.mz-bot {
  background: rgba(255,255,255,0.05);
  color: var(--mz-text);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.mz-msg.mz-user {
  background: linear-gradient(135deg, rgba(168,85,247,0.7), rgba(0,240,255,0.5));
  color: rgba(255,255,255,0.95);
  font-weight: 500;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

/* ── Form ──────────────────────────────────────────────────────── */
#mz-form-wrap {
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(168,85,247,0.10);
  background: rgba(168,85,247,0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#mz-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
#mz-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(168,85,247,0.20);
  border-radius: 10px;
  color: var(--mz-text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  height: 40px;
  line-height: 1.4;
}
#mz-input:focus { border-color: rgba(168,85,247,0.50); }
#mz-input::placeholder { color: var(--mz-dim); }
#mz-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #A855F7, #00F0FF);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
#mz-send:hover { opacity: 0.85; transform: scale(1.04); }
#mz-send:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
#mz-send svg { color: #fff; }
#mz-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--mz-dim);
  text-align: center;
}

/* ── Móvil ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #mz-panel {
    width: calc(100vw - 20px);
    right: 0;
    bottom: 88px;
  }
  #mz-widget {
    bottom: 16px;
    right: 12px;
  }
  #mz-fab {
    width: 64px;
    height: 64px;
  }
}
