:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0b141a;
  color: #111b21;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top, rgba(37, 211, 102, 0.18), transparent 40%),
    linear-gradient(180deg, #111b21 0%, #0b141a 100%);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-shell {
  width: min(100%, 420px);
  height: min(720px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  overflow: hidden;
  background: #efeae2;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.chat-shell__header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #075e54;
  color: #fff;
}

.chat-shell__avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.chat-shell__identity {
  flex: 1;
  min-width: 0;
}

.chat-shell__name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-timer {
  padding: 10px 16px;
  background: #b42318;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.offer-timer--ended {
  background: #54656f;
  font-weight: 500;
}

.offer-timer--inline {
  margin-bottom: 12px;
  border-radius: 12px;
  font-size: 12px;
  padding: 8px 14px;
}

.chat-shell__eyebrow {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.2;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-shell__status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 12px;
}

.chat-shell__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-shell__status-dot {
    animation: none;
  }
}

.chat-shell__messages {
  flex: 1;
  min-height: 0;
  padding: 24px 16px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.24)),
    url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"%3E%3Cpath d="M0 0h120v120H0z" fill="%23efeae2"/%3E%3Cpath d="M18 18h12v12H18zM66 18h12v12H66zM42 42h12v12H42zM90 42h12v12H90zM18 66h12v12H18zM66 66h12v12H66zM42 90h12v12H42zM90 90h12v12H90z" fill="%23e2d7c9" fill-opacity="0.45"/%3E%3C/svg%3E');
}

.bubble {
  max-width: 84%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 15px;
  white-space: pre-line;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.bubble del {
  color: #8696a0;
  text-decoration: line-through;
}

.bubble strong {
  font-weight: 700;
}

.bubble--bot {
  justify-self: start;
  background: #fff;
  border-radius: 18px;
}

.bubble--user {
  justify-self: end;
  background: #dcf8c6;
  border-radius: 18px;
}

.bubble--system {
  justify-self: center;
  max-width: 92%;
  background: rgba(255, 255, 255, 0.78);
  color: #3b4a54;
  font-size: 14px;
  text-align: center;
}

.bubble--typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-width: 58px;
}

.bubble--typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8696a0;
  animation: typing-pulse 1s infinite ease-in-out;
}

.bubble--typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.bubble--typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-pulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.chat-composer.chat-composer--options {
  grid-template-columns: 1fr;
}

.chat-composer__options {
  display: grid;
  width: 100%;
  gap: 10px;
}

