:root {
  --fundo: #0d0d0d;
  --texto: #f2f2f2;
  --texto-suave: rgba(242, 242, 242, .7);
  --texto-fraco: rgba(242, 242, 242, .45);
  --laranja: #f97415;
  --verde: #21c45d;
  --bolha-bot: #1b1b1d;
  --borda: rgba(255, 255, 255, .09);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif; color: var(--texto); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(249, 116, 21, .14), transparent 70%),
    var(--fundo);
  background-attachment: fixed;
  min-height: 100vh;
}
.chat { max-width: 680px; margin: 0 auto; padding: 22px 16px 200px; }
.mensagens { display: flex; flex-direction: column; gap: 8px; }

.linha { display: flex; align-items: flex-end; gap: 10px; animation: entra .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.linha.bot { padding-right: 36px; }
.linha.eu { justify-content: flex-end; padding-left: 60px; margin: 6px 0; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: #161616 url('assets/favicon.svg') center / 72% no-repeat;
  border: 2px solid rgba(249, 116, 21, .7);
}
.linha.bot.sem-avatar .avatar { visibility: hidden; }

.bolha {
  background: var(--bolha-bot); border: 1px solid var(--borda);
  border-radius: 6px 18px 18px 18px; padding: 12px 16px; font-size: 15px; line-height: 1.5; max-width: 100%;
}
.bolha b { font-weight: 700; color: #fff; }
.linha.eu .bolha {
  background: linear-gradient(135deg, var(--laranja), #ff8a2b); border: 0; color: #fff;
  border-radius: 18px 6px 18px 18px; font-weight: 500;
}
.bolha.foto { padding: 5px; }
.bolha.foto img { display: block; width: 100%; max-width: 440px; border-radius: 13px; }

.bolha.digitando { display: inline-flex; gap: 5px; padding: 15px 16px; }
.bolha.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--texto-fraco); animation: pula 1s infinite; }
.bolha.digitando i:nth-child(2) { animation-delay: .15s; }
.bolha.digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pula { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* área de resposta */
.entrada-chat { margin-top: 14px; padding-left: 46px; }
.entrada-chat.botoes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-left: 46px; }
.botao-chat {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--laranja); text-decoration: none; text-align: center;
  background: rgba(249, 116, 21, .08); border: 1.5px solid var(--laranja); border-radius: 999px;
  padding: 11px 18px; cursor: pointer; transition: background .15s, color .15s, transform .1s;
  animation: entra .3s both;
}
.botao-chat:hover { background: var(--laranja); color: #fff; }
.botao-chat:active { transform: scale(.98); }
.botao-chat.cheio { display: block; width: 100%; color: #fff; background: var(--verde); border-color: var(--verde); padding: 14px 18px; }

.campo-chat {
  display: flex; align-items: center; gap: 8px; background: #161618; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px; padding: 6px 6px 6px 14px; animation: entra .3s both;
}
.campo-chat:focus-within { border-color: var(--laranja); box-shadow: 0 0 0 4px rgba(249, 116, 21, .14); }
.campo-chat input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--texto); background: none; border: 0; outline: none; padding: 9px 0; }
.campo-chat input::placeholder { color: var(--texto-fraco); }
.ddi { font-size: 14px; color: var(--texto-suave); padding-right: 8px; border-right: 1px solid var(--borda); white-space: nowrap; }
.enviar { font: inherit; font-weight: 700; font-size: 14px; color: #fff; background: var(--laranja); border: 0; border-radius: 11px; padding: 11px 18px; cursor: pointer; }
.erro-chat { color: #ff6b5b; font-size: 13px; margin-top: 6px; }
.erro-chat:empty { display: none; }

/* agenda (Calendly) dentro do chat */
.agenda-linha { padding: 0 !important; display: block; }
.agenda { position: relative; border-radius: 16px; overflow: hidden; background: #fff; min-height: 680px; margin-left: 46px; }
.agenda iframe { width: 100%; height: 700px; border: 0; display: block; opacity: 0; transition: opacity .3s; }
.agenda.pronta iframe { opacity: 1; }
.agenda-carregando { position: absolute; inset: 0; display: grid; place-items: center; color: #555; font-size: 14px; }
.agenda.pronta .agenda-carregando { display: none; }
.link-discreto { display: block; margin: 12px auto 0; font: inherit; font-size: 13px; color: var(--texto-fraco); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* barra de progresso fixa no rodapé */
.progresso-chat { position: fixed; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, .08); z-index: 5; }
.progresso-chat span { display: block; height: 100%; width: 0; background: var(--laranja); transition: width .5s cubic-bezier(.2, .8, .2, 1); }

@media (max-width: 560px) {
  .chat { padding: 16px 12px 180px; }
  .linha.bot { padding-right: 12px; }
  .linha.eu { padding-left: 40px; }
  .avatar { width: 32px; height: 32px; }
  .bolha { font-size: 14.5px; }
  .entrada-chat, .entrada-chat.botoes { padding-left: 0; }
  .agenda { margin-left: 0; }
  .agenda iframe { height: 760px; }
}
