/* Modal Lead V2 — WhatsApp Chat Exit-Intent (Onda Carioca DS) */

.lm2-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 710;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lm2-overlay.active { display: flex; }

.lm2-box {
  background: #1a1a1e;
  border: 1px solid rgba(201,168,76,.15);
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  animation: lm2In 0.35s cubic-bezier(0.16,1,0.3,1);
  overflow: hidden;
}
@keyframes lm2In {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lm2-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.4);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s;
}
.lm2-close:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ── Chat container ── */
.lm2-chat { display: flex; flex-direction: column; height: 100%; min-height: 420px; }

.lm2-chat-hdr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(201,168,76,.12), rgba(201,168,76,.04));
  border-bottom: 1px solid rgba(201,168,76,.1);
  flex-shrink: 0;
}
.lm2-chat-av-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(201,168,76,.15);
}
.lm2-chat-av {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lm2-chat-online {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #25D366;
  border: 2px solid #1a1a1e;
}
.lm2-chat-hdr-info { flex: 1; }
.lm2-chat-hdr-name { font-weight: 700; font-size: .95rem; color: #fff; letter-spacing: .02em; }
.lm2-chat-hdr-status { font-size: .72rem; color: var(--gold-light); font-weight: 500; }

/* ── Messages area ── */
.lm2-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #151518;
}
.lm2-chat-msgs::-webkit-scrollbar { width: 3px; }
.lm2-chat-msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 3px; }

.lm2-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .88rem;
  line-height: 1.5;
  animation: lm2MsgIn .25s;
}
@keyframes lm2MsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.lm2-msg-a {
  align-self: flex-start;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.04);
  color: rgba(255,255,255,.85);
  border-top-left-radius: 3px;
}
.lm2-msg-u {
  align-self: flex-end;
  background: rgba(201,168,76,.08);
  border: 1px solid rgba(201,168,76,.06);
  color: #fff;
  border-top-right-radius: 3px;
}
.lm2-msg-time { font-size: .6rem; color: rgba(255,255,255,.2); text-align: right; margin-top: 4px; }
.lm2-msg-u .lm2-msg-time { color: rgba(201,168,76,.25); }

/* ── Typing indicator ── */
.lm2-typing {
  display: flex;
  gap: 5px;
  align-self: flex-start;
  background: rgba(255,255,255,.04);
  padding: 12px 16px;
  border-radius: 10px;
  border-top-left-radius: 3px;
  border: 1px solid rgba(255,255,255,.04);
}
.lm2-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  animation: lm2Bounce 1.2s infinite;
}
.lm2-typing span:nth-child(2) { animation-delay: .2s; }
.lm2-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes lm2Bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

/* ── Quick reply buttons ── */
.lm2-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  margin: 2px 0 8px 0;
}
.lm2-btn-qr {
  padding: 9px 16px;
  background: rgba(201,168,76,.06);
  border: 1px solid rgba(201,168,76,.12);
  color: var(--gold-light);
  border-radius: 18px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.lm2-btn-qr:hover { background: rgba(201,168,76,.12); border-color: rgba(201,168,76,.2); }
.lm2-btn-qr:active { transform: scale(.95); }

/* ── Final buttons ── */
.lm2-btns-final {
  align-self: stretch;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 12px;
}
.lm2-btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #1a1a1e;
  border: none;
  border-radius: 14px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s;
  text-align: center;
}
.lm2-btn-wa:active { transform: scale(.97); }
.lm2-btn-save {
  padding: 12px;
  background: transparent;
  color: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: .82rem;
  cursor: pointer;
  transition: all .2s;
}
.lm2-btn-save:hover { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.12); }

/* ── Input area ── */
.lm2-chat-foot {
  flex-shrink: 0;
  padding: 8px 12px;
  background: rgba(0,0,0,.15);
  border-top: 1px solid rgba(255,255,255,.04);
}
.lm2-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lm2-chat-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: .85rem;
  color: #fff;
  outline: none;
  transition: border-color .2s;
}
.lm2-chat-input:focus { border-color: rgba(201,168,76,.2); }
.lm2-chat-input::placeholder { color: rgba(255,255,255,.2); }
.lm2-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #1a1a1e;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.lm2-send-btn:active { transform: scale(.9); }

/* ── Mobile ── */
@media (max-width: 520px) {
  .lm2-overlay { padding: 0; }
  .lm2-box { max-width: 100%; max-height: 100vh; border-radius: 0; width: 100%; height: 100%; margin: 0; }
  .lm2-chat { min-height: 100%; }
  .lm2-chat-msgs { padding: 12px 10px 2px; }
  .lm2-chat-hdr { padding: 12px 14px; gap: 10px; }
  .lm2-chat-av-wrap { width: 44px; height: 44px; }
  .lm2-close { top: 10px; right: 12px; }
  .lm2-chat-input { padding: 14px 16px; font-size: 16px; }
  .lm2-btn-qr { padding: 11px 18px; font-size: .9rem; }
  .lm2-btn-wa { padding: 16px; font-size: 1rem; }
}
