/* Importando fontes místicas e modernas do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --bg-color: #0b071e;
  --panel-bg: rgba(20, 15, 45, 0.6);
  --accent-gold: #ffd700;
  --accent-gold-hover: #ffea70;
  --accent-purple: #8a2be2;
  --accent-indigo: #4b0082;
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --border-glass: rgba(255, 215, 0, 0.15);
  --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.2);
  --font-mystic: 'Cinzel', serif;
  --font-sans: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  outline: none;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(75, 0, 130, 0.2) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Efeito de Estrelas Cintilantes no Fundo (Desativado em favor do Canvas Dinâmico) */
body::before {
  content: "";
  display: none;
}

/* Canvas do Universo Dinâmico */
#universe-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

header {
  padding: 2rem 5% 1rem 5%;
  text-align: center;
  z-index: 10;
}

header h1 {
  font-family: var(--font-mystic);
  font-size: 2.5rem;
  color: var(--accent-gold);
  text-shadow: var(--shadow-gold);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 300;
}

main {
  flex: 1;
  display: flex;
  max-width: 1200px;
  width: 90%;
  margin: 0 auto 3rem auto;
  gap: 3rem;
  align-items: stretch;
  z-index: 10;
}

/* Lado Esquerdo - Detalhes do Negócio */
.info-section {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro-card {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  margin-bottom: 2rem;
}

.intro-card h2 {
  font-family: var(--font-mystic);
  font-size: 1.8rem;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  padding-bottom: 0.5rem;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.step-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.step-number {
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  color: var(--bg-color);
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
}

.step-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Lado Direito - O Chatbot */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-container {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Cabeçalho do Chat */
.chat-header {
  padding: 1.2rem;
  background: rgba(15, 10, 35, 0.8);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bot-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent-gold);
  box-shadow: var(--shadow-gold);
  font-size: 1.5rem;
}

.bot-status-info h4 {
  font-family: var(--font-mystic);
  font-size: 1.1rem;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

.bot-status-info span {
  font-size: 0.8rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.bot-status-info span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Área de Mensagens */
.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Rolagem suave nativa no iOS */
}

/* Estilo dos Balões de Mensagem */
.message {
  max-width: 85%;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.95rem;
  animation: slideUp 0.3s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

.message.bot {
  background: rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
  align-self: flex-start;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.message.user {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  border-top-right-radius: 4px;
  align-self: flex-end;
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

/* Balão especial para o código PIX */
.pix-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--accent-gold);
  padding: 0.8rem;
  border-radius: 8px;
  font-family: monospace;
  word-break: break-all;
  margin: 0.8rem 0;
  user-select: all;
  -webkit-user-select: all; /* Suporte Safari iOS */
  font-size: 0.85rem;
  text-align: center;
  color: var(--accent-gold);
}

/* Opções Interativas (Botões) */
.chat-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.5rem;
  width: 100%;
}

.option-btn {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--text-primary);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-align: left;
  -webkit-tap-highlight-color: transparent; /* Remove contorno cinza no clique (celular) */
}

@media (hover: hover) {
  .option-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--accent-gold);
    transform: translateX(5px);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
  }
}

.option-btn:active {
  background: rgba(255, 215, 0, 0.15);
  transform: scale(0.97); /* Feedback de toque */
}

/* Botão de reiniciar o chat no cabeçalho */
#reset-chat-btn {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--accent-gold);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (hover: hover) {
  #reset-chat-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--accent-gold);
  }
}

#reset-chat-btn:active {
  transform: scale(0.95);
}

/* Botão de copiar chave Pix */
#copy-pix-btn {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  width: 100%;
  min-width: 180px;
  transition: all 0.2s ease;
  margin-top: 0.6rem;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media (hover: hover) {
  #copy-pix-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    color: white;
  }
}

#copy-pix-btn:active {
  transform: scale(0.98);
}

/* Label customizada para upload de arquivo */
.upload-label {
  display: block;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .upload-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.5);
  }
}

.upload-label:active {
  transform: translateY(0) scale(0.98);
}

/* Área de Input do Usuário (Nome) */
.chat-input-area {
  padding: 1.2rem;
  background: rgba(10, 5, 25, 0.9);
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 0.8rem;
}

.chat-input-area textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px; /* Importante: mínimo de 16px para evitar auto-zoom no iOS Safari */
  outline: none;
  resize: none;
  transition: border 0.2s ease;
}

.chat-input-area textarea:focus {
  border-color: var(--accent-purple);
}

.chat-input-area button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  color: var(--bg-color);
  border: none;
  border-radius: 12px;
  padding: 0 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .chat-input-area button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
    background: var(--accent-gold-hover);
  }
}

.chat-input-area button:active {
  transform: translateY(0) scale(0.97);
}

/* Indicador de Digitação (Typing) */
.typing-indicator {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem 0;
  align-items: center;
  justify-content: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Animações */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Rodapé */
footer {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 5, 25, 0.5);
  margin-top: auto;
  z-index: 10;
}

/* Responsividade - TOTALMENTE OTIMIZADA PARA CELULARES */
@media (max-width: 900px) {
  header {
    padding: 1.5rem 5% 0.5rem 5%;
  }

  header h1 {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }

  header p {
    font-size: 0.9rem;
  }

  main {
    flex-direction: column;
    gap: 1.5rem;
    width: 95%;
    margin-bottom: 2rem;
  }
  
  .chat-section {
    order: 1; /* Chat fica em primeiro lugar no celular */
  }
  
  .info-section {
    order: 2; /* Informações descem para segundo plano */
  }
  
  .chat-container {
    height: 520px; /* Altura confortável para caber teclado virtual */
    border-radius: 20px;
  }

  .chat-header {
    padding: 0.8rem 1rem;
    gap: 0.5rem;
  }

  .bot-avatar {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .bot-status-info h4 {
    font-size: 0.95rem;
  }

  .bot-status-info span {
    font-size: 0.7rem;
  }

  #reset-chat-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .chat-messages {
    padding: 1rem;
    gap: 1rem;
  }

  .message {
    max-width: 90%;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }
  
  .intro-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .intro-card h2 {
    font-size: 1.4rem;
  }

  .step-content h3 {
    font-size: 1rem;
  }

  .step-content p {
    font-size: 0.85rem;
  }
}
