/* =====================================================
   AGUA CONCIERGE - concierge.css
   Widget de Autoatendimento Tático & Triagem Interativa
   Zero dependências • Estabilidade visual (Zero Hover Shift)
   ===================================================== */

/* Launcher Flutuante (Trigger) */
.concierge-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-2);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.concierge-launcher:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  background: var(--color-surface-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.concierge-launcher:active {
  transform: translateY(0);
  background: var(--color-surface-3);
}

.concierge-launcher .launcher-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 2px solid var(--color-surface);
  box-sizing: content-box;
  display: block;
  z-index: 2;
  transition: border-color 0.15s ease;
}

.concierge-launcher:hover .launcher-dot {
  border-color: var(--color-surface-2);
}

.concierge-launcher .launcher-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background-color: var(--color-accent);
  opacity: 0.8;
  animation: concierge-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes concierge-ping {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.concierge-launcher .launcher-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.concierge-launcher .launcher-icon svg {
  width: 100%;
  height: 100%;
}

.concierge-launcher .launcher-close-icon {
  display: none;
}

.concierge-launcher.is-open .launcher-dot,
.concierge-launcher.is-open .launcher-chat-icon {
  display: none;
}

.concierge-launcher.is-open .launcher-close-icon {
  display: flex;
}

.concierge-launcher.is-open {
  background: var(--color-surface-2);
}

/* Painel de Autoatendimento */
.concierge-panel {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 110px);
  z-index: 9998;
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(8px);
  font-family: var(--font-sans);
}

.concierge-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Cabeçalho */
.concierge-header {
  padding: 14px 16px;
  background: #18181b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.concierge-header-profile {
  display: flex;
  align-items: center;
  gap: 11px;
}

.concierge-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1c1c20;
  border: 1.5px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-accent);
  position: relative;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.concierge-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border: 2px solid #18181b;
  border-radius: 50%;
}

.concierge-header-info {
  display: flex;
  flex-direction: column;
}

.concierge-header-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.concierge-header-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--color-accent-dim);
  color: var(--color-accent);
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.concierge-header-sub {
  font-size: 0.75rem;
  color: #8e8e98;
  margin-top: 2px;
  font-weight: 400;
}

.concierge-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.concierge-btn-icon {
  background: transparent;
  border: 0;
  color: #8e8e98;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.concierge-btn-icon:hover {
  background: #25252c;
  color: var(--color-text);
}

/* Área de Diálogo / Histórico */
.concierge-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.concierge-body::-webkit-scrollbar {
  width: 5px;
}

.concierge-body::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Balões de Mensagem - Zero Bordas Pesadas */
.concierge-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.concierge-msg-bot {
  align-self: flex-start;
}

.concierge-msg-user {
  align-self: flex-end;
}

.concierge-bubble {
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.8875rem;
  line-height: 1.6;
  word-break: break-word;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
}

.concierge-msg-bot .concierge-bubble {
  background: #1c1c20;
  border: none !important;
  color: #e4e4e7;
  border-bottom-left-radius: 3px;
}

.concierge-msg-bot .concierge-bubble strong {
  font-weight: 600;
  color: #ffffff;
}

.concierge-msg-user .concierge-bubble {
  background: var(--color-accent);
  color: #141416;
  border: none !important;
  font-weight: 600;
  border-bottom-right-radius: 3px;
}

.concierge-msg-time {
  font-size: 0.6875rem;
  color: #71717a;
  margin-top: 4px;
  padding: 0 4px;
}

.concierge-msg-user .concierge-msg-time {
  align-self: flex-end;
}

/* Sistema Estruturado de Opções - Zero Bordas */
.concierge-actions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.concierge-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.concierge-option-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #1c1c20;
  border: none !important;
  border-radius: 8px;
  color: #e4e4e7;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.concierge-option-item .option-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.concierge-option-item .option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #8e8e98;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.concierge-option-item .option-icon svg {
  width: 100%;
  height: 100%;
}

.concierge-option-item .option-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #8e8e98;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.concierge-option-item .option-chevron svg {
  width: 100%;
  height: 100%;
}

.concierge-option-item:hover {
  background: #25252c;
  color: #ffffff;
}

.concierge-option-item:hover .option-icon,
.concierge-option-item:hover .option-chevron {
  color: var(--color-accent);
}

.concierge-option-item:active {
  background: #18181b;
}

/* Grade Simétrica de 2 Colunas */
.concierge-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.concierge-grid-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: #1c1c20;
  border: none !important;
  border-radius: 8px;
  color: #e4e4e7;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  text-align: center;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.concierge-grid-btn svg {
  width: 15px;
  height: 15px;
  color: #8e8e98;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.concierge-grid-btn:hover {
  background: #25252c;
  color: #ffffff;
}

.concierge-grid-btn:hover svg {
  color: var(--color-accent);
}

.concierge-grid-btn:active {
  background: #18181b;
}

/* Botão de Retorno */
.concierge-back-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #8e8e98;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.concierge-back-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.concierge-back-btn:hover {
  background: #1c1c20;
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* Botão de Ação Direta (WhatsApp CTA) */
.concierge-cta-card {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.concierge-cta-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-accent);
  color: #141416;
  font-weight: 700;
  font-size: 0.8875rem;
  padding: 11px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease;
  cursor: pointer;
  border: none !important;
}

.concierge-cta-btn:hover {
  background: var(--color-accent-2);
}

.concierge-cta-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Indicador de Digitação (Typing Simulator) */
.concierge-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  background: #1c1c20;
  border: none !important;
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}

.concierge-typing span {
  width: 5px;
  height: 5px;
  background: #8e8e98;
  border-radius: 50%;
  animation: concierge-bounce 1.3s infinite;
}

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

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

@keyframes concierge-bounce {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* Rodapé / Input de Digitação */
.concierge-footer {
  padding: 11px 14px;
  background: #18181b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.concierge-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.concierge-input {
  width: 100%;
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  padding: 9px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 350;
  outline: none;
  transition: border-color 0.15s ease;
}

.concierge-input:focus {
  border-color: rgba(215, 242, 12, 0.45);
}

.concierge-input::placeholder {
  color: #71717a;
  font-weight: 350;
}

.concierge-send-btn {
  background: var(--color-accent);
  color: #141416;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.concierge-send-btn:hover {
  background: var(--color-accent-2);
}

/* Responsividade Mobile (< 640px) */
@media (max-width: 640px) {
  .concierge-launcher {
    bottom: 16px;
    right: 16px;
  }

  .concierge-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 82vh;
    max-height: 85vh;
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
    border-left: 0;
    border-right: 0;
  }
}
