:root {
  --primary: #10B981; /* Esmeralda Vibrante */
  --primary-glow: rgba(16, 185, 129, 0.4);
  --accent: #F59E0B; /* Ámbar Eléctrico */
  --bg-deep: #050507;
  --bg-oled: #000000;
  --bg-card: #121318;
  --bg-bubble-bot: #1A1C24;
  --bg-bubble-user: #10B981;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.12);
  --watch-case: #1e2029;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Fondo con resplandor ambiental y glassmorphism en pantallas grandes */
.ambient-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(59, 130, 246, 0.08) 50%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  filter: blur(40px);
}

/* Wrapper Limpio de Pantalla / Chat */
.clean-chat-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1.5rem 1rem;
}

/* Contenedor Minimalista (Sin marcos redundantes ni horas) */
.clean-chat-card {
  width: 100%;
  max-width: 540px;
  height: 660px;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 35px rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Contenedor Principal IA */
.ai-app-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 6px 12px 12px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #059669);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  color: #000;
  box-shadow: 0 0 15px var(--primary-glow);
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-avatar {
  animation: pulse-ring 3s infinite;
}

.app-title h3 {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-title h3 span {
  font-size: 0.68rem;
  background: var(--accent);
  color: #000;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-tag .dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
}

/* Chat Área y Mensajes */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

/* Personalización barra de scroll micro */
.chat-area::-webkit-scrollbar {
  width: 3px;
}
.chat-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.bubble {
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 95%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.bot-bubble {
  background: var(--bg-bubble-bot);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--text-main);
}

.user-bubble {
  background: var(--bg-bubble-user);
  color: #000;
  font-weight: 600;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bot-bubble p {
  margin-bottom: 6px;
}

.bot-bubble p:last-child {
  margin-bottom: 0;
}

/* Caja de oferta micro en el chat */
.offer-micro-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 8px 10px;
  border-radius: 10px;
  margin: 8px 0;
  font-size: 0.78rem;
}

.offer-micro-box ul {
  list-style: none;
  padding-left: 2px;
  margin-top: 4px;
  margin-bottom: 6px;
}

.offer-micro-box li {
  margin-bottom: 3px;
  line-height: 1.25;
}

/* Formulario Micro de Captura */
.input-container {
  display: flex;
  flex-direction: column;
}

#lead-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.micro-input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}

.micro-input:focus {
  border-color: var(--primary);
}

.btn-micro-cta {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: transform 0.15s, filter 0.15s;
}

.btn-micro-cta:active {
  transform: scale(0.96);
}

/* Opciones de pago compactas para micro pantallas */
.payment-card {
  background: #181a22;
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 8px;
}

.payment-header {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-pay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 5px;
  transition: transform 0.2s;
  color: #fff;
}

.btn-pay:last-child {
  margin-bottom: 0;
}

.card-pay {
  background: #3B82F6;
}

.ws-pay {
  background: var(--primary);
  color: #000;
  font-weight: 800;
}

/* Input del chat */
.chat-footer {
  display: flex;
  gap: 6px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
}

.chat-text-input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: #fff;
  font-size: 0.8rem;
  outline: none;
}

.chat-text-input:focus {
  border-color: var(--primary);
}

.btn-send {
  background: var(--primary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #000;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

/* Respuestas Rápidas (Chips Touch y Dictado) */
.quick-replies {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-hint {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  padding-left: 4px;
}

.chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #F8FAFC;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  line-height: 1.25;
}

.quick-chip:hover, .quick-chip:active {
  background: var(--primary);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Row de inputs en formulario inicial */
.inputs-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

/* ========================================================
   ADAPTACIÓN EXTREMA PARA PANTALLAS MÓVILES & PREVIEWS
   ======================================================== */
@media screen and (max-width: 600px) {
  .clean-chat-wrapper {
    padding: 0 !important;
    width: 100vw;
    height: 100vh;
  }
  .clean-chat-card {
    max-width: 100%;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  .ambient-glow {
    display: none !important;
  }
  .ai-app-container {
    padding: 10px 14px;
  }
  .bubble {
    font-size: 0.88rem;
    padding: 10px 14px;
  }
  .quick-chip {
    font-size: 0.8rem;
    padding: 8px 12px;
  }
}

/* Adaptación para pantallas micro compactas (240px - 320px) */
@media screen and (max-width: 320px) {
  .ai-app-container {
    padding: 6px 8px;
  }
  .app-title h3 {
    font-size: 0.85rem;
  }
  .app-title h3 span {
    font-size: 0.62rem;
  }
  .bubble {
    font-size: 0.78rem;
    padding: 8px 10px;
  }
  .offer-micro-box {
    font-size: 0.72rem;
    padding: 6px 8px;
  }
  .micro-input, .chat-text-input {
    font-size: 0.78rem;
    padding: 8px 10px;
  }
  .quick-chip {
    font-size: 0.72rem;
    padding: 6px 8px;
  }
}
