/* ============================================
   ESTILO ATUALIZADO PARA FORMULÁRIO DE BRIEFING
   - Cores do tema filho aplicadas
   - Fonts locais (Poppins e Playfair Display SC)
   - Contraste adequado entre texto e fundo
   - Design responsivo e acessível
   ============================================ */

/* ===== VARIÁVEIS DO TEMA ===== */
:root {
  --theme-palette-color-1: #863F15; /* Cor primária da marca */
  --theme-palette-color-2: #AF5722; /* Cor alternativa, foco */
  --theme-palette-color-3: #312317; /* Texto principal */
  --theme-palette-color-4: #995e25; /* Títulos, subtítulos */
  --theme-palette-color-5: #ffc107; /* Bordas/divisores */
  --theme-palette-color-6: #F9F5EA; /* Fundos sutis */
  --theme-palette-color-7: #ffffff; /* Fundo principal */
  --theme-palette-color-8: #f3f3f3; /* Fundo alternativo leve */
  
  /* Fonts do tema */
  --fonte-principal: 'Poppins', sans-serif;
  --fonte-titulo: 'Playfair Display SC', serif;
  
  /* Variáveis de compatibilidade */
  --primary-color: var(--theme-palette-color-1);
  --primary-hover: var(--theme-palette-color-2);
  --discount-color: var(--theme-palette-color-5);
  --text-dark: var(--theme-palette-color-3);
  --text-medium: var(--theme-palette-color-4);
  --text-light: #6b7280;
  --bg-light: var(--theme-palette-color-6);
  --bg-card: var(--theme-palette-color-7);
  --border-radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* ===== ESTILOS BÁSICOS DO FORMULÁRIO ===== */
.cafe-form-briefing {
  font-family: var(--fonte-principal);
  line-height: 1.6;
}

.cafe-form-briefing .form-group {
  margin-bottom: 1.5rem;
}

.cafe-form-briefing .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--theme-palette-color-3);
  font-weight: 600;
  font-family: var(--fonte-principal);
  font-size: 1rem;
  transition: var(--transition);
}

/* ===== ESTILOS DOS CAMPOS DE FORMULÁRIO ===== */
.cafe-input, .cafe-select, .cafe-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  height: 3.25rem;
  line-height: 1.5rem;
  display: block;
  appearance: none;
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
}

.cafe-input:focus, .cafe-select:focus, .cafe-textarea:focus {
  border-color: var(--theme-palette-color-1);
  outline: none;
  box-shadow: 0 0 0 4px rgba(134, 63, 21, 0.1), var(--shadow-md);
  background: var(--theme-palette-color-7);
  transform: translateY(-2px);
}

.cafe-input::placeholder, .cafe-textarea::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.cafe-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 50px;
    /* ADICIONE ESTAS PROPRIEDADES PARA CONTROLAR O TEXTO */
    text-align: left; /* ou center, right */
    color: var(--theme-palette-color-3); /* cor do texto */
    font-family: var(--fonte-principal); /* fonte */
    font-size: 16px; /* tamanho da fonte */
    font-weight: 500; /* peso da fonte */
}

.cafe-select option {
  color: var(--theme-palette-color-3);
  background: var(--theme-palette-color-7);
  font-size: 16px;
  font-family: var(--fonte-principal);
  padding: 12px;
}

.cafe-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* ===== ESTILOS PARA STEPS MULTI-STEP ===== */
.cafe-form-step {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.cafe-form-step[data-step="1"] {
  display: block;
}

.cafe-form-step h3 {
  color: var(--theme-palette-color-1);
  font-family: var(--fonte-titulo);
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-align: center;
  border-bottom: 2px solid var(--theme-palette-color-1);
  padding-bottom: 1rem;
  font-weight: 700;
}

/* Botões de navegação entre steps */
.btn-next, .btn-prev {
  background: var(--theme-palette-color-1);
  color: var(--theme-palette-color-7);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 10px;
  font-family: var(--fonte-principal);
}

.btn-next:hover, .btn-prev:hover {
  background: var(--theme-palette-color-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(134, 63, 21, 0.3);
}

.btn-submit {
  background: var(--theme-palette-color-1);
  color: var(--theme-palette-color-7);
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin: 20px 10px;
  font-family: var(--fonte-principal);
  width: auto;
  min-width: 200px;
}

.btn-submit:hover {
  background: var(--theme-palette-color-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(134, 63, 21, 0.4);
}

.btn-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Animação para transição entre steps */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== TEMA ESCURO PARA FUNDOS COM IMAGEM ===== */
.cafe-shorts-formulario.dark-theme {
  background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 100%);
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow-lg);
  margin: 2rem auto;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.cafe-shorts-formulario.dark-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(134, 63, 21, 0.1), rgba(255, 255, 255, 0.05));
  pointer-events: none;
  z-index: -1;
}

