/* === CCM Frontend Chat — v43 === */

@keyframes ccm-fade-in {
  from { opacity:0; transform:translateY(5px); }
  to   { opacity:1; transform:translateY(0); }
}

.ccm-chat {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 100px;
  background: var(--ccm-chat-bg, #eae6df);
  border-radius: 12px;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 200px;
}

.ccm-row { display:flex; align-items:flex-end; gap:8px; margin-bottom:4px; animation:ccm-fade-in .22s ease both; }
.ccm-row-bot  { justify-content:flex-start; }
.ccm-row-user { justify-content:flex-end; }

.ccm-avatar {
  width:30px; height:30px; border-radius:50%;
  background:var(--ccm-button-color,#3f8a3a); color:#fff;
  font-size:12px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; box-shadow:0 1px 3px rgba(0,0,0,.18);
}
.ccm-avatar-spacer { width:30px; flex-shrink:0; }

.ccm-bubble {
  border-radius:18px; padding:10px 14px;
  font-size:14px; line-height:1.45;
  box-sizing:border-box; max-width:78%; word-break:break-word;
}
.ccm-bot {
  background:var(--ccm-bot-bg,#ffffff) !important;
  color:var(--ccm-text-color,#333) !important;
  border-bottom-left-radius:4px;
  box-shadow:0 1px 2px rgba(0,0,0,.1);
}
.ccm-user {
  background:var(--ccm-user-bg,#dcf8c6) !important;
  color:#1e4620 !important;
  border-bottom-right-radius:4px;
  max-width:65%;
  box-shadow:0 1px 2px rgba(0,0,0,.1);
}

@keyframes ccm-dot {
  0%,80%,100% { transform:scale(.5); opacity:.35; }
  40%         { transform:scale(1);  opacity:1; }
}
.ccm-typing {
  display:flex; align-items:center; gap:5px;
  padding:13px 16px;
  background:var(--ccm-bot-bg,#ffffff);
  border-radius:18px; border-bottom-left-radius:4px;
  box-shadow:0 1px 2px rgba(0,0,0,.1);
  width:fit-content;
}
.ccm-typing span {
  width:8px; height:8px; background:#bbb; border-radius:50%;
  display:inline-block; animation:ccm-dot 1.4s infinite ease-in-out;
}
.ccm-typing span:nth-child(2) { animation-delay:.22s; }
.ccm-typing span:nth-child(3) { animation-delay:.44s; }

.ccm-buttons { margin-top:10px; display:flex; flex-direction:column; align-items:center; animation:ccm-fade-in .22s ease both; }

@keyframes ccm-shimmer { 0%{left:-80%} 100%{left:130%} }

.ccm-btn, .ccm-cta-link {
  display:block; width:92%; max-width:500px;
  text-align:center; border-radius:999px;
  padding:13px 20px; margin-bottom:10px;
  font-weight:700 !important; border:none !important;
  cursor:pointer; font-size:15px; text-decoration:none;
  position:relative; overflow:hidden;
  color:var(--ccm-button-text-color,#fff) !important;
  background:var(--ccm-button-color,#3f8a3a) !important;
  box-shadow:0 2px 8px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,255,255,.2) !important;
  transition:transform .15s, box-shadow .15s;
}
.ccm-btn::after, .ccm-cta-link::after {
  content:''; position:absolute; top:0; left:-80%; width:55%; height:100%;
  background:linear-gradient(120deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.38) 45%,rgba(255,255,255,.55) 50%,rgba(255,255,255,.38) 55%,rgba(255,255,255,0) 100%);
  animation:ccm-shimmer 2.8s ease-in-out infinite; pointer-events:none;
}
.ccm-btn:hover, .ccm-cta-link:hover { transform:translateY(-1px); box-shadow:0 4px 14px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.25) !important; }
.ccm-btn:disabled { opacity:.72; }
.ccm-btn:disabled::after, .ccm-btn-selected::after { animation:none; }
.ccm-btn-selected { box-shadow:0 0 0 3px rgba(255,255,255,.65),0 0 0 5px var(--ccm-button-color,#3f8a3a) !important; }

.ccm-cta { margin-top:16px; text-align:center; animation:ccm-fade-in .22s ease both; }
.ccm-cta-link { width:100% !important; max-width:560px !important; font-size:17px !important; padding:16px 24px !important; }
.ccm-cta-link::after { animation-duration:1.8s !important; }

.ccm-ad-marker-wrap { width:100%; min-height:20px; margin:12px 0; }
.ccm-ad-marker      { width:100%; min-height:20px; }
.ccm-hidden         { display:none !important; }

/* === LEAD CAPTURE CARD === */
.ccm-lead-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 18px 16px 14px;
  margin: 14px 0 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.09);
  animation: ccm-fade-in .25s ease both;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.ccm-lead-bot-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #333;
  margin-bottom: 14px;
  line-height: 1.4;
  text-align: center;
}

.ccm-lead-form { display: flex; flex-direction: column; gap: 0; }

.ccm-lead-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 10px;
  font-family: Arial, Helvetica, sans-serif;
  transition: border-color .15s, box-shadow .15s;
  background: #fafafa;
}
.ccm-lead-input:focus {
  border-color: var(--ccm-button-color, #3f8a3a);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(63,138,58,.12);
}

.ccm-lead-error {
  font-size: 12.5px;
  color: #c0392b;
  min-height: 18px;
  margin-bottom: 8px;
  text-align: center;
}

/* Botão do lead capture — herda estilo do CTA */
.ccm-lead-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 15px;
  position: relative;
  overflow: hidden;
  color: var(--ccm-button-text-color, #fff);
  background: var(--ccm-button-color, #3f8a3a);
  box-shadow: 0 2px 8px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  font-family: Arial, Helvetica, sans-serif;
}
.ccm-lead-btn::after {
  content:''; position:absolute; top:0; left:-80%; width:55%; height:100%;
  background:linear-gradient(120deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.38) 45%,rgba(255,255,255,.55) 50%,rgba(255,255,255,.38) 55%,rgba(255,255,255,0) 100%);
  animation: ccm-shimmer 2.8s ease-in-out infinite; pointer-events:none;
}
.ccm-lead-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25); }
.ccm-lead-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ccm-lead-btn-disabled::after { animation: none; }
.ccm-lead-btn-loading { opacity: 0.75; cursor: wait; }
.ccm-lead-btn-loading::after { animation: none; }
.ccm-lead-btn-sent {
  opacity: 0.85;
  cursor: default;
  background: #16a34a !important;
}
.ccm-lead-btn-sent::after { animation: none; }

/* === Footer fixo === */
.ccm-sticky-footer {
  position:fixed; bottom:0; left:0; right:0; z-index:9999;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(8px);
  border-top:1px solid rgba(0,0,0,.07);
  padding:5px 16px 7px;
  text-align:center;
}
.ccm-ctx-toggle {
  background:none; border:none; cursor:pointer;
  font-size:11px; color:#bbb;
  padding:2px 8px; display:block; margin:0 auto 2px;
  line-height:1;
  transition:color .15s;
}
.ccm-ctx-toggle:hover { color:#999; }
.ccm-context-text {
  font-size:11px; color:#bbb; line-height:1.5;
  max-width:640px; margin:0 auto 4px;
  text-align:left; display:none;
}
.ccm-footer-links { font-size:11px; color:#bbb; }
.ccm-footer-links a    { color:#bbb; text-decoration:none; margin:0 5px; }
.ccm-footer-links a:hover { text-decoration:underline; }
.ccm-footer-links span { color:#ddd; margin:0 3px; }

@media (max-width:480px){
  .ccm-chat      { padding:14px 10px 100px; border-radius:0; }
  .ccm-bubble    { font-size:13.5px; padding:9px 12px; }
  .ccm-btn       { width:96% !important; font-size:14px; padding:12px 14px; }
  .ccm-cta-link  { font-size:15px !important; padding:14px 16px !important; }
  .ccm-lead-card { padding:14px 12px 12px; }
  .ccm-lead-btn  { font-size:14px; padding:12px 14px; }
}
