/* Demonstração de atendimento automático — seção nativa, sem marca de terceiros. */

.cdemo { background: var(--cream); }

.cdemo__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  grid-template-areas:
    "intro stage"
    "benefits stage"
    "cta stage";
  gap: 28px 64px;
  align-items: start;
}

.cdemo__intro { grid-area: intro; }
.cdemo__stage { grid-area: stage; }
.cdemo__benefits { grid-area: benefits; margin: 8px 0 0; }
.cdemo__cta { grid-area: cta; }

.cdemo__intro .section__title { font-size: clamp(32px, 3.2vw, 48px); }
.cdemo__intro .section__lead { margin-top: 20px; }

.cdemo__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.cdemo__tab {
  font: 500 14px/1.25 var(--font-body);
  text-align: center;
  padding: 10px 8px;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
}

.cdemo__tab small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.cdemo__tab.is-active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.cdemo__tab.is-active small { color: var(--yellow); }

.cdemo__device {
  background: var(--ink);
  border-radius: 32px;
  padding: 12px 10px 14px;
  box-shadow: 0 24px 64px rgba(27, 28, 26, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.cdemo__speaker,
.cdemo__home {
  display: block;
  border-radius: 99px;
  background: #3a3b34;
  margin-inline: auto;
}

.cdemo__speaker { width: 64px; height: 5px; margin-bottom: 10px; }
.cdemo__home { width: 96px; height: 4px; margin-top: 10px; }

.cdemo__screen {
  display: flex;
  flex-direction: column;
  height: min(560px, 64dvh);
  min-height: 460px;
  border-radius: 22px;
  overflow: hidden;
  background: #efeae0;
}

.cdemo__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--ink);
  color: var(--cream);
  flex: none;
}

.cdemo__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--red);
  color: var(--yellow);
  font: 600 17px/1 var(--font-display);
}

.cdemo__who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.cdemo__name { font-size: 15px; font-weight: 600; line-height: 1.25; }
.cdemo__status { font-size: 12px; color: #c2bdb2; }
.cdemo__status.is-typing { color: var(--yellow); }

.cdemo__badge {
  flex: none;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: 4px;
  padding: 3px 6px;
}

.cdemo__reset {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--cream);
  border-radius: 8px;
}

.cdemo__reset:hover { color: var(--yellow); }

.cdemo__log {
  flex: 1 1 auto;
  min-height: 140px;
  overflow-y: auto;
  padding: 14px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: #efeae0;
  background-image: radial-gradient(rgba(27, 28, 26, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
  scroll-behavior: smooth;
}

.cdemo__fallback {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  padding: 8px;
}

.cdemo__day {
  align-self: center;
  font: 500 11px/1 var(--font-mono);
  background: rgba(255, 253, 248, 0.92);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.cdemo__msg {
  max-width: 84%;
  padding: 8px 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
  overflow-wrap: anywhere;
  white-space: pre-line;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.cdemo__msg time {
  position: absolute;
  right: 8px;
  bottom: 3px;
  font-size: 10.5px;
  color: rgba(27, 28, 26, 0.62);
}

.cdemo__msg b { font-weight: 600; }

.cdemo__msg--bot {
  align-self: flex-start;
  background: #fff;
  border-top-left-radius: 2px;
}

.cdemo__msg--me {
  align-self: flex-end;
  background: #d9f7c7;
  border-top-right-radius: 2px;
}

.cdemo__msg--card {
  background: var(--surface);
  border-left: 3px solid var(--red);
}

.cdemo__msg--system {
  align-self: center;
  max-width: 92%;
  background: var(--yellow);
  color: var(--ink);
  font: 500 12px/1.4 var(--font-mono);
  text-align: center;
  padding: 6px 10px;
  box-shadow: none;
  white-space: normal;
}

.cdemo__msg--system time { display: none; }

.cdemo__typing {
  align-self: flex-start;
  background: #fff;
  border-radius: 10px;
  border-top-left-radius: 2px;
  padding: 12px 14px;
  display: flex;
  gap: 4px;
}

.cdemo__typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9a988f;
  animation: cdemo-blink 1s infinite;
}

.cdemo__typing i:nth-child(2) { animation-delay: 0.15s; }
.cdemo__typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes cdemo-blink {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.cdemo__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: #efeae0;
  border-top: 1px solid rgba(27, 28, 26, 0.1);
  max-height: 220px;
  overflow-y: auto;
  flex: none;
}

.cdemo__chips[hidden] { display: none; }

.cdemo__chip {
  font: 500 14px/1.2 var(--font-body);
  background: var(--surface);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 40px;
  cursor: pointer;
}

.cdemo__chip:active { background: var(--red); color: var(--cream); }

@media (hover: hover) {
  .cdemo__chip:hover { background: var(--red); color: var(--cream); }
}

.cdemo__form {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #e6e0d4;
  flex: none;
}

.cdemo__form input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  font: 16px/1.3 var(--font-body);
  background: #fff;
  color: var(--ink);
}

.cdemo__form button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--red);
  color: var(--yellow);
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
}

.cdemo__form button:hover { background: #8d1820; }

.cdemo__note {
  margin: 12px 8px 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}

.cdemo__benefits {
  list-style: none;
  display: grid;
  gap: 16px;
  padding: 0;
}

.cdemo__benefits li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.cdemo__benefits .mono {
  color: var(--red);
  font-size: 12px;
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}

.cdemo__benefits strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.cdemo__benefits p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.cdemo__fine {
  margin-top: 12px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.cdemo__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 961px) {
  .cdemo__stage { position: sticky; top: 96px; }
}

@media (max-width: 960px) {
  .cdemo__layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "stage"
      "benefits"
      "cta";
    gap: 28px;
  }

  .cdemo__stage { width: 100%; max-width: 440px; justify-self: center; }
}

@media (max-width: 820px) {
  body.cdemo-in-view .float-wa,
  body.cdemo-in-view .to-top {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .cdemo__screen { height: min(540px, 62dvh); min-height: 440px; }
  .cdemo__tab { font-size: 13px; padding: 8px 6px; }
  .cdemo__cta .btn { width: 100%; justify-content: center; }
  .cdemo__name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cdemo__log { scroll-behavior: auto; }
  .cdemo__typing i { animation: none; opacity: 0.7; }
}
