/* Página de captura em formato de conversa (estilo WhatsApp), com a identidade Imperio Capital. */
:root {
  --green: #0b3028;
  --green-2: #174b3b;
  --deep: #071f1a;
  --gold: #c4a568;
  --gold-l: #dcc79a;
  --ivory: #f5f1e8;
  --papel: #ece5d6;
  --aviso: #f6edd6;
  --white: #ffffff;
  --graphite: #202925;
  --muted: #5b6661;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; height: 100%; }
body {
  background: var(--deep);
  color: var(--graphite);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Moldura ---------- */
.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--papel);
  overflow: hidden;
  isolation: isolate;
}
.app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url(../assets/pattern-ic.svg) 0 0 / 70px auto repeat;
  opacity: 0.05;
}
@media (min-width: 520px) {
  body { background: var(--green) url(../assets/pattern-ic.svg) 0 0 / 96px auto repeat; }
  .app { box-shadow: 0 0 0 1px rgba(196, 165, 104, 0.28), 0 30px 90px rgba(0, 0, 0, 0.4); }
}

/* ---------- Cabeçalho ---------- */
.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--green);
  color: var(--ivory);
  box-shadow: 0 1px 0 rgba(196, 165, 104, 0.3);
  z-index: 2;
}
.avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-2);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}
.avatar svg { width: 21px; height: 24px; fill: var(--gold); }
.quem { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.quem strong { font-size: 16.5px; font-weight: 700; letter-spacing: 0.01em; }
.quem span { font-size: 12.5px; color: var(--gold-l); }

/* ---------- Conversa ---------- */
.conversa {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 8px;
}
.sis {
  align-self: center;
  max-width: 90%;
  margin: 6px 0 8px;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0.5px rgba(11, 48, 40, 0.1);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
}
.sis-aviso { background: var(--aviso); color: var(--graphite); }

.msg { display: flex; margin-top: 2px; animation: entra 0.24s var(--ease) both; }
.msg.cauda { margin-top: 8px; }
.msg.eu { justify-content: flex-end; }
.bolha {
  position: relative;
  max-width: 84%;
  padding: 7px 9px 7px 10px;
  border-radius: 10px;
  box-shadow: 0 1px 0.5px rgba(11, 48, 40, 0.13);
  font-size: 15.5px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.bot .bolha { background: var(--white); }
.eu .bolha { background: var(--green-2); color: var(--ivory); }
.cauda.bot .bolha { border-top-left-radius: 0; }
.cauda.eu .bolha { border-top-right-radius: 0; }
.cauda .bolha::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; background: inherit; }
.cauda.bot .bolha::before { left: -8px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.cauda.eu .bolha::before { right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.bolha strong { font-weight: 700; }
.bot .bolha strong { color: var(--green); }
.eu .bolha strong { color: var(--gold-l); }
.meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 8px 0 -5px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.eu .meta { color: rgba(245, 241, 232, 0.66); }
.ticks { width: 16px; height: 11px; fill: none; stroke: var(--gold-l); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* "digitando…" */
.digitando .bolha { display: flex; gap: 4px; padding: 13px 14px; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: rgba(32, 41, 37, 0.42); animation: pulo 1.1s infinite; }
.digitando i:nth-child(2) { animation-delay: 0.15s; }
.digitando i:nth-child(3) { animation-delay: 0.3s; }

/* Mensagens com cartão */
.rico .bolha { width: 300px; max-width: 88%; padding: 4px; }
.rico .meta { margin: 5px 6px 3px 10px; }
.rico .bolha::after { content: ""; display: block; clear: both; }

.carta {
  border-radius: 8px;
  padding: 14px 16px 12px;
  background: var(--green) radial-gradient(120% 90% at 100% 0%, rgba(196, 165, 104, 0.16), transparent 60%);
  color: var(--ivory);
}
.carta-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.carta-topo svg { width: 17px; height: 19px; fill: var(--gold); }
.carta-veic { margin: 6px 0 10px; font-size: 15px; font-weight: 600; }
.carta dl { display: grid; gap: 8px; margin: 0; }
.carta dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(196, 165, 104, 0.22);
}
.carta dt { color: rgba(245, 241, 232, 0.75); font-size: 13px; }
.carta dd { margin: 0; color: var(--gold); font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.carta dd small { margin-left: 5px; color: rgba(245, 241, 232, 0.7); font-family: var(--sans); font-size: 12px; font-weight: 500; }
.carta-nota { margin: 10px 0 0; color: rgba(245, 241, 232, 0.62); font-size: 11.5px; line-height: 1.4; }

.agendada {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ivory);
}
.agendada .i { flex: none; width: 28px; height: 28px; color: var(--green); }
.agendada strong { display: block; color: var(--green); font-size: 15px; line-height: 1.3; }
.agendada span { color: var(--muted); font-size: 12.5px; }

/* ---------- Respostas (botões e campo) ---------- */
.compositor { padding: 4px 10px calc(8px + env(safe-area-inset-bottom)); z-index: 2; }
.opcoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-height: 46vh;
  max-height: 46dvh;
  overflow-y: auto;
  padding: 4px 2px 8px;
}
.opcoes.lista { flex-direction: column; align-items: stretch; }
.opcoes.dias { display: grid; grid-template-columns: repeat(3, 1fr); }
.opcoes.grade { display: grid; grid-template-columns: repeat(4, 1fr); }
.chip {
  min-height: 46px;
  padding: 11px 16px;
  border: 1.5px solid rgba(11, 48, 40, 0.16);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(11, 48, 40, 0.08);
  color: var(--green);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: entra 0.26s var(--ease) both;
  animation-delay: var(--d, 0ms);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--green-2); }
.chip:active { background: var(--green); color: var(--ivory); }
.chip.sec { background: transparent; border-style: dashed; color: var(--green-2); font-weight: 600; box-shadow: none; }
.lista .chip { border-radius: 14px; padding: 13px 16px; text-align: left; }
.dias .chip,
.grade .chip { padding: 11px 4px; border-radius: 12px; }
.grade .chip.sec,
.dias .chip.sec { grid-column: 1 / -1; }

.barra { display: flex; align-items: center; gap: 8px; }
.campo {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 6px 0 16px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(11, 48, 40, 0.1);
}
.ddi { margin-right: 6px; color: var(--green); font-size: 16px; font-weight: 700; }
.campo input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--graphite);
  font: inherit;
  font-size: 16px;
}
.campo input::placeholder { color: rgba(32, 41, 37, 0.5); }
.campo:focus-within { box-shadow: 0 0 0 2px var(--gold), 0 1px 2px rgba(11, 48, 40, 0.1); }
.enviar {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: var(--gold);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.enviar:disabled { opacity: 0.4; cursor: default; }
.enviar:not(:disabled):active { transform: scale(0.94); }
.enviar svg { width: 22px; height: 22px; fill: currentColor; }
.chip:focus-visible,
.enviar:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.consent { margin: 0 6px 8px; color: var(--muted); font-size: 11.5px; line-height: 1.4; text-align: center; }
.fim { margin: 4px auto 6px; color: var(--muted); font-size: 12.5px; text-align: center; }

.semjs { margin: auto; padding: 24px; color: var(--graphite); text-align: center; }
.semjs a { color: var(--green); font-weight: 700; }

@keyframes entra { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pulo { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .msg, .chip, .digitando i { animation: none; }
}
@media (max-width: 360px) {
  .bolha { font-size: 15px; }
  .chip { font-size: 14px; }
  .opcoes.grade { grid-template-columns: repeat(3, 1fr); }
}
