/* MTChat Widget - Santos-Topografia & Cadastro */

:root{
  --mt-chat-green:#1f7a3a;
  --mt-chat-green-2:#14602b;
  --mt-chat-border:rgba(0,0,0,.12);
  --mt-chat-shadow:0 18px 50px rgba(0,0,0,.35);
  --mt-chat-bg:#ffffff;
  --mt-chat-text:#0d1b14;
  --mt-chat-muted:#5c6b63;
}

/* Floating launcher */
.mt-chat-launcher{
  position:fixed;
  right:18px;
  bottom:18px;
  width:56px;
  height:56px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,var(--mt-chat-green),var(--mt-chat-green-2));
  box-shadow:var(--mt-chat-shadow);
  cursor:pointer;
  z-index:9999;
  border:1px solid rgba(255,255,255,.22);
  user-select:none;
}

.mt-chat-launcher svg{ width:22px; height:22px; fill:#fff; }

/* Chat window */
.mt-chat{
  position:fixed;
  right:18px;
  bottom:86px;
  width:380px;
  height:540px;
  max-height:calc(100vh - 120px);
  background:var(--mt-chat-bg);
  border:1px solid var(--mt-chat-border);
  border-radius:16px;
  box-shadow:var(--mt-chat-shadow);
  overflow:hidden;
  z-index:9999;
  display:none;
}

.mt-chat.open{ display:flex; flex-direction:column; }

.mt-chat-header{
  background:linear-gradient(180deg,var(--mt-chat-green),var(--mt-chat-green-2));
  color:#fff;
  padding:12px 12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.mt-chat-header-left{
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height:1.1;
}

.mt-chat-title{
  font-weight:800;
  font-size:14px;
}

.mt-chat-sub{
  font-size:12px;
  opacity:.92;
}

.mt-chat-header-right{
  display:flex;
  align-items:center;
  gap:8px;
}

.mt-pill{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 10px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.2);
  font-size:12px;
  white-space:nowrap;
}

.mt-chat-icon-btn{
  width:30px;
  height:30px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
}

.mt-chat-icon-btn:hover{ background:rgba(255,255,255,.18); }

.mt-chat-body{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1;
  min-height:0;
  color:var(--mt-chat-text);
}

.mt-chat-consent{
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  padding:12px;
  background:rgba(31,122,58,.05);
}

.mt-chat-consent.hidden{ display:none; }

.mt-check{
  margin-top:10px;
  display:flex;
  gap:8px;
  align-items:flex-start;
  font-size:12px;
  color:var(--mt-chat-text);
}

.mt-check input{ margin-top:2px; }

.mt-actions{
  margin-top:12px;
  display:flex;
  gap:10px;
  align-items:center;
}

.mt-actions button{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  cursor:pointer;
  font-size:12px;
}

.mt-actions button:hover{ background:#f3f5f7; }

.mt-actions .mt-primary{
  background:linear-gradient(180deg,var(--mt-chat-green),var(--mt-chat-green-2));
  color:#fff;
  border-color:rgba(255,255,255,.18);
}

.mt-actions .mt-primary:hover{ filter:brightness(1.03); }

.mt-chat-consent h4{
  margin:0 0 8px 0;
  font-size:13px;
}

.mt-chat-consent p{
  margin:0;
  font-size:12px;
  color:var(--mt-chat-muted);
  line-height:1.35;
}

.mt-chat-consent .mt-consent-actions{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:10px;
}

.mt-btn{
  border:1px solid rgba(0,0,0,.12);
  background:#f2f4f6;
  color:#111;
  padding:8px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}

.mt-btn.primary{
  background:linear-gradient(180deg,var(--mt-chat-green),var(--mt-chat-green-2));
  color:#fff;
  border-color:rgba(255,255,255,.18);
}

.mt-btn:disabled{ opacity:.55; cursor:not-allowed; }

.mt-chat-messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding-right:4px;
}

.mt-msg{
  margin-bottom:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.08);
  font-size:13px;
  line-height:1.35;
}

.mt-msg.bot{
  background:rgba(31,122,58,.08);
}

.mt-msg.user{
  background:rgba(247,201,72,.15);
  text-align:right;
}

.mt-msg .mt-from{
  font-weight:800;
  margin-right:6px;
}

.mt-chat-quick{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.mt-chat-quick .mt-quick{
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  cursor:pointer;
  font-size:12px;
}

.mt-chat-quick .mt-quick:hover{ background:#f3f5f7; }

.mt-chat-input{
  display:flex;
  gap:10px;
  align-items:center;
  border-top:1px solid rgba(0,0,0,.08);
  padding:12px;
}

.mt-chat-input input{
  flex:1;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.14);
  outline:none;
  font-size:13px;
}

@media (max-width: 520px){
  .mt-chat{
    right:12px;
    left:12px;
    width:auto;
    bottom:86px;
    height:70vh;
  }
  .mt-chat-launcher{ right:12px; bottom:12px; }
}
