/* Funil de Pesquisa de Terapias - Frontend */

.pesquisa-page .quiz-card {
  margin-left: auto;
  margin-right: auto;
  max-width: 760px;
  padding: var(--spacing-xs);
}

.quiz-page-title {
  text-align: center;
  margin-bottom: var(--spacing-sm);
}

.quiz-question-counter {
  font-size: 1rem;
  color: var(--primary-brown);
  opacity: 0.9;
  margin: 0 0 var(--spacing-xs) 0;
  font-weight: 600;
  font-family: var(--font-primary);
  text-align: center;
  width: 100%;
  display: block;
}

/* Progress Bar */
.quiz-progress {
  max-width: 760px;
  margin: 0 auto var(--spacing-sm);
  height: 6px;
  background: var(--primary-beige);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.quiz-nav { align-items: flex-start; }
.quiz-nav > div:first-child { flex: 1; }

.quiz-card {
  background: var(--primary-gray);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-medium);
}

.quiz-question {
  font-family: var(--font-secondary);
  color: var(--primary-green);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.quiz-question-help {
  margin-top: calc(var(--spacing-xs) * -0.35);
  margin-bottom: var(--spacing-sm);
  color: var(--primary-black);
  opacity: 0.8;
  font-size: 0.95rem;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.quiz-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius);
  background: var(--primary-white);
  box-shadow: var(--shadow-light);
  transition: var(--transition-fast);
  border: 2px solid transparent;
}

.quiz-option:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.quiz-option.is-selected {
  border-color: var(--primary-brown);
  background: rgba(185, 123, 84, 0.06);
}

.quiz-option input[type="radio"] {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--primary-brown);
}

.quiz-option-text {
  font-size: 1rem;
  color: var(--primary-black);
  opacity: 0.92;
  line-height: 1.6;
}

.quiz-option-help {
  margin-left: 34px;
  margin-top: -0.15rem;
  color: var(--primary-brown);
  font-size: 0.88rem;
  line-height: 1.45;
  opacity: 0.9;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.quiz-nav .btn-primary,
.quiz-nav .btn-outline {
  min-width: 160px;
  justify-content: center;
}

.quiz-nav-right {
  display: flex;
  gap: var(--spacing-sm);
  margin-left: auto;
}

.quiz-loading {
  display: none;
  margin-top: var(--spacing-sm);
  text-align: center;
  color: var(--primary-brown);
  font-weight: 600;
}

.quiz-loading.is-loading { display: block; }

.quiz-results-wrap { margin-top: var(--spacing-md); }
.is-hidden { display: none !important; }

/* Results */
.quiz-results-header {
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.quiz-results-title {
  color: var(--primary-green);
  font-family: var(--font-secondary);
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  margin: 0 0 var(--spacing-sm) 0;
}

.quiz-results-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--primary-black);
  margin: 0 auto var(--spacing-sm);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: rgba(185, 123, 84, 0.08);
  border: 1px solid rgba(185, 123, 84, 0.18);
  box-shadow: var(--shadow-light);
}

.quiz-results-subtitle span {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-results-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.quiz-results-actions .quiz-refazer-btn,
.quiz-results-actions .quiz-wa-btn,
.quiz-results-actions .quiz-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  border: none;
}

.quiz-refazer-btn {
  background: transparent;
  border: 2px solid var(--primary-brown) !important;
  color: var(--primary-brown);
}

.quiz-wa-btn {
  background: #25D366 !important;
  color: #fff !important;
}

.quiz-wa-btn:hover { filter: brightness(1.1); }

.quiz-pdf-btn {
  background: var(--gradient-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-light);
}

.quiz-pdf-btn:hover { filter: brightness(1.1); }

/* Therapy Result Cards */
.therapy-section {
  margin-bottom: var(--spacing-md);
}

