/* ==========================================================================
   QUIZ COMPONENT STYLES - 100% RESPONSIVO & MOBILE FIRST
   ========================================================================== */

.quiz-card-wrapper {
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header & Progress Bar */
.quiz-top-bar {
  background: #FAFAF9;
  padding: 1.15rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.quiz-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 0.6rem;
}

.quiz-progress-track {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  width: 14%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* Quiz Body */
.quiz-body {
  padding: 2.25rem 1.75rem;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #FFFFFF;
}

.quiz-step {
  display: none;
  flex-direction: column;
  animation: stepFadeIn 0.25s ease-out forwards;
}

.quiz-step.active {
  display: flex;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step Header */
.step-header {
  margin-bottom: 1.4rem;
}

.step-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.step-title {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  font-weight: 700;
  color: var(--navy-950);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 0.35rem;
}

.step-subtitle {
  font-size: 0.92rem;
  color: var(--navy-600);
  line-height: 1.5;
  font-weight: 400;
}

/* ==========================================================================
   OPTION BUTTONS
   ========================================================================== */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.options-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.option-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--navy-900);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  box-shadow: var(--shadow-xs);
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  min-height: 48px;
}

.option-btn:hover {
  border-color: #CBD5E1;
  background: #FDFBFB;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.option-btn:active {
  transform: scale(0.99);
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-xs);
}

.option-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
  border-radius: 10px;
  transition: all 0.18s ease;
  border: 1px solid var(--border-color);
}

.option-btn:hover .option-icon {
  background: #FFFFFF;
}

.option-btn.selected .option-icon {
  background: #FFFFFF;
  border-color: rgba(194, 65, 76, 0.3);
}

.option-text-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.option-text-main {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.3;
  word-break: break-word;
}

.option-btn.selected .option-text-main {
  color: var(--primary-dark);
}

.option-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.15rem;
  line-height: 1.35;
  word-break: break-word;
}

.option-check {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
  background: #FFFFFF;
}

.option-btn.selected .option-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.option-btn.selected .option-check::after {
  content: '';
  display: block;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* ==========================================================================
   FORM INPUTS & MASKS (iOS SAFE 16px)
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-900);
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: #FFFFFF;
  color: var(--navy-900);
  font-size: 16px; /* Evita zoom automático no iOS Safari */
  font-family: inherit;
  font-weight: 400;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194, 65, 76, 0.12);
}

.form-input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.input-with-icon .form-input {
  padding-left: 2.85rem;
}

.input-hint {
  font-size: 0.8rem;
  color: var(--navy-600);
  line-height: 1.4;
  margin-top: 0.25rem;
  font-weight: 400;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* ==========================================================================
   SUB QUESTIONS & FILE UPLOADS
   ========================================================================== */
.sub-question-box {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1.1rem;
  display: none;
  animation: stepFadeIn 0.25s ease;
}

.sub-question-box.active {
  display: block;
}

.sub-question-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 0.75rem;
}

.file-upload-zone {
  border: 1.5px dashed #CBD5E1;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 1.35rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  position: relative;
}

.file-upload-zone:hover {
  border-color: var(--primary);
  background: #FFFDFD;
}

.upload-icon-svg {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.upload-main-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-900);
}

.upload-sub-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.hidden-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-preview-card {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 10px;
  margin-top: 0.75rem;
  gap: 0.5rem;
}

.file-preview-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #065F46;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-file-btn {
  background: none;
  border: none;
  color: #DC2626;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
}

.cnis-help-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.85rem;
  text-decoration: underline;
}

.cnis-help-link:hover {
  color: var(--primary-dark);
}

/* ==========================================================================
   NAVIGATION ACTION BAR
   ========================================================================== */
.quiz-actions {
  background: #FAFAF9;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-quiz-back {
  background: #FFFFFF;
  color: var(--navy-800);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
}

.btn-quiz-back:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.btn-quiz-back.hidden {
  visibility: hidden;
  pointer-events: none;
}

.btn-quiz-next {
  background: var(--primary-gradient);
  color: #FFFFFF;
  border: none;
  padding: 0.75rem 1.85rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  box-shadow: var(--shadow-primary);
  margin-left: auto;
}

.btn-quiz-next:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(194, 65, 76, 0.35);
}

.btn-quiz-next:active:not(:disabled) {
  transform: translateY(0);
}

.btn-quiz-next:disabled {
  background: #E2E8F0;
  color: #94A3B8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.85;
}

/* ==========================================================================
   RESULT SCREEN (TELA 9)
   ========================================================================== */
.result-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: stepFadeIn 0.3s ease-out;
}

.result-badge-card {
  padding: 1.85rem 1.25rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

/* Green: Lead Quente */
.result-badge-card.hot-lead {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
}

.result-badge-card.hot-lead .status-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--success);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

/* Yellow: Análise Necessária */
.result-badge-card.review-lead {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
}

.result-badge-card.review-lead .status-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--warning);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

/* Gray/Soft: Caso Especial */
.result-badge-card.special-lead {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
}

.result-badge-card.special-lead .status-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #64748B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.result-status-title {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  font-weight: 700;
  color: var(--navy-950);
  line-height: 1.3;
}

.result-status-desc {
  font-size: 0.94rem;
  color: var(--navy-700);
  max-width: 560px;
  line-height: 1.55;
  font-weight: 400;
}

.result-summary-box {
  background: #F8FAFC;
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border-color);
}

.summary-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy-700);
  margin-bottom: 0.75rem;
}

.summary-items-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
}

.summary-item .label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.summary-item .val {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy-950);
}

.result-whatsapp-btn {
  background: #25D366;
  color: #FFFFFF;
  padding: 1.05rem 1.35rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-size: 1.02rem;
  font-weight: 700;
  box-shadow: var(--shadow-whatsapp);
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
}

.result-whatsapp-btn:hover {
  background: #20BA5A;
  transform: translateY(-1px);
}

.result-whatsapp-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  flex-shrink: 0;
}

.result-guarantee-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--navy-600);
  text-align: center;
}

/* ==========================================================================
   BREAKPOINTS RESPONSIVOS ESPECÍFICOS DO QUIZZ
   ========================================================================== */
@media (max-width: 640px) {
  .quiz-card-wrapper {
    border-radius: 16px;
  }
  .quiz-top-bar {
    padding: 0.9rem 1.15rem;
  }
  .quiz-body {
    padding: 1.35rem 1.15rem;
    min-height: auto;
  }
  .options-grid.grid-2 {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .option-btn {
    padding: 0.85rem 0.95rem;
    gap: 0.75rem;
    border-radius: 12px;
  }
  .option-icon {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
  }
  .option-text-main {
    font-size: 0.92rem;
  }
  .option-hint {
    font-size: 0.76rem;
  }
  .quiz-actions {
    padding: 0.9rem 1.15rem;
    gap: 0.6rem;
  }
  .btn-quiz-back {
    padding: 0.7rem 1rem;
    font-size: 0.86rem;
  }
  .btn-quiz-next {
    padding: 0.7rem 1.25rem;
    font-size: 0.92rem;
  }
  .summary-items-list {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .result-status-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 380px) {
  .quiz-body {
    padding: 1.15rem 0.95rem;
  }
  .quiz-top-bar {
    padding: 0.8rem 0.95rem;
  }
  .quiz-actions {
    padding: 0.8rem 0.95rem;
  }
  .option-btn {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
  }
  .option-icon {
    width: 30px;
    height: 30px;
    font-size: 1.1rem;
  }
  .btn-quiz-back {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
  }
  .btn-quiz-next {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }
}
