@charset "UTF-8";
/*
 * Chat do site do Portal CRM (portalcrm.online). Todas as classes comecam com .pcc- para nao esbarrar
 * nas classes utilitarias da home. As cores vem dos tokens da propria home (--surface-elevated,
 * --foreground, --primary...), que ja trocam entre o tema escuro (padrao) e o claro ([data-theme=light] no
 * <html>), entao o chat acompanha o botao de tema sem codigo extra. Os valores depois da virgula so valem
 * se a home nao carregar.
 *
 * Contraste conferido (WCAG AA, tests/contraste.test.mjs): texto 4.5:1 ou mais, foco e bordas de controle
 * 3:1 ou mais, nos dois temas. No tema claro o botao e o foco usam o ciano da marca escurecido (74% de
 * ciano + 26% de preto), porque o ciano puro com texto branco fica em 3.3:1.
 */

.pcc-root {
  /* chega depois da folha de estilo: o JS cria a raiz invisivel para nao aparecer meia desenhada */
  visibility: visible !important;

  --pcc-bg: var(--surface-elevated, #191e26);
  --pcc-field: var(--surface, #12161d);
  --pcc-fg: var(--foreground, #f3f5f8);
  --pcc-muted: var(--muted-foreground, #9399a0);
  --pcc-line: var(--border-strong, rgba(255, 255, 255, 0.16));
  /* borda de campo e de botao: precisa de 3:1 contra o fundo para o controle ser reconhecivel */
  --pcc-control: color-mix(in oklab, var(--pcc-fg) 50%, var(--pcc-bg));
  --pcc-soft: var(--muted, #20242b);
  --pcc-accent: var(--primary, #00d3e4);
  --pcc-on-accent: var(--primary-foreground, #0b121a);
  --pcc-cta: var(--primary, #00d3e4);
  --pcc-on-cta: var(--primary-foreground, #0b121a);
  --pcc-focus: var(--primary, #00d3e4);
  --pcc-danger: color-mix(in oklab, var(--danger, #ec5258) 70%, var(--foreground, #f3f5f8));
  --pcc-warn: color-mix(in oklab, var(--warning, #efb146) 55%, var(--foreground, #f3f5f8));
  --pcc-whatsapp: var(--whatsapp, #5ec966);
  --pcc-wa-icon: var(--pcc-whatsapp);
  --pcc-shadow: var(--float-shadow, 0 24px 60px -24px rgba(0, 0, 0, 0.55));
  --pcc-radius: calc(var(--radius, 0.875rem) + 4px);
  --pcc-radius-sm: calc(var(--radius, 0.875rem) - 6px);

  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: normal;
  text-align: left;
  color: var(--pcc-fg);
  -webkit-text-size-adjust: 100%;
}

/* Tema claro da home: ciano escurecido para o botao e o foco (contraste), ciano da marca nos detalhes. */
:root[data-theme="light"] .pcc-root {
  --pcc-cta: color-mix(in oklab, var(--primary, #009ab2) 74%, #000);
  --pcc-on-cta: #fff;
  --pcc-accent: color-mix(in oklab, var(--primary, #009ab2) 74%, #000);
  --pcc-focus: color-mix(in oklab, var(--primary, #009ab2) 74%, #000);
  /* o verde do WhatsApp sobre fundo branco fica em 2.1:1: escurece o icone */
  --pcc-wa-icon: color-mix(in oklab, var(--whatsapp, #5ec966) 65%, #000);
}

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

.pcc-root [hidden] {
  display: none !important;
}

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

/* :where() zera a especificidade: estes ajustes valem so como ponto de partida e nao ganham das classes do chat. */
:where(.pcc-root) :where(button, input, textarea) {
  font: inherit;
  color: inherit;
  margin: 0;
}

:where(.pcc-root) :where(p, h2) {
  margin: 0;
}

.pcc-ic {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
}

.pcc-root :focus {
  outline: none;
}
.pcc-root :focus-visible {
  outline: 2px solid var(--pcc-focus);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------------------------
 * Botao flutuante
 * ------------------------------------------------------------------------------------------- */

.pcc-launcher {
  position: fixed;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--pcc-line);
  border-radius: var(--pcc-radius-sm);
  background: var(--pcc-bg);
  color: var(--pcc-fg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--pcc-shadow);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.pcc-launcher:hover {
  border-color: var(--pcc-accent);
}
.pcc-launcher-ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--pcc-cta);
  color: var(--pcc-on-cta);
}
.pcc-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pcc-accent);
  border: 2px solid var(--pcc-bg);
}

/* No celular o painel e uma folha que cobre o canto onde esta o botao: ele some enquanto a folha esta aberta. */
.pcc-root[data-open] .pcc-launcher {
  display: none;
}

/* ---------------------------------------------------------------------------------------------
 * Painel
 * ------------------------------------------------------------------------------------------- */

.pcc-panel {
  position: fixed;
  z-index: 61;
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  /* --pcc-vb: o teclado virtual do iPhone cobre a base sem mudar a janela; o JS empurra a folha para cima dele */
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--pcc-vb, 0px));
  display: flex;
  flex-direction: column;
  /* deixa o cabecalho da home (menu e tema) a vista acima da folha */
  height: min(640px, calc(100vh - 72px));
  height: min(640px, calc(var(--pcc-vh, 100dvh) - 72px));
  overflow: hidden;
  border: 1px solid var(--pcc-line);
  border-radius: var(--pcc-radius);
  background: var(--pcc-bg);
  box-shadow: var(--pcc-shadow);
  animation: pcc-in 180ms ease-out;
}

.pcc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 8px 12px 16px;
  border-bottom: 1px solid var(--pcc-line);
}
.pcc-head-copy {
  min-width: 0;
}
.pcc-eyebrow {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pcc-accent);
}
.pcc-title {
  margin-top: 4px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--pcc-fg);
}
.pcc-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--pcc-muted);
}

.pcc-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--pcc-fg);
  cursor: pointer;
}
.pcc-close:hover {
  background: var(--pcc-soft);
}

.pcc-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
}
.pcc-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pcc-talk {
  padding: 0;
}

/* ---------------------------------------------------------------------------------------------
 * Formulario
 * ------------------------------------------------------------------------------------------- */

.pcc-field {
  margin-bottom: 14px;
}
.pcc-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pcc-fg);
}
.pcc-input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--pcc-control);
  border-radius: 10px;
  background: var(--pcc-field);
  color: var(--pcc-fg);
  /* 16px: abaixo disso o Safari do iPhone da zoom ao focar o campo */
  font-size: 16px;
  line-height: 1.4;
}
.pcc-input::placeholder {
  color: var(--pcc-muted);
  opacity: 1;
}
.pcc-input:focus-visible {
  outline: 2px solid var(--pcc-focus);
  outline-offset: 1px;
  border-color: var(--pcc-focus);
}
.pcc-input[aria-invalid="true"] {
  border-color: var(--pcc-danger);
}
.pcc-textarea {
  min-height: 92px;
  resize: vertical;
}
.pcc-hint {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--pcc-muted);
}
.pcc-error {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pcc-danger);
}
.pcc-trap {
  position: absolute !important;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pcc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--pcc-radius-sm);
  background: var(--pcc-cta);
  color: var(--pcc-on-cta);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter 150ms ease;
}
.pcc-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}
.pcc-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}
.pcc-btn-block {
  width: 100%;
}
.pcc-btn-ghost {
  margin-top: 10px;
  border-color: var(--pcc-control);
  background: transparent;
  color: var(--pcc-fg);
}
.pcc-btn-wa {
  margin-top: 14px;
  background: var(--pcc-whatsapp);
  color: #0b121a;
}

.pcc-privacy {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--pcc-muted);
}
.pcc-privacy a,
.pcc-note-link {
  color: var(--pcc-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------------------------------------
 * Avisos
 * ------------------------------------------------------------------------------------------- */

.pcc-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid var(--pcc-line);
  border-left: 3px solid var(--pcc-accent);
  border-radius: 8px;
  background: var(--pcc-bg);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--pcc-fg);
}
.pcc-note-danger {
  border-left-color: var(--pcc-danger);
  color: var(--pcc-danger);
}
.pcc-note-warn {
  border-left-color: var(--pcc-warn);
  color: var(--pcc-warn);
}
.pcc-status {
  flex: none;
  padding: 0 14px;
}
.pcc-status .pcc-note {
  margin-bottom: 8px;
}