.cafe-shorts-formulario.dark-theme:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.cafe-shorts-formulario.dark-theme h3 {
  color: var(--theme-palette-color-7);
  border-bottom-color: var(--theme-palette-color-1);
  font-family: var(--fonte-titulo);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

.cafe-shorts-formulario.dark-theme h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--theme-palette-color-1), var(--theme-palette-color-2));
  border-radius: 2px;
}

.cafe-shorts-formulario.dark-theme label {
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  font-weight: 600;
  transition: var(--transition);
}

.cafe-shorts-formulario.dark-theme .cafe-input,
.cafe-shorts-formulario.dark-theme .cafe-select,
.cafe-shorts-formulario.dark-theme .cafe-textarea {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  color: var(--theme-palette-color-7);
  font-weight: 500;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cafe-shorts-formulario.dark-theme .cafe-input:focus,
.cafe-shorts-formulario.dark-theme .cafe-select:focus,
.cafe-shorts-formulario.dark-theme .cafe-textarea:focus {
  background: rgba(255,255,255,0.15);
  border-color: var(--theme-palette-color-1);
  box-shadow: 0 0 0 4px rgba(134, 63, 21, 0.2), 0 8px 25px rgba(0,0,0,0.15);
  transform: translateY(-2px);
  outline: none;
}

.cafe-shorts-formulario.dark-theme .cafe-input::placeholder,
.cafe-shorts-formulario.dark-theme .cafe-textarea::placeholder {
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}


.cafe-shorts-formulario.dark-theme .cafe-select option {
  color: var(--theme-palette-color-7);
  background: rgba(0,0,0,0.9);
}

/* ===== SEÇÃO DE FUNCIONALIDADES ===== */
.cafe-shorts-formulario .funcionalidades-section {
  background: var(--theme-palette-color-6);
  border: 1px solid var(--theme-palette-color-8);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  transition: var(--transition);
}

.cafe-shorts-formulario.dark-theme .funcionalidades-section {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.cafe-shorts-formulario .funcionalidades-section:hover {
  background: var(--theme-palette-color-8);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cafe-shorts-formulario.dark-theme .funcionalidades-section:hover {
  background: rgba(255,255,255,0.08);
}

.cafe-shorts-formulario .funcionalidades-section h4 {
  color: var(--theme-palette-color-4);
  margin-bottom: 1rem;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  font-family: var(--fonte-titulo);
  text-align: center;
}

.cafe-shorts-formulario.dark-theme .funcionalidades-section h4 {
  color: var(--theme-palette-color-7);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ===== CHECKBOX GROUP ===== */
.cafe-shorts-formulario .checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.cafe-shorts-formulario .checkbox-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: var(--theme-palette-color-6);
  border: 1px solid var(--theme-palette-color-8);
  border-radius: 8px;
  transition: var(--transition);
  cursor: pointer;
  font-family: var(--fonte-principal);
}

.cafe-shorts-formulario.dark-theme .checkbox-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(5px);
}

.cafe-shorts-formulario .checkbox-item:hover {
  background: rgba(134, 63, 21, 0.1);
  border-color: var(--theme-palette-color-1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cafe-shorts-formulario.dark-theme .checkbox-item:hover {
  background: rgba(134, 63, 21, 0.2);
  border-color: var(--theme-palette-color-1);
}

.cafe-shorts-formulario .checkbox-item input[type="checkbox"] {
  width: auto;
  margin-right: 0.75rem;
  transform: scale(1.2);
  accent-color: var(--theme-palette-color-1);
}

.cafe-shorts-formulario .checkbox-item label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  color: var(--theme-palette-color-3);
  flex: 1;
  font-family: var(--fonte-principal);
  transition: var(--transition);
}

.cafe-shorts-formulario.dark-theme .checkbox-item label {
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.cafe-shorts-formulario .checkbox-item input[type="checkbox"]:checked + label {
  color: var(--theme-palette-color-1);
  font-weight: 600;
}

.cafe-shorts-formulario.dark-theme .checkbox-item input[type="checkbox"]:checked + label {
  color: var(--theme-palette-color-1);
}

/* ===== BOTÕES NO TEMA ESCURO ===== */
.cafe-shorts-formulario.dark-theme button {
  background: linear-gradient(135deg, var(--theme-palette-color-1), var(--theme-palette-color-2));
  color: var(--theme-palette-color-7);
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  font-family: var(--fonte-principal);
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(134, 63, 21, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.cafe-shorts-formulario.dark-theme button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.cafe-shorts-formulario.dark-theme button:hover::before {
  left: 100%;
}

.cafe-shorts-formulario.dark-theme button:hover {
  background: linear-gradient(135deg, var(--theme-palette-color-2), var(--theme-palette-color-1));
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(134, 63, 21, 0.4);
}

.cafe-shorts-formulario.dark-theme button:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(134, 63, 21, 0.3);
}

.cafe-shorts-formulario.dark-theme button:disabled {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.cafe-shorts-formulario.dark-theme button:disabled::before {
  display: none;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .cafe-shorts-formulario .checkbox-group {
    grid-template-columns: 1fr;
  }
  
  .cafe-shorts-formulario .radio-group {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .cafe-shorts-formulario .checkbox-item,
  .cafe-shorts-formulario .radio-item {
    padding: 0.75rem;
  }
  
  .cafe-shorts-formulario.dark-theme {
    padding: 2rem 1.5rem;
    margin: 1rem;
    border-radius: 15px;
  }
  
  .cafe-form-step h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .cafe-shorts-formulario.dark-theme {
    padding: 1.5rem 1rem;
    margin: 0.5rem;
    border-radius: 12px;
  }
  
  .cafe-shorts-formulario .radio-item {
    min-width: auto;
    width: 100%;
  }
  
  .btn-next, .btn-prev, .btn-submit {
    width: 100%;
    margin: 5px 0;
  }
  
  .cafe-input, .cafe-select, .cafe-textarea {
    padding: 14px 16px;
    font-size: 16px; /* Previne zoom no iOS */
  }
}

/* ===== DETECÇÃO AUTOMÁTICA DE FUNDO COM IMAGEM ===== */
@media (min-width: 768px) {
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme),
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme),
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) {
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: var(--shadow-lg);
    margin: 2rem auto;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }
  
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme)::before,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme)::before,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(134, 63, 21, 0.1), rgba(255, 255, 255, 0.05));
    pointer-events: none;
    z-index: -1;
  }
  
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme):hover,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme):hover,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme):hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  }
  
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) h3,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) h3,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) h3 {
    color: var(--theme-palette-color-7);
    border-bottom-color: var(--theme-palette-color-1);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
  }
  
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) h3::after,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) h3::after,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--theme-palette-color-1), var(--theme-palette-color-2));
    border-radius: 2px;
  }
  
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) label,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) label,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) label {
    color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  }
  
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-input,
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-select,
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-textarea,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-input,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-select,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-textarea,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) .cafe-input,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) .cafe-select,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) .cafe-textarea {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: var(--theme-palette-color-7);
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  }
  
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-input:focus,
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-select:focus,
  body[style*="background-image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-textarea:focus,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-input:focus,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-select:focus,
  .elementor-section[data-settings*="background_image"] .cafe-shorts-formulario:not(.dark-theme) .cafe-textarea:focus,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) .cafe-input:focus,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) .cafe-select:focus,
  .wp-block-cover .cafe-shorts-formulario:not(.dark-theme) .cafe-textarea:focus {
    background: rgba(255,255,255,0.15);
    border-color: var(--theme-palette-color-1);
    box-shadow: 0 0 0 4px rgba(134, 63, 21, 0.2), 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    outline: none;
  }
}

/* ===== MELHORIAS DE ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
  .cafe-shorts-formulario * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Foco visível para acessibilidade */
.cafe-input:focus-visible,
.cafe-select:focus-visible,
.cafe-textarea:focus-visible,
.btn-next:focus-visible,
.btn-prev:focus-visible,
.btn-submit:focus-visible {
  outline: 2px solid var(--theme-palette-color-1);
  outline-offset: 2px;
}

/* Alto contraste para usuários que preferem */
@media (prefers-contrast: high) {
  .cafe-shorts-formulario .cafe-input,
  .cafe-shorts-formulario .cafe-select,
  .cafe-shorts-formulario .cafe-textarea {
    border-width: 3px;
  }
  
  .cafe-shorts-formulario.dark-theme {
    border: 3px solid var(--theme-palette-color-1);
  }
}