/* ============================================================
   Virtual Chat — estilos escopados .vc-
   Hierarquia: .vc-overlay > .vc-chat > .vc-header / .vc-messages / .vc-footer
   ============================================================ */

/* ── Reset dentro do chat ───────────────────────────────────── */
#virtual-chat-root,
#virtual-chat-root * {
  box-sizing: border-box;
  resize: none;
  -webkit-tap-highlight-color: transparent;
}

.vc-queue-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.vc-queue-overlay.vc-queue-active {
  opacity: 1;
  pointer-events: auto;
}

.vc-queue-card {
  width: min(100%, 330px);
  border-radius: 18px;
  border: 1px solid rgba(255, 106, 0, 0.18);
  background: #111;
  color: #fff;
  padding: 30px 22px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
  transform: translateY(10px);
  transition: transform 0.18s ease;
}

.vc-queue-overlay.vc-queue-active .vc-queue-card {
  transform: translateY(0);
}

.vc-queue-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc-queue-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.vc-queue-dot {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.52);
  animation: vc-queue-pulse 1.1s ease-in-out infinite;
}

.vc-queue-title {
  margin: 0;
  color: #fff;
  font-size: 17px;
  line-height: 1.35;
  text-align: center;
  font-weight: 700;
}

.vc-queue-timer {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  text-align: center;
}

.vc-queue-timer strong {
  color: #fff;
  font-weight: 700;
}

@keyframes vc-queue-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.52); opacity: 1; }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); opacity: 0.78; }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); opacity: 1; }
}

/* ── 1. Overlay ─────────────────────────────────────────────── */
.vc-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.vc-overlay.vc-active {
  opacity: 1;
  pointer-events: auto;
}

/* ── 2. Chat drawer ─────────────────────────────────────────── */
.vc-chat {
  width: calc(100vw - 20px);
  max-width: 430px;
  height: min(84dvh, 720px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px);
  border-radius: 24px 24px 0 0;
  background: #0f0f0f;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  /* sem box-shadow pesada */
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

.vc-overlay.vc-active .vc-chat {
  transform: translateY(0);
}

/* Alça visual */
.vc-chat::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  z-index: 1;
  pointer-events: none;
}

/* ── 3. Header ──────────────────────────────────────────────── */
.vc-header {
  flex: 0 0 auto;
  height: 68px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #181818;
}

.vc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vc-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vc-header-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  margin: 0;
}

.vc-header-status {
  color: #777;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.vc-status-dot {
  width: 7px;
  height: 7px;
  background: #25D366;
  border-radius: 50%;
  flex-shrink: 0;
  animation: vc-pulse 2.4s infinite;
}

@keyframes vc-pulse {
  0%,100% { opacity: 0.7; transform: scale(0.9); }
  50%     { opacity: 1;   transform: scale(1.15); }
}

.vc-close-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 50%;
  color: #777;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.vc-close-btn:hover  { background: rgba(255,255,255,0.12); color: #fff; }
.vc-close-btn:active { transform: scale(0.92); }

/* ── 4. Mensagens ───────────────────────────────────────────── */
.vc-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0f0f0f;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.vc-messages::-webkit-scrollbar { width: 3px; }
.vc-messages::-webkit-scrollbar-thumb { background: #222; border-radius: 4px; }

/* ── 5. Bolhas ──────────────────────────────────────────────── */
.vc-bubble {
  max-width: 80%;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  padding: 11px 14px;
  border-radius: 16px;
  flex-shrink: 0;
  position: static;
  margin: 0;
  animation: vc-fadein 0.22s ease forwards;
}

@keyframes vc-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vc-bot-bubble {
  align-self: flex-start;
  background: #1e1e1e;
  color: #ededed;
  border-radius: 16px 16px 16px 4px;
}

.vc-user-bubble {
  align-self: flex-end;
  max-width: 74%;
  background: transparent;
  color: #fff;
  border: 1px solid #ff6a00;
  border-radius: 16px 16px 4px 16px;
}

/* Digitando */
.vc-bubble.vc-typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
  max-width: fit-content;
  background: #1e1e1e;
}

.vc-typing-dot {
  width: 6px;
  height: 6px;
  background: #555;
  border-radius: 50%;
  flex-shrink: 0;
  animation: vc-bounce 1.3s infinite ease-in-out both;
}
.vc-typing-dot:nth-child(1) { animation-delay: 0s; }
.vc-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.vc-typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes vc-bounce {
  0%,60%,100% { transform: translateY(0);    opacity: 0.35; }
  30%         { transform: translateY(-5px); opacity: 1; }
}

/* ── 6. Footer ──────────────────────────────────────────────── */
.vc-footer {
  flex: 0 0 auto;
  padding: 12px 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.07);
  background: #141414;
  display: none;
  width: 100%;
}

.vc-footer.vc-footer--active {
  display: block;
}

