/* =========================================================
   TANTALLA — demo.css
   Componentes nuevos para la propuesta de mejora (demo.html).
   Reutiliza los tokens y la base visual de styles.css: mismo
   fondo oscuro, mismo acento verde lima, misma tipografía.
   ========================================================= */

/* ---------- Cinta de aviso de versión de prueba ---------- */
.demo-ribbon {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1100;
  background: var(--accent-dark);
  color: #f6f8ee;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 9px 16px;
}
/* Estos tres ajustes (+36px) solo aplican si la cinta de aviso está
   presente en la página: en index.html no existe, así que el navbar,
   el menú móvil y el hero vuelven a sus valores normales de styles.css. */
body:has(.demo-ribbon) .navbar { top: 36px; }

/* ---------- Modo claro ---------- */
html[data-theme="light"] {
  --bg: #f7f7f3;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f1e6;
  --border: #dfe1d3;
  --border-soft: #e8e9df;
  --text: #14150f;
  --text-muted: #4b4e42;
  --text-dim: #7c7f72;
  --accent-text: #5c6b28;
  --shadow-soft: 0 20px 45px -22px rgba(20, 22, 15, 0.22);
}
html[data-theme="light"] .navbar { background: rgba(255, 255, 255, 0.78); }
html[data-theme="light"] .navbar.scrolled { background: rgba(255, 255, 255, 0.92); }

/* ---------- Logo según el tema (navbar y footer) ---------- */
.logo-black { display: none; }
.logo-white { display: block; }
html[data-theme="light"] .logo-black { display: block; }
html[data-theme="light"] .logo-white { display: none; }

/* ---------- Selector de tema ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-text); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Selector de idioma ---------- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent-text); }

body:has(.demo-ribbon) .mobile-menu { inset: 112px 0 0 0; }
body:has(.demo-ribbon) .hero { padding-top: 204px; }
@media (max-width: 640px) {
  .demo-ribbon { font-size: 11.5px; padding: 8px 12px; }
}

/* ---------- Mockup de teléfono / WhatsApp ---------- */
.phone-frame {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 16px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: var(--shadow-soft);
}
.phone-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.phone-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(182, 207, 82, 0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.phone-avatar img { width: 62%; height: 62%; object-fit: contain; }
.phone-header strong { display: block; font-family: var(--font-display); font-size: 14.5px; color: var(--text); }
.phone-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.phone-status .dot-pulse { width: 6px; height: 6px; }

.phone-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 230px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
}
.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  animation: msgIn 0.35s ease both;
  word-break: break-word;
}
.msg-in {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg-out {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-contrast);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.phone-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.phone-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.phone-typing span:nth-child(2) { animation-delay: 0.15s; }
.phone-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Hero: el phone-frame reemplaza la imagen estática */
.hero .hero-visual {
  height: auto;
  padding: 36px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
}
@media (max-width: 979px) { .hero .hero-visual { padding: 28px 16px; } }

/* ---------- Antes / Después ---------- */
.compare-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 860px) { .compare-grid { grid-template-columns: 1fr auto 1fr; } }
.compare-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.compare-label { font-family: var(--font-display); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.compare-before .compare-label { color: #e07a6b; }
.compare-after .compare-label { color: var(--accent-text); }
.compare-msg { font-size: 14px; color: var(--text-muted); border-bottom: 1px solid var(--border-soft); padding-bottom: 10px; }
.compare-msg:last-child { border-bottom: none; padding-bottom: 0; }
.compare-msg.accent { color: var(--text); font-weight: 500; font-size: 15px; }
.compare-time { display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.compare-arrow { display: flex; align-items: center; justify-content: center; color: var(--accent-text); }
.compare-arrow svg { width: 26px; height: 26px; }
@media (max-width: 859px) { .compare-arrow { transform: rotate(90deg); margin: 2px 0; } }

/* ---------- Simulador interactivo ---------- */
.sim-wrap { display: grid; gap: 36px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .sim-wrap { grid-template-columns: 380px 1fr; align-items: center; } }
.sim-controls { display: flex; flex-direction: column; gap: 16px; }
.sim-hint { font-family: var(--font-display); font-size: 14px; color: var(--text-muted); margin: 0; }
.sim-quick { display: flex; flex-wrap: wrap; gap: 10px; }
.sim-quick button {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  font-family: var(--font-body);
}
.sim-quick button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); transform: translateY(-2px); }
.sim-quick button:disabled { opacity: 0.5; cursor: default; }
.sim-reset {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}
.sim-reset:hover { color: var(--accent-text); }

/* ---------- Casos de uso por industria ---------- */
.industry-tab-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.industry-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.industry-tab-btn svg { width: 16px; height: 16px; }
.industry-tab-btn.active { border-color: var(--accent); color: var(--accent-contrast); background: var(--accent); }
.industry-panel {
  display: none;
  grid-template-columns: 1fr;
  gap: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.industry-panel.active { display: grid; }
@media (min-width: 800px) { .industry-panel { grid-template-columns: 0.9fr 1.1fr; align-items: center; } }
.industry-chat { display: flex; flex-direction: column; gap: 10px; }
.industry-info h3 { font-size: 20px; color: var(--text); margin-bottom: 14px; }
.industry-info ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.industry-info li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text-muted); }
.industry-info li svg { width: 18px; height: 18px; color: var(--accent-text); flex-shrink: 0; margin-top: 2px; }
.industry-more { margin-top: 26px; text-align: center; color: var(--text-dim); font-size: 14px; }
.industry-more strong { color: var(--text-muted); }

