/* Onboarding Agent POC — overlay sobre o site existente */

:root {
  --poc-orange: #ff6600;
  --poc-orange-soft: #fff3e6;
  --poc-text: #1a1a1a;
  --poc-text-soft: #555;
  --poc-border: #e5e7eb;
  --poc-bg: #fff;
  --poc-bg-soft: #f8f9fa;
  --poc-radius: 12px;
  --poc-shadow: 0 8px 32px rgba(0,0,0,0.12);
  --poc-success: #10b981;
}

/* ========== Floating Action Button ========== */
.poc-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--poc-orange);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 102, 0, 0.4);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}
.poc-fab:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(255,102,0,0.5); }
.poc-fab.hidden { display: none; }
.poc-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 6px;
  border: 2px solid #fff;
}

/* ========== Chat Panel ========== */
.poc-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: calc(100vh - 48px);
  max-height: 820px;
  background: var(--poc-bg);
  border-radius: var(--poc-radius);
  box-shadow: var(--poc-shadow);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  border: 1px solid var(--poc-border);
}
.poc-chat.hidden { display: none; }

.poc-chat-header {
  background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.poc-chat-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.poc-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.poc-chat-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.poc-chat-status { font-size: 11px; opacity: 0.9; }
.poc-chat-status::before { content: "● "; color: #6ee7b7; }

.poc-chat-actions { display: flex; gap: 4px; }
.poc-chat-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0.9;
}
.poc-chat-btn:hover { background: rgba(255,255,255,0.2); opacity: 1; }

/* Body com checklist + mensagens */
.poc-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.poc-checklist {
  padding: 10px 16px;
  background: var(--poc-bg-soft);
  border-bottom: 1px solid var(--poc-border);
  flex-shrink: 0;
}
.poc-checklist-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--poc-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.poc-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--poc-text-soft);
}
.poc-step-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--poc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  background: #fff;
}
.poc-step.active .poc-step-icon {
  border-color: var(--poc-orange);
  background: var(--poc-orange-soft);
  color: var(--poc-orange);
  font-weight: 700;
}
.poc-step.done .poc-step-icon {
  border-color: var(--poc-success);
  background: var(--poc-success);
  color: #fff;
}
.poc-step.done { color: var(--poc-text); text-decoration: line-through; opacity: 0.7; }
.poc-step.active { color: var(--poc-text); font-weight: 600; }

/* Messages area */
.poc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.poc-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}
.poc-msg.agent {
  background: var(--poc-bg-soft);
  color: var(--poc-text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.poc-msg.user {
  background: var(--poc-orange);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.poc-msg code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}
.poc-msg.user code { background: rgba(255,255,255,0.2); }
.poc-msg pre {
  background: #1a1a1a;
  color: #f1f5f9;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 11px;
  margin: 6px 0 0;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Code block with copy button */
.poc-code {
  background: #1a1a1a;
  border-radius: 6px;
  margin: 6px 0 0;
  overflow: hidden;
}
.poc-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #2a2a2a;
  color: #f1f5f9;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.poc-code-copy {
  background: var(--poc-orange);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.poc-code-copy:hover { background: #e55a00; }
.poc-code pre {
  background: #1a1a1a;
  color: #f1f5f9;
  padding: 10px;
  margin: 0;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}

/* Inline form (passo 1) */
.poc-form {
  background: var(--poc-bg-soft);
  border: 1px solid var(--poc-border);
  border-radius: 10px;
  padding: 14px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.poc-form-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--poc-text);
  margin: 0;
}
.poc-form-field { display: flex; flex-direction: column; gap: 4px; }
.poc-form-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--poc-text-soft);
}
.poc-form-field input,
.poc-form-field select {
  padding: 8px 10px;
  border: 1px solid var(--poc-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.poc-form-field input:focus,
.poc-form-field select:focus {
  outline: 2px solid var(--poc-orange-soft);
  border-color: var(--poc-orange);
}
.poc-form button {
  background: var(--poc-orange);
  color: #fff;
  border: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.poc-form button:hover { background: #e55a00; }
.poc-form button:disabled { opacity: 0.5; cursor: not-allowed; }

.poc-form-skip {
  font-size: 12px;
  color: var(--poc-text-soft);
  margin: 6px 0 0;
  text-align: center;
}
.poc-form-skip a {
  color: var(--poc-orange);
  text-decoration: none;
  font-weight: 500;
}
.poc-form-skip a:hover { text-decoration: underline; }

/* Quick replies */
.poc-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
  flex-shrink: 0;
}
.poc-quick-btn {
  background: #fff;
  border: 1px solid var(--poc-orange);
  color: var(--poc-orange);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.poc-quick-btn:hover { background: var(--poc-orange-soft); }

/* Input area */
.poc-input-area {
  border-top: 1px solid var(--poc-border);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
.poc-input {
  flex: 1;
  border: 1px solid var(--poc-border);
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.poc-input:focus { border-color: var(--poc-orange); }
.poc-send {
  background: var(--poc-orange);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.poc-send:hover { background: #e55a00; }
.poc-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Typing indicator */
.poc-typing {
  display: flex;
  gap: 3px;
  padding: 10px 12px;
  align-self: flex-start;
  background: var(--poc-bg-soft);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.poc-typing span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: poc-bounce 1.2s infinite;
}
.poc-typing span:nth-child(2) { animation-delay: 0.15s; }
.poc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes poc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Tag POC */
.poc-tag {
  position: fixed;
  top: 8px;
  left: 8px;
  background: #fef3c7;
  color: #92400e;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #fcd34d;
  z-index: 10000;
}

@media (max-width: 480px) {
  .poc-chat { width: 100vw; height: 100vh; bottom: 0; right: 0; border-radius: 0; }
}
