/* wa-bot.css — UI de WhatsApp para el prototipo del bot CobraNow.
   Tema claro/oscuro del chat via .wa-chat[data-wamode="dark"] */

.wa-chat {
  --wab-bg: #EFE7DC;
  --wab-header: #075E54;
  --wab-header-ink: #ffffff;
  --wab-in: #ffffff;
  --wab-out: #D9FDD3;
  --wab-ink: #111b21;
  --wab-ink-2: #667781;
  --wab-blue: #0086d3;
  --wab-pill: rgba(255,255,255,0.92);
  --wab-composer: #f0f2f5;
  --wab-input: #ffffff;
  height: 100%; display: flex; flex-direction: column;
  background: var(--wab-bg); position: relative;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
}
.wa-chat[data-wamode="dark"] {
  --wab-bg: #0b141a;
  --wab-header: #1f2c34;
  --wab-header-ink: #e9edef;
  --wab-in: #1f2c34;
  --wab-out: #005c4b;
  --wab-ink: #e9edef;
  --wab-ink-2: #8696a0;
  --wab-blue: #53bdeb;
  --wab-pill: rgba(31,44,52,0.95);
  --wab-composer: #1f2c34;
  --wab-input: #2a3942;
}

/* header */
.wa-head {
  background: var(--wab-header); color: var(--wab-header-ink);
  padding: 58px 14px 10px; display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.wa-head .av {
  width: 36px; height: 36px; border-radius: 999px; background: #0c1a12;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  flex-shrink: 0;
}
.wa-head .av img { width: 30px; height: 30px; object-fit: contain; }
.wa-head .nm { font-size: 15.5px; font-weight: 600; letter-spacing: -0.2px; display: flex; align-items: center; gap: 5px; }
.wa-head .st { font-size: 11.5px; opacity: 0.78; }

/* scroll de mensajes */
.wa-scroll {
  flex: 1; overflow-y: auto; padding: 14px 12px 10px;
  display: flex; flex-direction: column; gap: 7px;
  scrollbar-width: none;
}
.wa-scroll::-webkit-scrollbar { display: none; }
.wa-scroll.pad { padding-bottom: 100px; }

/* pills de fecha/hora */
.wa-pill {
  align-self: center; background: var(--wab-pill);
  border-radius: 8px; padding: 4px 12px; margin: 6px 0 2px;
  font-size: 11px; font-weight: 600; color: var(--wab-ink-2);
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

/* burbujas */
.wa-msg { display: flex; flex-direction: column; max-width: 86%; }
.wa-msg.in { align-self: flex-start; align-items: flex-start; }
.wa-msg.out { align-self: flex-end; align-items: flex-end; }
.wa-bubble {
  position: relative; border-radius: 10px; padding: 7px 10px 6px;
  font-size: 13.8px; line-height: 1.42; color: var(--wab-ink);
  box-shadow: 0 1px 1px rgba(0,0,0,0.09);
  white-space: pre-wrap; overflow-wrap: break-word;
}
.wa-msg.in .wa-bubble { background: var(--wab-in); border-top-left-radius: 3px; }
.wa-msg.out .wa-bubble { background: var(--wab-out); border-top-right-radius: 3px; }
.wa-time {
  font-size: 10.5px; color: var(--wab-ink-2);
  float: right; margin: 8px -3px 0 9px; user-select: none;
}
.wa-msg-enter { animation: waIn 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes waIn {
  from { transform: translateY(12px) scale(0.97); }
  to { transform: none; }
}

/* reenviado */
.wa-fwd-tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-style: italic; color: var(--wab-ink-2); margin-bottom: 3px;
}

/* botones de respuesta rápida (estilo WhatsApp Business) */
.wa-replies { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; width: 100%; min-width: 230px; }
.wa-reply-btn {
  background: var(--wab-in); border: none; border-radius: 8px;
  padding: 9px 12px; font-size: 13.5px; font-weight: 500;
  color: var(--wab-blue); cursor: pointer; font-family: inherit;
  box-shadow: 0 1px 1px rgba(0,0,0,0.09);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: filter 0.15s, opacity 0.2s;
}
.wa-reply-btn:hover:not(:disabled) { filter: brightness(0.96); }
.wa-reply-btn:active:not(:disabled) { transform: scale(0.98); }
.wa-reply-btn:disabled { opacity: 0.45; cursor: default; }
.wa-reply-btn.chosen { opacity: 1; color: var(--wab-ink-2); font-weight: 600; }
.wa-reply-btn.chosen::before { content: '✓ '; }

/* typing */
.wa-typing { display: inline-flex; gap: 4px; padding: 12px 14px; align-items: center; }
.wa-typing span {
  width: 7px; height: 7px; border-radius: 999px; background: var(--wab-ink-2);
  animation: waDot 1.2s ease-in-out infinite;
}
.wa-typing span:nth-child(2) { animation-delay: 0.15s; }
.wa-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes waDot {
  0%, 60%, 100% { opacity: 0.35; transform: none; }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* nota de voz */
.wa-audio { display: flex; align-items: center; gap: 9px; min-width: 215px; padding: 4px 2px 2px; }
.wa-audio .play {
  width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.wa-audio .wave { display: flex; align-items: center; gap: 2px; flex: 1; height: 24px; }
.wa-audio .wave i {
  width: 2.6px; border-radius: 2px; background: var(--wab-ink-2); opacity: 0.75; display: block;
}
.wa-audio .mic {
  width: 34px; height: 34px; border-radius: 999px; overflow: hidden; flex-shrink: 0;
  background: #E1BEE7; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #7B1FA2; position: relative;
}
.wa-audio .mic svg { position: absolute; bottom: -1px; right: -1px; }
.wa-transcript {
  font-size: 12px; font-style: italic; color: var(--wab-ink-2);
  border-top: 1px solid rgba(134,150,160,0.25); margin-top: 6px; padding-top: 5px;
}

/* imagen (screenshot / recibo / gráfica) */
.wa-img-frame { border-radius: 8px; overflow: hidden; margin: -3px -6px 4px; }

/* composer */
.wa-composer-zone { flex-shrink: 0; position: relative; padding-bottom: 26px; background: transparent; }
.wa-chips {
  position: absolute; bottom: 100%; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0 12px 10px;
}
.wa-chips-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--wab-ink-2); background: var(--wab-pill); padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
.wa-chip-btn {
  background: var(--green); color: #fff; border: none; border-radius: 999px;
  padding: 11px 20px; font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; box-shadow: 0 6px 18px color-mix(in oklab, var(--green) 45%, transparent);
  display: inline-flex; align-items: center; gap: 8px;
  animation: chipIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.15s, box-shadow 0.2s;
}
.wa-chip-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px color-mix(in oklab, var(--green) 55%, transparent); }
.wa-chip-btn:active { transform: scale(0.97); }
@keyframes chipIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.wa-composer {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--wab-composer);
}
.wa-input {
  flex: 1; background: var(--wab-input); border-radius: 999px;
  padding: 9px 16px; font-size: 13.5px; color: var(--wab-ink-2);
  display: flex; align-items: center; gap: 8px;
}
.wa-icon-btn { color: var(--wab-ink-2); display: flex; flex-shrink: 0; }

/* toast dentro del teléfono */
.wa-toast {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(17,27,33,0.92); color: #fff; font-size: 12.5px; font-weight: 500;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap; z-index: 30;
  animation: chipIn 0.3s ease;
}

/* celebración */
.wa-celebrate { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 25; }
.wa-celebrate i {
  position: absolute; top: -24px; font-size: 18px; font-style: normal;
  animation: confetti 1.6s ease-in forwards;
}
@keyframes confetti {
  to { transform: translateY(840px) rotate(420deg); opacity: 0.9; }
}

/* ── Página del prototipo ── */
.bot-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); }
.bot-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 28px; background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(180%);
}
.bot-topbar .cn-nav-brand img { height: 30px; }
.bot-topbar-title { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.bot-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 56px; padding: 28px 32px;
}
.bot-phone-col { display: flex; justify-content: center; }
.bot-panel {
  width: 400px; max-width: 42vw; display: flex; flex-direction: column; gap: 18px;
}
.bot-panel-h {
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.12;
  margin: 4px 0 0; color: var(--ink); text-wrap: balance;
}
.bot-panel-lead { font-size: 16px; line-height: 1.5; color: var(--ink-2); margin: 4px 0 6px; max-width: 380px; }
.bot-toggle {
  display: flex; gap: 6px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; width: fit-content;
}
.bot-toggle-btn {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  padding: 9px 20px; border-radius: 999px; transition: all 0.2s;
}
.bot-toggle-btn.on { background: var(--green); color: #fff; box-shadow: 0 4px 14px color-mix(in oklab, var(--green) 35%, transparent); }
.bot-toggle-btn:not(.on):hover { color: var(--ink); }
.bot-case {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 22px 24px; box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  animation: noteIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.bot-case h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.bot-case p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.bot-replay {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--green-ink); cursor: pointer; transition: background 0.2s;
}
.bot-replay:hover { background: color-mix(in oklab, var(--green) 8%, transparent); }
.bot-metrics { display: flex; gap: 10px; }
.bot-metric {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.bot-metric .v { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.bot-metric .v.accent { color: var(--green-ink); }
.bot-metric .l { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.bot-note {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px 22px; box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 9px; align-items: flex-start;
  animation: noteIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 178px;
}
@keyframes noteIn {
  from { transform: translateY(12px); }
  to { transform: none; }
}
.bot-stage {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
}
.bot-note h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.bot-note p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.bot-constraint {
  display: flex; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-top: 2px;
}
.bot-constraint b { color: var(--ink); }
.bot-loop { display: flex; gap: 6px; }
.bot-loop-step {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 4px; transition: all 0.3s;
}
.bot-loop-step .dot { width: 7px; height: 7px; border-radius: 999px; opacity: 0.45; transition: opacity 0.3s; }
.bot-loop-step.on { color: var(--ink); border-color: color-mix(in oklab, var(--green) 40%, transparent); box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.bot-loop-step.on .dot { opacity: 1; }
.bot-progress { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--ink-3); }
.bot-progress .bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bot-progress .fill { height: 100%; border-radius: 99px; background: var(--green); transition: width 0.5s cubic-bezier(0.16,1,0.3,1); }

@media (max-width: 1000px) {
  .bot-main { flex-direction: column; gap: 28px; }
  .bot-panel { max-width: 92vw; width: 480px; }
  .bot-topbar-title { display: none; }
}