.pcc-dots {
  display: inline-flex;
  gap: 3px;
}
.pcc-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pcc-accent);
  animation: pcc-dot 1.1s ease-in-out infinite;
}
.pcc-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.pcc-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---------------------------------------------------------------------------------------------
 * Conversa
 * ------------------------------------------------------------------------------------------- */

.pcc-log {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  padding: 14px 16px;
}
.pcc-msg {
  align-self: flex-start;
  max-width: 88%;
  padding: 8px 12px 9px;
  border: 1px solid transparent;
  border-radius: 12px 12px 12px 4px;
  background: var(--pcc-soft);
  color: var(--pcc-fg);
}
.pcc-msg[data-de="visitante"] {
  align-self: flex-end;
  border-radius: 12px 12px 4px 12px;
  background: color-mix(in oklab, var(--pcc-accent) 16%, var(--pcc-bg));
  border-color: color-mix(in oklab, var(--pcc-accent) 34%, transparent);
}
.pcc-msg[data-estado="enviando"] {
  opacity: 0.75;
}
.pcc-msg[data-estado="erro"] {
  border-color: var(--pcc-danger);
}
.pcc-msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.3;
  color: color-mix(in oklab, var(--pcc-fg) 78%, var(--pcc-bg));
}
.pcc-msg-meta span {
  font-weight: 600;
}
.pcc-msg-text {
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pcc-msg-fail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--pcc-danger);
}
.pcc-retry {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--pcc-fg);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.pcc-msg[data-new] {
  animation: pcc-msg 220ms ease-out;
}

