@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  
  /* Paleta de Cores - A Selva */
  --bg-gradient-start: #040e09;
  --bg-gradient-end: #092215;
  --bg-card: rgba(10, 32, 20, 0.55);
  --bg-card-hover: rgba(16, 48, 30, 0.7);
  --bg-input: rgba(5, 20, 12, 0.85);
  
  --primary: #cda351; /* Dourado */
  --primary-hover: #e5c17d;
  --primary-glow: rgba(205, 163, 81, 0.2);
  --primary-glow-strong: rgba(205, 163, 81, 0.4);
  
  --border-color: rgba(205, 163, 81, 0.15);
  --border-focus: rgba(205, 163, 81, 0.5);
  
  --text-main: #f4fcf6;
  --text-muted: #839b8e;
  --text-inverse: #040e09;
  
  --transition-speed: 0.4s;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: radial-gradient(circle at 100% 0%, var(--bg-gradient-end) 0%, var(--bg-gradient-start) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Efeito de Feixe de Luz Dourada (Light Leak) */
.light-leak {
  position: absolute;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(205, 163, 81, 0.08) 0%, rgba(205, 163, 81, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
}

/* Marca d'água de folhas tropicais no fundo */
.background-leaves {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50%;
  height: 60%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.04" fill="%23839b8e"><path d="M50,10 C40,30 20,40 10,60 C5,70 12,80 25,80 C40,80 50,60 50,50 C50,60 60,80 75,80 C88,80 95,70 90,60 C80,40 60,30 50,10 Z"/></svg>');
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: contain;
  pointer-events: none;
  z-index: 1;
}

/* Barra de Progresso Fina Dourada */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.03);
  z-index: 100;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
  box-shadow: 0 0 10px var(--primary-glow-strong);
  transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wrapper Principal */
.form-wrapper {
  width: 90%;
  max-width: 680px;
  min-height: 450px;
  z-index: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Cartões de Etapa (Typeform style transitions) */
.step-card {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-card.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

/* Efeito de saída */
.step-card.slide-out {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

/* Tela de boas-vindas / final */
.logo-container {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  align-self: center;
  transition: all 0.3s ease;
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px var(--primary-glow-strong));
  transition: transform var(--transition-speed);
}

.logo-container img:hover {
  transform: scale(1.05);
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.brand-title span {
  color: var(--primary);
  font-weight: 700;
  display: block;
}

.brand-subtitle {
  font-size: 0.85rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 500;
}

.step-description {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Botões do Formulário */
.btn-container {
  display: flex;
  justify-content: center;
}

.btn-start {
  background: var(--primary);
  color: var(--text-inverse);
  border: 1px solid var(--primary);
  padding: 1.1rem 2.2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(205, 163, 81, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-start:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 0 25px var(--primary-glow-strong);
  transform: translateY(-2px);
}

.btn-start .arrow-icon {
  transition: transform 0.2s;
}

.btn-start:hover .arrow-icon {
  transform: translateX(4px);
}

/* Identificadores das Perguntas */
.step-number {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: inline-block;
  letter-spacing: 1px;
}

.step-label {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: block;
}

.field-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Inputs de Texto/Formulário */
.input-wrapper {
  position: relative;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2.5rem;
  transition: border-bottom-color 0.3s;
}

.input-wrapper:focus-within {
  border-bottom-color: var(--primary);
}

.input-wrapper input, .input-wrapper textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1.6rem;
  color: var(--text-main);
  padding: 0.8rem 0;
  transition: all 0.3s;
}

.input-wrapper input::placeholder, .input-wrapper textarea::placeholder {
  color: rgba(244, 252, 246, 0.15);
}

.input-wrapper textarea {
  resize: none;
  font-size: 1.3rem;
  line-height: 1.5;
}

/* Input de Preço/Moeda */
.currency-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.currency-symbol {
  font-size: 1.6rem;
  color: var(--primary);
  font-weight: 600;
}

/* Botões de Opção Rápida (Seleção de Múltipla Escolha) */
.option-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.option-grid.columns-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

@media (max-width: 600px) {
  .option-grid.columns-2 {
    grid-template-columns: 1fr;
  }
}

.option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 1.1rem 1.5rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  box-shadow: inset 0 0 10px rgba(205, 163, 81, 0.05);
  transform: translateX(4px);
}

.option-btn.selected {
  background: rgba(205, 163, 81, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(205, 163, 81, 0.1);
  font-weight: 600;
}

/* Estilos de seleção de opção simplificados sem badges */

/* Controles de Navegação (Voltar / Avançar) */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-next {
  background: var(--primary);
  color: var(--text-inverse);
  border: 1px solid var(--primary);
  padding: 0.75rem 1.8rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(205, 163, 81, 0.15);
}

.btn-next:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-submit {
  background: #10b981;
  color: #fff;
  border: 1px solid #10b981;
  padding: 0.9rem 2.2rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-submit:hover {
  background: #059669;
  border-color: #059669;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-prev {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 0.75rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-prev:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.keyboard-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.keyboard-hint strong {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--text-main);
  font-weight: 600;
}

/* Sucesso final e centralização */
.logo-container.success img {
  filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.5));
}

.brand-title.success {
  font-size: 2.2rem;
}

.success-message {
  color: var(--primary-hover);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Animações e Dicas */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.btn-start {
  animation: pulse 3s infinite ease-in-out;
}

.btn-start:hover {
  animation: none;
}

/* ==========================================================================
   OTIMIZAÇÃO RESPONSIVA PARA DISPOSITIVOS MÓVEIS (MOBILE FIRST / FOCUS)
   ========================================================================== */

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 0;
    align-items: flex-start; /* Alinha no topo caso o conteúdo cresça */
  }

  .form-wrapper {
    width: 92%;
    margin: 0 auto;
    min-height: auto;
  }

  /* Oculta badges de teclado físico e hints de atalho */
  .key-badge, 
  .keyboard-hint {
    display: none !important;
  }

  /* Redução do logotipo no mobile para economizar altura vertical */
  .logo-container {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
  }

  .brand-title {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
  }

  .brand-subtitle {
    font-size: 0.75rem;
    letter-spacing: 4px;
    margin-bottom: 1.5rem;
  }

  .step-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 2rem;
  }

  /* Rótulo da pergunta */
  .step-label {
    font-size: 1.35rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
  }

  .field-hint {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
  }

  /* Inputs mais compactos no mobile */
  .input-wrapper {
    margin-bottom: 1.8rem;
  }

  .input-wrapper input,
  .input-wrapper textarea {
    font-size: 1.25rem;
    padding: 0.6rem 0;
  }
  
  .currency-symbol {
    font-size: 1.25rem;
  }

  .option-btn {
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 6px;
  }

  .option-grid {
    margin-bottom: 1.8rem;
  }

  .nav-controls {
    gap: 1rem;
    flex-wrap: wrap; /* Caso precise quebrar em telas ultra estreitas */
  }

  .btn-next, .btn-submit {
    padding: 0.8rem 1.6rem;
    font-size: 0.9rem;
    justify-content: center;
    width: 100%; /* Botões ocupam largura total no celular para clique fácil */
  }

  .btn-prev {
    width: 100%;
    text-align: center;
    padding: 0.6rem;
    order: 2; /* Coloca o voltar abaixo do botão de avançar no mobile */
  }
  
  .btn-start {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
  }
}

/* Ajustes extras para celulares ultra pequenos (ex: iPhone SE) */
@media (max-height: 600px) {
  .logo-container {
    width: 80px;
    height: 80px;
  }
  .brand-title {
    font-size: 1.5rem;
  }
  .step-label {
    font-size: 1.2rem;
  }
}
