/* "Tu cliente escribe" section: a phone with a WhatsApp-style conversation that plays when it scrolls into view. */

.chat-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px 96px;
}

.chat-copy {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.chat-copy .section-title {
  margin: 0;
}

.chat-points {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  border-bottom: 1px solid var(--line);
}

.chat-points li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 20px;
  color: var(--text-2);
}

.chat-points strong {
  color: var(--text);
}

.chat-plan {
  font-size: 15px;
  color: var(--muted);
}

.chat-plan a {
  color: var(--accent-text);
  font-weight: 700;
}

/* Phone */
.phone {
  position: relative;
  flex: 0 0 auto;
  width: min(320px, 100%);
  margin-inline: auto;
}

.phone::before {
  content: '';
  position: absolute;
  inset: 10% -20%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(61, 123, 255, 0.28), rgba(61, 123, 255, 0));
}

.phone-frame {
  overflow: hidden;
  border: 10px solid #1C1B26;
  border-radius: 44px;
  background: #0B141A;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.wa-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 16px 12px;
  background: #1F2C34;
  color: #E9EDEF;
}

.wa-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-fill);
  color: #fff;
  font-weight: 800;
}

.wa-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.wa-status {
  display: block;
  font-size: 12px;
  color: #8696A0;
}

.wa-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 430px;
  padding: 14px 12px 18px;
  background: #0B141A;
}

.wa-day {
  align-self: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: #182229;
  color: #8696A0;
  font-size: 12px;
}

.wa-msg {
  max-width: 82%;
  padding: 8px 10px 6px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: #E9EDEF;
}

.wa-msg p {
  margin: 0;
}

.wa-msg--in {
  align-self: flex-end;
  background: #005C4B;
  border-top-right-radius: 2px;
}

.wa-msg--out {
  align-self: flex-start;
  background: #202C33;
  border-top-left-radius: 2px;
}

.wa-slots {
  display: flex;
  gap: 6px;
  margin: 8px 0 6px;
}

.wa-slots span {
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(61, 123, 255, 0.18);
  color: #C9D6FF;
  font-size: 13px;
  font-weight: 700;
}

.wa-ok {
  color: #4BE0A0;
  font-weight: 700;
}

.wa-time {
  display: block;
  margin-top: 2px;
  text-align: right;
  font-size: 11px;
  color: #8696A0;
}

.wa-typing {
  align-self: flex-start;
  display: none;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #202C33;
}

.wa-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8696A0;
  animation: wa-dot 1s infinite ease-in-out;
}

.wa-typing span:nth-child(2) { animation-delay: 0.15s; }
.wa-typing span:nth-child(3) { animation-delay: 0.3s; }

.wa-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 14px;
  background: #0B141A;
}

.wa-input span {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  background: #202C33;
  color: #8696A0;
  font-size: 13px;
}

.wa-input i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #00A884;
}

/* Playback: JS reveals one step at a time. Steps are hidden only once JS has armed the chat,
   so without JS (or with reduced motion) the whole conversation is visible. */
.chat-armed [data-step] {
  display: none;
}

.chat-armed [data-step].is-shown {
  display: block;
  animation: wa-in 0.35s ease-out both;
}

.chat-armed .wa-typing.is-shown {
  display: flex;
}

@keyframes wa-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes wa-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 860px) {
  .phone::before {
    inset: 10% 0;
  }

  .chat-points li {
    font-size: 18px;
  }
}

/* Scenario tabs above the phone */
.chat-demo {
  flex: 0 1 380px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-inline: auto;
}

.chat-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chat-tabs button,
.sim-chips button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.chat-tabs button:hover,
.sim-chips button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chat-tabs button[aria-selected='true'],
.sim-chips button[aria-pressed='true'] {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  color: #fff;
}