.chat-composer .chat-composer__option {
  width: 100%;
  justify-self: stretch;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: linear-gradient(180deg, #1aa84e 0%, #128c43 100%);
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  box-shadow: 0 4px 12px rgba(18, 140, 67, 0.35);
}

/* Mãozinha apontando para o texto — sinaliza que é pra tocar */
.chat-composer__option::before {
  content: '👉';
  flex: none;
  text-shadow: none;
  animation: option-point 1.2s ease-in-out infinite;
}

@keyframes option-point {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-composer__option::before {
    animation: none;
  }
}

/* Botão de destaque (ex.: oferta principal) — chama ainda mais a atenção */
.chat-composer .chat-composer__option--highlight {
  font-weight: 800;
  min-height: 54px;
  background: linear-gradient(180deg, #25d366 0%, #14a94f 100%);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
}

/* Botão normal/secundário — mesmo verde, um pouco mais discreto */
.chat-composer .chat-composer__option--normal {
  background: linear-gradient(180deg, #189a48 0%, #0f7d3c 100%);
  box-shadow: 0 3px 9px rgba(15, 125, 60, 0.3);
}

.chat-composer__error {
  grid-column: 1 / -1;
  margin: 0;
  color: #b42318;
  font-size: 13px;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  background: #f0f2f5;
  border-top: 1px solid rgba(17, 27, 33, 0.08);
}

.chat-composer input,
.chat-composer button {
  border-radius: 14px;
  border: 0;
  font: inherit;
}

.chat-composer input {
  min-width: 0;
  padding: 14px 16px;
  background: #fff;
  color: #111b21;
}

.chat-composer button {
  padding: 0 18px;
  background: #25d366;
  color: #072b16;
  font-weight: 700;
  cursor: pointer;
}

.chat-composer button:focus-visible,
.chat-composer input:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.38);
  outline-offset: 2px;
}

.payment-card {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  color: #111b21;
}

.payment-card__qr {
  width: min(220px, 100%);
  justify-self: center;
  border-radius: 12px;
}

.payment-card__code {
  margin: 0;
  padding: 10px;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: #f0f2f5;
  font-size: 12px;
}

.payment-card__beneficiary {
  margin: 0;
  color: #54656f;
  font-size: 12px;
}

.payment-card__actions {
  display: grid;
  gap: 10px;
}

.payment-card__actions button {
  width: 100%;
  justify-self: stretch;
  min-height: 48px;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0 18px;
}

.payment-card__actions button:first-child {
  background: #25d366;
  color: #072b16;
}

.payment-card__actions button:last-child {
  background: #fff;
  color: #54656f;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(17, 27, 33, 0.16);
}

.payment-card__actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.payment-card__status {
  margin: 0;
  color: #3b4a54;
  font-size: 13px;
}

.toast-copied {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  border-radius: 8px;
  background: rgba(17, 27, 33, 0.82);
  color: #e9edef;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  z-index: 1000;
  animation: toast-fade 2s ease forwards;
}

@keyframes toast-fade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
}

button:disabled {
  pointer-events: none;
  opacity: 0.6;
  cursor: not-allowed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bubble--file {
  padding: 8px;
  width: min(84%, 320px);
}

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #f5f6f6;
  color: inherit;
  font: inherit;
  text-align: inherit;
  width: 100%;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.file-card:hover,
.file-card:focus-visible {
  background: #eceeee;
}

.file-card:disabled {
  cursor: default;
  opacity: 1;
}

.file-card--loading {
  background: #e8eaea;
}

.file-card--loading .file-card__icon {
  background: #c44a46;
}

.file-card--done {
  background: #edf7ed;
}

.file-card--done .file-card__icon {
  background: #4caf50;
}

.bubble--pdf {
  width: min(92%, 420px);
  padding: 6px;
}

.pdf-viewer__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}

.pdf-viewer__pageinfo {
  flex: 1;
  font-size: 13px;
  color: #54656f;
}

.pdf-viewer__nav {
  min-width: 40px;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  background: #f5f6f6;
  color: #54656f;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pdf-viewer__nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.pdf-viewer__scroll {
  max-height: min(70vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  background: #f5f6f6;
}

.pdf-viewer__page {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.pdf-viewer__page + .pdf-viewer__page {
  margin-top: 10px;
}

.pdf-viewer__status {
  padding: 8px 6px;
  font-size: 13px;
  color: #54656f;
}

.file-card__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #e94f4a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.file-card__info {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.file-card__meta {
  font-size: 12px;
  color: #54656f;
}

.file-card__action {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #8696a0;
  color: #54656f;
  font-size: 17px;
}

@media (max-width: 480px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    display: block;
  }

  .chat-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-shell__header {
    padding: 12px 14px;
  }

  .chat-shell__name {
    font-size: 16px;
  }

  .chat-shell__avatar {
    width: 42px;
    height: 42px;
  }

  .chat-shell__messages {
    min-height: 0;
    padding: 16px 12px;
    gap: 10px;
  }

  .bubble {
    max-width: 88%;
    padding: 11px 13px;
    font-size: 14px;
  }

  .chat-composer {
    gap: 8px;
    padding: 10px;
  }

  .chat-composer input {
    padding: 12px 13px;
  }

  .chat-composer button {
    padding: 0 14px;
  }

  .bubble--pdf {
    width: 96%;
  }
}
