@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('vendor/montserrat-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('vendor/montserrat-latin-wght-italic.woff2') format('woff2-variations');
}

:root {
  --navy: #012B3D;
  --navy-2: #0A3A4E;
  --petroleo: #14464F;
  --verde: #4E9179;
  --menta: #59BEA3;
  --menta-claro: #E3F4EE;
  --tinta: #1B2A35;
  --texto: #33414A;
  --suave: #6B7A83;
  --linha: #DCE4E3;
  --fundo: #EEF3F2;
  --papel: #FFFFFF;
  --alerta: #C2410C;
  --alerta-claro: #FFF1E8;
  --raio: 16px;
  --sombra: 0 1px 2px rgba(1, 43, 61, .06), 0 6px 18px rgba(1, 43, 61, .07);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--texto);
  background:
    repeating-linear-gradient(-60deg, transparent 0 46px, rgba(78, 145, 121, .035) 46px 58px),
    var(--fundo);
  -webkit-font-smoothing: antialiased;
}
svg { display: block; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }

.app {
  max-width: 560px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #F7FAF9;
  box-shadow: 0 0 0 1px var(--linha), 0 20px 60px rgba(1, 43, 61, .12);
}

/* ---------- Topo ---------- */
.topo {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, var(--petroleo) 100%);
}
.faixas { position: absolute; right: -10px; top: -14px; display: grid; gap: 9px; opacity: .14; pointer-events: none; }
.faixas i { display: block; width: 170px; height: 22px; background: var(--menta); transform: skewX(-38deg); }
.faixas i:nth-child(2) { margin-left: -46px; }
.topo-linha { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.marca-simbolo { width: 38px; height: 38px; fill: var(--menta); }
.marca-texto { display: flex; flex-direction: column; line-height: 1; }
.marca-nome { font-size: 22px; letter-spacing: .5px; }
.marca-nome em { font-weight: 300; }
.marca-nome strong { font-weight: 900; font-style: italic; }
.marca-sub { margin-top: 4px; font-size: 8.5px; font-weight: 700; letter-spacing: 1.6px; white-space: nowrap; text-transform: uppercase; color: var(--menta); }
.topo-titulo { position: relative; margin: 12px 0 0; font-size: 12.5px; font-weight: 600; color: #CFE3DE; letter-spacing: .2px; }
.topo-titulo span { color: var(--menta); margin: 0 4px; }

.btn-nova {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background .2s;
}
.btn-nova:hover { background: rgba(255, 255, 255, .16); }
.btn-nova svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Chat ---------- */
.chat {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.selo {
  align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: var(--verde);
  background: var(--menta-claro); border: 1px solid #CBE9DF;
}
.selo svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.msg { display: flex; gap: 10px; align-items: flex-end; animation: entra .28s ease-out both; }
.msg.cliente { justify-content: flex-end; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy);
  box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(1, 43, 61, .2);
}
.avatar svg { width: 20px; height: 20px; fill: var(--menta); }

.balao {
  max-width: 86%;
  padding: 11px 14px 8px;
  border-radius: var(--raio) var(--raio) var(--raio) 4px;
  background: var(--papel);
  box-shadow: var(--sombra);
  font-size: 14px; line-height: 1.5;
}
.balao p { margin: 0 0 4px; }
.balao b { color: var(--tinta); }
.balao .meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 6px; font-size: 10.5px; color: var(--suave); }
.balao.resultado { flex: 1; max-width: none; }
.msg.cliente .balao {
  border-radius: var(--raio) var(--raio) 4px var(--raio);
  background: var(--petroleo); color: #fff;
}
.msg.cliente .balao .meta { color: #A9C9C1; justify-content: flex-end; }
.msg.erro .balao { background: var(--alerta-claro); border: 1px solid #FBD5BF; }

.digitando { display: inline-flex; gap: 4px; padding: 4px 2px; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); animation: pula 1s infinite ease-in-out; }
.digitando i:nth-child(2) { animation-delay: .15s; }
.digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pula { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ---------- Resumo e faturas ---------- */
.resumo {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  margin: 8px 0 4px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--petroleo)); color: #fff;
}
.resumo small { font-size: 11px; color: #A9C9C1; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.resumo strong { font-size: 22px; font-weight: 800; }
.resumo .qtd { grid-row: span 2; text-align: right; font-size: 12px; color: #CFE3DE; }
.resumo .qtd b { display: block; font-size: 20px; color: var(--menta); }

.faturas { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 2px; }
.fatura {
  border: 1px solid var(--linha); border-radius: 14px; overflow: hidden; background: #fff;
}
.fatura.vencido { border-color: #F6C9AE; }
.fatura-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px 10px; }
.fatura-desc { font-size: 12.5px; font-weight: 700; color: var(--tinta); line-height: 1.35; }
.fatura-desc span { display: block; margin-top: 2px; font-weight: 500; color: var(--suave); font-size: 11.5px; }
.chip { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.chip.aberto { background: var(--menta-claro); color: #2F7A61; }
.chip.vencido { background: var(--alerta-claro); color: var(--alerta); }
.fatura-num { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 14px 12px; }
.fatura-num .valor { font-size: 22px; font-weight: 800; color: var(--tinta); letter-spacing: -.3px; }
.fatura-num .venc { text-align: right; font-size: 11px; color: var(--suave); }
.fatura-num .venc b { display: block; font-size: 13.5px; color: var(--tinta); }
.fatura.vencido .venc b { color: var(--alerta); }

.acoes { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--linha); }
.acao {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border: 0; background: none;
  font-size: 11px; font-weight: 700; color: var(--petroleo); text-decoration: none;
  transition: background .15s, color .15s;
}
.acao + .acao { border-left: 1px solid var(--linha); }
.acao:hover { background: #F2F8F6; color: var(--navy); }
.acao svg { width: 19px; height: 19px; fill: none; stroke: var(--verde); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acao.ok { color: var(--verde); }
.acao[aria-disabled="true"] { color: #A8B4B9; pointer-events: none; }
.acao[aria-disabled="true"] svg { stroke: #C3CCD0; }

.pix { display: none; padding: 14px; border-top: 1px dashed var(--linha); background: #FAFCFC; text-align: center; }
.pix.aberto { display: block; }
.pix .qr { width: 180px; height: 180px; margin: 0 auto 10px; padding: 8px; background: #fff; border: 1px solid var(--linha); border-radius: 10px; }
.pix .qr svg, .pix .qr img { width: 100%; height: 100%; }
.pix code { display: block; max-height: 54px; overflow: hidden; margin-bottom: 10px; font-size: 10.5px; color: var(--suave); word-break: break-all; text-align: left; }
.btn-copiar {
  width: 100%; padding: 11px; border: 0; border-radius: 10px;
  background: var(--verde); color: #fff; font-weight: 700; font-size: 13px;
}
.btn-copiar:hover { background: #3F7D67; }

.mais { margin-top: 6px; font-size: 12px; color: var(--suave); }

/* ---------- Atalhos / entrada ---------- */
.atalhos { display: flex; justify-content: flex-end; padding: 4px 16px 8px; }
.btn-whats {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: #1FAF5A; color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(31, 175, 90, .3);
}
.btn-whats svg { width: 17px; height: 17px; fill: currentColor; }

.entrada { display: flex; gap: 10px; padding: 0 16px 16px; }
.campo {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-radius: 14px; background: #fff;
  border: 1.5px solid var(--linha); transition: border-color .2s, box-shadow .2s;
}
.campo:focus-within { border-color: var(--verde); box-shadow: 0 0 0 4px rgba(89, 190, 163, .18); }
.campo svg { flex: none; width: 21px; height: 21px; fill: none; stroke: var(--suave); stroke-width: 1.6; }
.campo input {
  flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none;
  font: 600 16px 'Montserrat', sans-serif; color: var(--tinta); letter-spacing: .4px;
}
.campo input::placeholder { font-weight: 500; color: #8E9BA2; letter-spacing: 0; }
.btn-enviar {
  flex: none; width: 54px; height: 54px; border: 0; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--navy); transition: background .2s, transform .1s;
}
.btn-enviar svg { width: 22px; height: 22px; fill: var(--menta); }
.btn-enviar:not(:disabled):hover { background: var(--petroleo); }
.btn-enviar:active { transform: scale(.96); }
.btn-enviar:disabled { background: #B9C6CA; cursor: not-allowed; }
.btn-enviar:disabled svg { fill: #fff; }

/* ---------- Rodapé ---------- */
.rodape {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--navy); color: #CFE3DE; text-align: center;
}
.rodape-rotulo { font-size: 11.5px; font-weight: 600; }
.online { margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; background: rgba(89, 190, 163, .16); color: var(--menta); }
.online::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--menta); vertical-align: 1px; }
.rodape-fone { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.rodape-fone svg { width: 18px; height: 18px; fill: none; stroke: var(--menta); stroke-width: 2; stroke-linejoin: round; }
.rodape-slogan { font-size: 10.5px; font-style: italic; color: #86A9A1; }

.toast {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 10px; background: var(--tinta); color: #fff;
  font-size: 13px; font-weight: 600; box-shadow: var(--sombra); z-index: 10;
  animation: entra .2s ease-out;
}

@media (min-width: 600px) {
  .app { height: calc(100dvh - 40px); margin-top: 20px; border-radius: 22px; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
