/* Piezas propias de Agentazo sobre el sistema del template (NextSaaS).
   El template activa el modo oscuro con la clase .dark en <html>. */

:root {
  --cb-surface: #ffffff;
  --cb-surface-2: #f4f5f8;
  --cb-ink: #1a1a1c;
  --cb-ink-2: rgba(26, 26, 28, 0.62);
  --cb-line: #e6e7ec;
  --cb-brand: #864ffe;
  --cb-brand-soft: #efe8ff;
  --cb-ok: #16a37f;
  --cb-ok-soft: #e1f6ee;
  --cb-shadow: 0 1px 2px rgba(20, 20, 30, 0.05), 0 18px 40px -18px rgba(40, 30, 120, 0.28);
  --cb-wa: linear-gradient(140deg, #45e27a, #12a150);
  --cb-ig: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  --cb-fb: linear-gradient(140deg, #3ab0ff, #6b4cff 60%, #ff5c87);
  --cb-mp: linear-gradient(140deg, #3ec6ff, #0a84d6);
  --cb-logo: linear-gradient(135deg, #6cb4ee 0%, #864ffe 100%);
}
.dark {
  --cb-surface: #262d39;
  --cb-surface-2: #1f252f;
  --cb-ink: #fcfcfc;
  --cb-ink-2: rgba(252, 252, 252, 0.62);
  --cb-line: #343c4a;
  --cb-brand: #a684ff;
  --cb-brand-soft: #2d2752;
  --cb-ok: #3ccf9f;
  --cb-ok-soft: #133229;
  --cb-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.6);
}

/* ---------- Logo ---------- */
.cb-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; letter-spacing: -0.03em; color: var(--cb-ink); text-decoration: none; }
.cb-logo-mark { width: 40px; height: 40px; border-radius: 13px; background: var(--cb-logo); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(134, 79, 254, 0.7); flex-shrink: 0; }
.cb-logo b { font-weight: 700; background: var(--cb-logo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cb-logo.on-dark { color: #fcfcfc; }

/* ---------- Íconos de canales ---------- */
.cb-ico { width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; color: #fff; flex-shrink: 0; }
.cb-ico svg { width: 24px; height: 24px; }
.cb-ico.wa { background: var(--cb-wa); }
.cb-ico.ig { background: var(--cb-ig); }
.cb-ico.fb { background: var(--cb-fb); }
.cb-ico.mp { background: var(--cb-mp); }
.cb-ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.cb-ico.sm svg { width: 17px; height: 17px; }
.cb-ico.lg { width: 64px; height: 64px; border-radius: 20px; }
.cb-ico.lg svg { width: 34px; height: 34px; }

/* ---------- Chat del inicio ---------- */
.cb-hero-visual { position: relative; max-width: 1060px; margin: 0 auto; }
/* Borde degradado: el fondo del chat va en padding-box y el degradado en border-box */
.cb-chat {
  --chat-bg: #efe7dd;
  position: relative; z-index: 2; max-width: 430px; margin: 0 auto; border-radius: 28px; overflow: hidden;
  border: 3px solid transparent;
  background: linear-gradient(var(--chat-bg), var(--chat-bg)) padding-box, linear-gradient(140deg, #83e7ee, #864ffe 50%, #f9eb57) border-box;
  box-shadow: var(--cb-shadow);
}
.dark .cb-chat { --chat-bg: #0b141a; }
.cb-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #075e54; color: #fff; text-align: left; }
.dark .cb-chat-head { background: #1f2c34; }
.cb-chat-head .av { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 20px; }
.cb-chat-head b { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; }
.cb-chat-head small { font-size: 12px; opacity: 0.75; }
.cb-chat-body {
  height: 400px; padding: 16px 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; overflow: hidden;
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px); background-size: 14px 14px;
}
.dark .cb-chat-body { background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px); }
.cb-msg {
  max-width: 82%; padding: 8px 12px; font-size: 14.5px; line-height: 1.4; text-align: left; white-space: pre-line;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); animation: cb-pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cb-msg.cli { align-self: flex-end; background: #d9fdd3; color: #111; border-radius: 14px 4px 14px 14px; }
.cb-msg.bot { align-self: flex-start; background: #fff; color: #111; border-radius: 4px 14px 14px 14px; }
.dark .cb-msg.cli { background: #005c4b; color: #e9edef; }
.dark .cb-msg.bot { background: #202c33; color: #e9edef; }
.cb-msg .pay {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 9px; border-radius: 10px;
  background: #009ee3; color: #fff; font-weight: 600; font-size: 14px;
}
.cb-msg.ok { align-self: center; background: var(--cb-ok); color: #fff; border-radius: 99px; font-size: 13px; font-weight: 600; padding: 6px 14px; }
.cb-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.cb-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8a8a8a; animation: cb-dots 1.2s infinite; }
.cb-typing i:nth-child(2) { animation-delay: 0.15s; }
.cb-typing i:nth-child(3) { animation-delay: 0.3s; }

/* Avisos flotantes alrededor del chat */
.cb-float {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; text-align: left;
  background: var(--cb-surface); color: var(--cb-ink); box-shadow: var(--cb-shadow); font-size: 13.5px; white-space: nowrap;
  animation: cb-flota 7s ease-in-out infinite;
}
.cb-float b { display: block; font-weight: 600; font-size: 14px; }
.cb-float small { color: var(--cb-ink-2); font-size: 12px; }
.cb-float .em { font-size: 22px; }
.cb-float.f1 { left: 0; top: 14%; }
.cb-float.f2 { right: 0; top: 38%; animation-delay: -2s; }
.cb-float.f3 { left: 3%; bottom: 12%; animation-delay: -4s; }
@media (max-width: 860px) { .cb-float { display: none; } }

/* ---------- Problema: mensajes sin responder ---------- */
.cb-unread { display: flex; flex-direction: column; gap: 12px; max-width: 430px; margin-left: auto; }
.cb-unread-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--cb-surface); box-shadow: var(--cb-shadow);
}
.cb-unread-item:nth-child(2) { margin-left: 24px; opacity: 0.92; }
.cb-unread-item:nth-child(3) { margin-left: 48px; opacity: 0.8; }
.cb-unread-item:nth-child(4) { margin-left: 72px; opacity: 0.65; }
.cb-unread-item .txt { flex: 1; min-width: 0; }
.cb-unread-item b { display: block; font-size: 14.5px; font-weight: 600; color: var(--cb-ink); }
.cb-unread-item p { margin: 0; color: var(--cb-ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-unread-item time { font-size: 12px; color: #e5484d; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .cb-unread-item:nth-child(n) { margin-left: 0; } }

/* ---------- Calculadora ---------- */
.cb-calc { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.cb-calc-box { background: var(--cb-surface); border-radius: 24px; padding: 32px; box-shadow: var(--cb-shadow); }
.cb-field { margin-bottom: 26px; }
.cb-field:last-child { margin-bottom: 0; }
.cb-field label { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--cb-ink); margin-bottom: 10px; }
.cb-field label output { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--cb-brand); }
.cb-field input[type="range"] { width: 100%; accent-color: var(--cb-brand); cursor: pointer; }
.cb-field small { display: block; color: var(--cb-ink-2); font-size: 13px; margin-top: 6px; }
.cb-result { display: flex; flex-direction: column; justify-content: center; gap: 10px; background: #1a1a1c; color: #fcfcfc; position: relative; overflow: hidden; }
.dark .cb-result { background: #15191f; }
.cb-result::after {
  content: ""; position: absolute; width: 380px; height: 380px; right: -140px; bottom: -160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(134, 79, 254, 0.55), transparent 65%); pointer-events: none;
}
.cb-result .lbl { color: rgba(252, 252, 252, 0.7); font-size: 15px; }
.cb-result .big { font-size: clamp(38px, 5vw, 58px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cb-result .vs { margin-top: 10px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.12); color: rgba(252, 252, 252, 0.8); font-size: 15px; position: relative; z-index: 1; }
.cb-result .vs b { color: #f9eb57; }
.cb-result .note { font-size: 12.5px; color: rgba(252, 252, 252, 0.5); position: relative; z-index: 1; }
@media (max-width: 900px) { .cb-calc { grid-template-columns: 1fr; } }

/* ---------- Pasos ---------- */
.cb-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: paso; }
.cb-step { position: relative; background: var(--cb-surface); border-radius: 20px; padding: 32px 28px; counter-increment: paso; }
.cb-step::before {
  content: counter(paso); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; margin-bottom: 22px;
  background: var(--cb-logo); color: #fff; font-weight: 600; font-size: 18px;
}
.cb-step h5 { margin-bottom: 8px; }
@media (max-width: 900px) { .cb-steps { grid-template-columns: 1fr; } }

/* ---------- Vistas previas del panel ---------- */
.cb-mock { background: var(--cb-surface-2); border-radius: 16px; padding: 16px; width: 100%; min-height: 230px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.dark .cb-mock { background: #1f252f; }
.cb-mock-card { background: var(--cb-surface); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--cb-ink); }
.cb-mock-row { display: flex; justify-content: space-between; gap: 10px; color: var(--cb-ink-2); font-variant-numeric: tabular-nums; }
.cb-mock-row b { color: var(--cb-ink); font-weight: 600; }
.cb-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--cb-ok-soft); color: var(--cb-ok); }
.cb-pill.brand { background: var(--cb-brand-soft); color: var(--cb-brand); }
.cb-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cb-bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-top: 6px; border-bottom: 1px solid var(--cb-line); }
.cb-bars span { flex: 1; background: var(--cb-brand); border-radius: 4px 4px 0 0; opacity: 0.85; }
.cb-inbox-row { display: flex; align-items: center; gap: 10px; }
.cb-inbox-row .txt { flex: 1; min-width: 0; }
.cb-inbox-row b { display: block; font-size: 13px; font-weight: 600; color: var(--cb-ink); }
.cb-inbox-row p { margin: 0; font-size: 12.5px; color: var(--cb-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Rubros ---------- */
.cb-emoji-tile { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 32px; background: var(--cb-brand-soft); }

/* ---------- Animaciones ---------- */
@keyframes cb-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes cb-dots { 30% { opacity: 1; transform: translateY(-3px); } 0%, 60%, 100% { opacity: 0.4; } }
@keyframes cb-flota { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) {
  .cb-msg, .cb-float, .cb-typing i { animation: none !important; }
}

/* ---------- Clases de utilidad que el CSS compilado del template no trae ---------- */
.-right-8 { right: -2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-\[60px\] { margin-bottom: 60px; }
.my-10 { margin-block: 2.5rem; }
.gap-\[60px\] { gap: 60px; }
.max-w-\[340px\] { max-width: 340px; }
.max-w-\[640px\] { max-width: 640px; }
.max-w-\[900px\] { max-width: 900px; }
.pb-\[60px\] { padding-bottom: 60px; }
.pt-\[150px\] { padding-top: 150px; }
.py-\[38px\] { padding-block: 38px; }
.ps-1\.5 { padding-inline-start: 0.375rem; }
.size-\[110px\] { width: 110px; height: 110px; }
.text-secondary\/70 { color: color-mix(in oklab, var(--color-secondary) 70%, transparent); }
.dark .dark\:text-accent\/70 { color: color-mix(in oklab, var(--color-accent) 70%, transparent); }
@media (min-width: 48rem) {
  .md\:gap-10 { gap: 2.5rem; }
  .md\:mb-10 { margin-bottom: 2.5rem; }
  .md\:mb-\[60px\] { margin-bottom: 60px; }
  .md\:my-16 { margin-block: 4rem; }
}
@media (min-width: 64rem) {
  .lg\:my-\[80px\] { margin-block: 80px; }
  .lg\:pb-\[110px\] { padding-bottom: 110px; }
  .lg\:pt-\[200px\] { padding-top: 200px; }
}
@media (min-width: 80rem) {
  .xl\:col-span-5 { grid-column: span 5 / span 5; }
  .xl\:col-span-7 { grid-column: span 7 / span 7; }
  .xl\:pb-\[140px\] { padding-bottom: 140px; }
}