.therapy-card {
  background: var(--primary-white);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.therapy-image {
  position: relative;
  width: 280px;
  min-height: 250px;
  height: auto;
  align-self: stretch;
  flex-shrink: 0;
}

.therapy-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.therapy-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gradient-primary);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.therapy-content {
  padding: 1.5rem;
  flex: 1;
}

.therapy-content h3 {
  font-family: var(--font-secondary);
  font-size: 1.4rem;
  color: var(--primary-green);
  margin-bottom: 0.5rem;
}

.therapy-description {
  color: var(--primary-black);
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.therapy-benefits {
  margin-bottom: 1.2rem;
}

.therapy-benefits h4 {
  font-size: 0.88rem;
  color: var(--primary-brown);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.therapy-benefits ul {
  list-style: none;
  padding: 0;
}

.therapy-benefits li {
  padding: 0.3rem 0;
  font-size: 0.88rem;
  color: var(--primary-black);
  opacity: 0.8;
  padding-left: 1.2rem;
  position: relative;
}

.therapy-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary-green);
  font-weight: 700;
}

.therapy-content .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--gradient-primary);
  color: #fff;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.therapy-content .btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 320px) {
  .pesquisa-page .quiz-card { max-width: 100%; }
  .quiz-question { font-size: 1.2rem; margin-bottom: var(--spacing-xs); }
  .quiz-nav { flex-direction: column; gap: var(--spacing-xs); align-items: stretch; }
  .quiz-nav > div:first-child { width: 100%; flex: unset; }
  .quiz-nav .btn-primary, .quiz-nav .btn-outline { width: 100%; min-width: 0; }
  .quiz-nav-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .quiz-results-actions { flex-direction: column; }
  .quiz-results-actions .quiz-refazer-btn,
  .quiz-results-actions .quiz-wa-btn,
  .quiz-results-actions .quiz-pdf-btn { width: 100%; justify-content: center; }
  .therapy-card { flex-direction: column; }
  .therapy-image { width: 100%; min-height: 180px; }
}

@media (min-width: 321px) and (max-width: 577px) {
  .pesquisa-page .quiz-card { max-width: 100%; }
  .quiz-question { font-size: 1.3rem; }
  .quiz-nav { flex-direction: column; gap: var(--spacing-xs); align-items: stretch; }
  .quiz-nav > div:first-child { width: 100%; flex: unset; }
  .quiz-nav .btn-primary, .quiz-nav .btn-outline { width: 100%; min-width: 0; }
  .quiz-nav-right { margin-left: 0; width: 100%; }
  .quiz-results-actions { flex-direction: column; }
  .quiz-results-actions .quiz-refazer-btn,
  .quiz-results-actions .quiz-wa-btn,
  .quiz-results-actions .quiz-pdf-btn { width: 100%; justify-content: center; }
  .therapy-card { flex-direction: column; }
  .therapy-image { width: 100%; min-height: 200px; }
}

@media (min-width: 578px) and (max-width: 767px) {
  .pesquisa-page .quiz-card { max-width: 100%; }
  .therapy-card { flex-direction: column; }
  .therapy-image { width: 100%; min-height: 220px; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .pesquisa-page .quiz-card { max-width: 680px; }
  .quiz-question { font-size: 1.5rem; }
  .therapy-card { align-items: stretch; }
  .therapy-image {
    width: 240px;
    min-height: 100%;
    align-self: stretch;
  }
  .therapy-image img {
    height: 100%;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .pesquisa-page .quiz-card { max-width: 820px; }
  .quiz-question { font-size: 1.55rem; }
  .therapy-card { align-items: stretch; }
  .therapy-image {
    min-height: 100%;
    align-self: stretch;
  }
  .therapy-image img {
    height: 100%;
  }
}

@media (min-width: 1200px) {
  .pesquisa-page .quiz-card { max-width: 900px; }
  .quiz-question { font-size: 1.65rem; }
  .therapy-card { align-items: stretch; }
  .therapy-image {
    min-height: 100%;
    align-self: stretch;
  }
  .therapy-image img {
    height: 100%;
  }
}