/* ---------- Precios ---------- */
.pricing-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; } }
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pricing-card.highlight { border-color: var(--accent-dark); background: linear-gradient(160deg, rgba(182,207,82,0.08), var(--bg-card) 55%); }
.pricing-badge {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.pricing-card h3 { font-size: 19px; color: var(--text); margin-bottom: 6px; }
.pricing-value { font-family: var(--font-display); font-size: 26px; color: var(--accent-text); margin-bottom: 14px; }
.pricing-value strong { font-size: 32px; }
.pricing-card > p { font-size: 14px; margin-bottom: 20px; }
.pricing-card ul { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pricing-card li { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-muted); }
.pricing-card li svg { width: 17px; height: 17px; color: var(--accent-text); flex-shrink: 0; margin-top: 2px; }
.pricing-note { text-align: center; margin-top: 22px; font-size: 12.5px; color: var(--text-dim); }

/* ---------- Insignia de marca en CTA final ---------- */
.cta-brand-badge {
  width: 54px; height: 54px;
  border-radius: 16px;
  background: rgba(182, 207, 82, 0.14);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  overflow: hidden;
}
.cta-brand-badge img { width: 60%; height: 60%; object-fit: contain; }

@media (max-width: 640px) {
  .phone-frame { max-width: 100%; }
  .pricing-card, .industry-panel, .compare-col { padding: 24px; }
}

/* ---------- Mascota "Tantí" ---------- */
@keyframes botFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.hero .hero-visual { overflow: visible; }
.hero-visual .hero-bot {
  position: absolute;
  left: -34px;
  bottom: -18px;
  width: 132px;
  height: auto;
  z-index: 2;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.35));
  animation: botFloat 5s ease-in-out infinite;
  pointer-events: none;
}
.hero-visual .tanti-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  box-shadow: var(--shadow-soft);
  animation: botFloat 5s ease-in-out infinite;
  animation-delay: 0.4s;
}
.hero-visual .tanti-badge img { width: 34px; height: 34px; object-fit: contain; opacity: 1; border-radius: 50%; background: rgba(182,207,82,0.14); }
.tanti-badge strong { display: block; font-family: var(--font-display); font-size: 12.5px; color: var(--text); }
.tanti-badge span { font-size: 11px; color: var(--text-dim); }
@media (max-width: 640px) {
  .hero-visual .hero-bot { width: 92px; left: -10px; bottom: -8px; }
  .hero-visual .tanti-badge { top: 10px; right: 10px; padding: 6px 12px 6px 6px; }
  .tanti-badge span { display: none; }
}

.problem-grid { position: relative; }
.problem-bot {
  position: absolute;
  top: -86px;
  right: 0;
  width: 108px;
  animation: botFloat 6s ease-in-out infinite;
  pointer-events: none;
}
@media (max-width: 900px) { .problem-bot { display: none; } }

.steps-wrap { position: relative; }
.steps-bot {
  position: absolute;
  top: -74px;
  right: 0;
  width: 110px;
  animation: botFloat 5.5s ease-in-out infinite;
  pointer-events: none;
}
@media (max-width: 940px) { .steps-bot { display: none; } }
/* Esta mascota es blanca/menta, pensada para fondo oscuro: en modo claro
   necesita un respaldo suave para no perderse contra el fondo claro. */
html[data-theme="light"] .steps-bot {
  background: radial-gradient(circle, rgba(20,21,15,0.08) 0%, rgba(20,21,15,0) 72%);
  filter: drop-shadow(0 10px 16px rgba(20,21,15,0.18));
}

/* ---------- Misión ---------- */
.mission-band { padding: 12px 0 4px; }
.mission-line {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 22px);
  color: var(--text);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.5;
}
.mission-line .eyebrow { display: flex; width: fit-content; margin: 0 auto 10px; }

/* ---------- Qué puede automatizar ---------- */
.automation-table { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 780px) { .automation-table { grid-template-columns: repeat(3, 1fr); } }
.automation-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}
.automation-col h3 {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.automation-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.automation-col li { font-size: 14.5px; color: var(--text-muted); }
