/* ============================================
   CONTEXTO DIGITAL — demo (form + chat)
   Extiende styles.css
   ============================================ */

.nav__tag { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-2); }
.field__hint { font-size: 0.78rem; color: var(--muted-2); margin-top: 2px; }
.wz-err { color: #ff8a82; font-size: 0.86rem; margin-top: 10px; min-height: 1em; text-align: center; }

/* ---------- Form ---------- */
.demo { max-width: 620px; margin: 0 auto; padding: clamp(30px,6vw,64px) clamp(20px,5vw,40px) 90px; }
.demo__head { text-align: center; margin-bottom: 32px; }
.demo__head h1 { font-size: clamp(2.1rem,5.5vw,3.2rem); font-weight: 400; margin: 18px 0 14px; }
.demo__sub { color: var(--muted); font-size: 1.04rem; }
.demo__sub strong { color: var(--bone); }

.demo__card {
  background: linear-gradient(150deg, var(--surface-2), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(22px,4vw,38px); display: flex; flex-direction: column;
}
.demo__card form { display: flex; flex-direction: column; gap: 16px; }
.demo__contact { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.demo__contact-label { font-size: 0.9rem; font-weight: 600; color: var(--bone); margin-bottom: 12px; }
.demo__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .demo__grid { grid-template-columns: 1fr; } }

/* ---------- Chat (WhatsApp dark) ---------- */
.chat-page { min-height: 100vh; display: flex; flex-direction: column; }
.chat {
  width: 100%; max-width: 460px; margin: 18px auto; flex: 1;
  display: flex; flex-direction: column;
  background: #0b141a; border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(0,0,0,0.8);
  max-height: calc(100vh - 36px);
}

.chat__header {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: #202c33; border-bottom: 1px solid #2a3942; flex-shrink: 0;
}
.chat__back { color: #aebac1; display: grid; place-items: center; }
.chat__avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; color: #0b141a;
  background: var(--lime); font-family: var(--font-display); font-size: 1.05rem;
}
.chat__who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.chat__who b { font-size: 0.98rem; color: #e9edef; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__who span { font-size: 0.76rem; color: #8696a0; }
.chat__demo-badge { margin-left: auto; font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: #0b141a; background: var(--lime); padding: 3px 8px; border-radius: 100px; flex-shrink: 0; }

.chat__body {
  flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 8px;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 22px 22px;
}
.msg {
  max-width: 80%; padding: 8px 11px 9px; border-radius: 10px; font-size: 0.94rem; line-height: 1.4;
  position: relative; white-space: pre-wrap; word-wrap: break-word; animation: msgIn 0.25s var(--ease);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg--bot { align-self: flex-start; background: #202c33; color: #e9edef; border-top-left-radius: 3px; }
.msg--user { align-self: flex-end; background: #005c4b; color: #e9edef; border-top-right-radius: 3px; }
.msg__time { display: block; font-size: 0.64rem; color: rgba(233,237,239,0.45); text-align: right; margin-top: 3px; }

.chat__typing { align-self: flex-start; background: #202c33; padding: 12px 14px; border-radius: 10px; border-top-left-radius: 3px; display: none; }
.chat__typing.show { display: inline-flex; gap: 4px; }
.chat__typing i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: blink 1.2s infinite; }
.chat__typing i:nth-child(2) { animation-delay: 0.2s; }
.chat__typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; } }

.chat__input {
  display: flex; align-items: flex-end; gap: 9px; padding: 10px 12px;
  background: #202c33; border-top: 1px solid #2a3942; flex-shrink: 0;
}
.chat__input textarea {
  flex: 1; resize: none; max-height: 96px; font-family: var(--font-body); font-size: 0.95rem;
  color: #e9edef; background: #2a3942; border: none; border-radius: 20px; padding: 11px 15px; outline: none;
}
.chat__input textarea::placeholder { color: #8696a0; }
.chat__send {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; cursor: pointer; border: none;
  background: var(--lime); color: #0b141a; display: grid; place-items: center; transition: transform 0.15s, opacity 0.2s;
}
.chat__send:hover { transform: scale(1.06); }
.chat__send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Closing CTA inside chat */
.chat__cta {
  margin: 6px 8px 4px; padding: 18px; border-radius: 14px; text-align: center;
  background: linear-gradient(150deg, rgba(195,245,60,0.12), #202c33);
  border: 1px solid rgba(195,245,60,0.35); animation: msgIn 0.3s var(--ease);
}
.chat__cta h3 { font-family: var(--font-display); font-size: 1.15rem; color: #e9edef; margin-bottom: 6px; }
.chat__cta p { font-size: 0.9rem; color: #aebac1; margin-bottom: 14px; }
.chat__cta .btn { width: 100%; justify-content: center; }
.chat__cta .btn--wa { background: #25d366; color: #fff; }
.chat__cta .btn--wa:hover { background: #1ebe5d; }
.chat__cta small { display: block; margin-top: 10px; }
.chat__cta small a { color: var(--lime); }

@media (max-width: 500px) {
  .chat { margin: 0; border-radius: 0; max-height: 100vh; border: none; }
  .chat-page { min-height: 100dvh; }
}