/* Input row (texto + botão enviar) */
.vc-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.vc-text-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  border-radius: 999px;
  border: 1px solid #ff6a00;
  background: #1a1a1a;
  color: #fff;
  padding: 0 16px;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
}
.vc-text-input::placeholder { color: #555; }
.vc-text-input:focus { border-color: #ff8c3a; }

.vc-send-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: #ff6a00;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}
.vc-send-btn:hover  { background: #e05f00; }
.vc-send-btn:active { transform: scale(0.92); }
.vc-send-btn svg { width: 20px; height: 20px; fill: currentColor; display: block; }

/* ── Coluna de opções / botões ───────────────────────────────── */
.vc-options-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
}

/* ── Botões — padrão único ───────────────────────────────────── */
.vc-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, opacity 0.15s, transform 0.1s;
  line-height: 1.3;
  text-align: center;
}
.vc-btn:active   { transform: scale(0.98); }
.vc-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Primário */
.vc-btn--primary {
  background: #ff6a00;
  color: #fff;
  border-color: #ff6a00;
}
.vc-btn--primary:hover:not(:disabled) { background: #e05f00; }

/* Outline */
.vc-btn--outline {
  background: transparent;
  color: #ff6a00;
  border-color: #ff6a00;
}
.vc-btn--outline:hover:not(:disabled) { background: rgba(255,106,0,0.08); }

/* Secundário */
.vc-btn--secondary {
  background: #181818;
  color: #bbb;
  border-color: rgba(255,255,255,0.12);
  font-weight: 500;
}
.vc-btn--secondary:hover:not(:disabled) { color: #fff; border-color: rgba(255,255,255,0.25); }

/* Copiar código */
.vc-btn--copy {
  background: #ff6a00;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 16px;
  min-height: 50px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255,106,0,0.35);
}
.vc-btn--copy:hover:not(:disabled) { background: #f06300; }
.vc-btn--copy.vc-copied { background: #1ea361; border-color: #1ea361; }

.vc-btn--test-approve {
  background: #14351f;
  color: #7cf5a0;
  border-color: rgba(124,245,160,0.35);
  font-size: 13px;
  min-height: 42px;
}
.vc-btn--test-approve:hover:not(:disabled) {
  background: #1b482a;
  border-color: rgba(124,245,160,0.55);
}
.vc-btn--test-approve:disabled {
  opacity: 1;
  background: #1f7a3d;
  color: #fff;
}

/* ── Formulário de endereço ──────────────────────────────────── */
.vc-address-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
}

.vc-addr-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vc-addr-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vc-addr-input {
  width: 100%;
  min-width: 0;
  height: 46px;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #fff;
  padding: 0 14px;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}
.vc-addr-input::placeholder { color: #555; }
.vc-addr-input:focus { border-color: #ff6a00; }
.vc-addr-input.vc-addr-error {
  border-color: #e04040;
  animation: vc-shake 0.32s ease;
}

@keyframes vc-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-5px); }
  75%     { transform: translateX(5px); }
}

/* ── Card de resumo ─────────────────────────────────────────── */
.vc-summary-card {
  background: #181818;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: stretch;
  animation: vc-fadein 0.24s ease forwards;
}

.vc-summary-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.vc-summary-row:first-child { padding-top: 0; }
.vc-summary-row:last-child  { border-bottom: none; padding-bottom: 0; }

.vc-summary-label {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vc-summary-value {
  font-size: 14px;
  color: #e8e8e8;
  line-height: 1.5;
  word-break: break-word;
}

/* ── Card Pix ───────────────────────────────────────────────── */
.vc-pix-card {
  background: #181818;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  animation: vc-fadein 0.24s ease forwards;
}

.vc-pix-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.vc-pix-amount {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #777;
  font-size: 12px;
}

.vc-pix-amount strong {
  color: #ff6a00;
  font-size: 14px;
  text-align: right;
}

.vc-pix-steps { display: flex; flex-direction: column; gap: 6px; }

.vc-pix-step {
  font-size: 13px;
  color: #aaa;
  line-height: 1.5;
  display: flex;
  gap: 8px;
}

.vc-pix-step-num {
  color: #ff6a00;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 16px;
}

.vc-pix-code-label {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vc-pix-code-box {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 13px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #bbb;
  word-break: break-all;
  line-height: 1.7;
  user-select: all;
  cursor: text;
}

.vc-pix-help-toggle {
  background: none;
  border: none;
  color: #ff6a00;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.vc-pix-help-toggle:hover { color: #ffa552; }

.vc-pix-help-body { display: none; flex-direction: column; gap: 5px; padding-top: 8px; }
.vc-pix-help-body.vc-open { display: flex; }

.vc-pix-help-item {
  font-size: 12px; color: #888; line-height: 1.5;
  display: flex; gap: 6px;
}
.vc-pix-help-icon { color: #ff6a00; flex-shrink: 0; }

/* ── Desktop ─────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .vc-overlay {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
    background: rgba(0,0,0,0.48);
  }
  .vc-chat {
    width: 420px;
    max-width: 420px;
    height: 680px;
    border-radius: 24px;
    margin: 0;
  }
  .vc-chat::before { display: none; }
}

/* ── Body lock ───────────────────────────────────────────────── */
body.vc-scroll-locked {
  overflow: hidden;
  touch-action: none;
}