.pcc-composer {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  flex: none;
  padding: 10px 12px 6px;
  border-top: 1px solid var(--pcc-line);
}
.pcc-composer .pcc-input {
  min-height: 44px;
  max-height: 112px;
  resize: none;
}
.pcc-send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--pcc-cta);
  color: var(--pcc-on-cta);
  cursor: pointer;
}
.pcc-send:disabled {
  opacity: 0.45;
  cursor: default;
}
.pcc-composer-hint {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--pcc-muted);
}

.pcc-foot {
  flex: none;
  padding: 2px 16px 10px;
  border-top: 1px solid var(--pcc-line);
}
.pcc-talk + .pcc-foot,
.pcc-foot {
  border-top-color: var(--pcc-line);
}
.pcc-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  color: var(--pcc-fg);
  text-decoration: none;
}
.pcc-wa .pcc-ic {
  width: 16px;
  height: 16px;
  color: var(--pcc-wa-icon);
}
.pcc-wa-go {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------------------------------------
 * Convite
 * ------------------------------------------------------------------------------------------- */

.pcc-invite {
  position: fixed;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 48px + 12px);
  width: min(320px, calc(100vw - 32px));
  padding: 14px 8px 8px 16px;
  border: 1px solid var(--pcc-line);
  border-radius: var(--pcc-radius);
  background: var(--pcc-bg);
  box-shadow: var(--pcc-shadow);
  animation: pcc-in 220ms ease-out;
}
.pcc-invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pcc-invite-title {
  margin-top: 2px;
  padding-right: 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.pcc-invite-text {
  margin-top: 4px;
  padding-right: 8px;
  font-size: 14px;
  color: var(--pcc-muted);
}
.pcc-invite-cta {
  width: calc(100% - 8px);
  margin-top: 12px;
}
.pcc-invite .pcc-wa {
  margin-top: 4px;
}

/* ---------------------------------------------------------------------------------------------
 * Telas maiores: o painel fica no canto, acima do botao
 * ------------------------------------------------------------------------------------------- */

@media (min-width: 40rem) {
  .pcc-launcher {
    right: 20px;
    bottom: 20px;
  }
  .pcc-root[data-open] .pcc-launcher {
    display: inline-flex;
  }
  .pcc-panel {
    left: auto;
    right: 20px;
    bottom: 80px;
    width: 384px;
    /* 80px de base + o cabecalho da home + um respiro */
    height: min(620px, calc(100vh - 156px));
    height: min(620px, calc(100dvh - 156px));
  }
  .pcc-invite {
    right: 20px;
    bottom: 80px;
  }
}

/* Janela baixa (celular deitado): o convite perde o texto de apoio para caber. */
@media (max-height: 37.5rem) {
  .pcc-invite-text,
  .pcc-invite .pcc-wa {
    display: none;
  }
  .pcc-invite {
    padding-bottom: 12px;
  }
}

/* ---------------------------------------------------------------------------------------------
 * Movimento, alto contraste e impressao
 * ------------------------------------------------------------------------------------------- */

@keyframes pcc-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pcc-msg {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pcc-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pcc-panel,
  .pcc-invite,
  .pcc-msg[data-new],
  .pcc-dots i {
    animation: none;
  }
  .pcc-launcher,
  .pcc-btn {
    transition: none;
  }
}

@media (forced-colors: active) {
  .pcc-panel,
  .pcc-invite,
  .pcc-launcher,
  .pcc-input,
  .pcc-btn,
  .pcc-send,
  .pcc-msg,
  .pcc-note {
    border: 1px solid CanvasText;
  }
  .pcc-btn,
  .pcc-send,
  .pcc-launcher-ic {
    forced-color-adjust: none;
    background: ButtonFace;
    color: ButtonText;
  }
}

@media print {
  .pcc-root {
    display: none !important;
  }
}
