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

:root {
  --primary-color: #00E169;
  --primary-hover: #00c85d;
  --primary-color-rgb: 0, 225, 105;
  --text-dark: #333333;
  --text-grey: #666666;
  --bg-color: #f2f4f8;
  --border-color: #dcdcdc;
  --selected-bg: #e8e8e8;
}

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

/* ===================================
   LAYOUT STANDALONE (SEM HEADER/FOOTER)
   =================================== */
body {
  font-family: 'Work Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
}

.quiz-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 20px;
}

/* Desktop/Tablet - Centralização apenas em telas maiores */
@media (min-width: 481px) {
  .quiz-wrapper {
    align-items: center;
  }
}

.quiz-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  max-width: 750px;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0 auto;
}

/* ===================================
   HEADER/LOGO
   =================================== */
.quiz-header {
  padding: 30px 20px 15px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: none;
}

.quiz-logo {
  max-height: var(--logo-size, 60px);
  max-width: 200px;
  height: auto;
  width: auto;
  object-fit: contain;
}

/* ===================================
   PROGRESS BAR
   =================================== */
.progress-container {
  height: 6px;
  background: #e0e0e0;
  width: 90%;
  max-width: 650px;
  margin: 15px auto 30px;
  border-radius: 10px;
  overflow: hidden;
}

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

/* ===================================
   QUIZ CONTENT
   =================================== */
.quiz-content {
  padding: 0 24px 25px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.step {
  display: none;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

.step.active {
  display: flex;
  flex-direction: column;
}

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

/* ===================================
   QUESTION STYLING
   =================================== */
.question {
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
  text-align: left;
  line-height: 1.4;
  margin-bottom: 30px;
  padding-left: 18px;
  border-left: 5px solid var(--primary-color);
}

.step[data-step="1"] .question {
  padding-left: 18px;
  border-left: 5px solid var(--primary-color);
}

/* ===================================
   OPTIONS
   =================================== */
.options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.options-grid,
.options-binary {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.option-btn {
  padding: 18px 22px;
  border: 2px solid #c5c5c5;
  border-radius: 10px;
  background: #ffffff;
  font-size: 1.05rem;
  font-weight: 500;
  color: #222;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.option-btn:hover {
  background-color: #f9f9f9;
  border-color: #999;
  transform: translateY(-1px);
}

.option-btn::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid #aaa;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: all 0.2s;
  background: #fff;
}

.option-btn.selected {
  background-color: var(--selected-bg);
  border-color: #d0d0d0;
  color: #000;
  font-weight: 500;
}

.option-btn.selected::before {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='14px' height='14px'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ===================================
   FORM STYLES
   =================================== */
.quiz-form-container {
  display: block;
  width: 100%;
  /* Evita que o Ad Inserter considere elementos internos como parágrafos separados */
  isolation: isolate;
}

.form-header {
  text-align: center;
  margin-bottom: 30px;
}

.form-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 10px;
  line-height: 1.3;
}

.form-subtitle {
  color: #555;
  font-size: 1rem;
  margin-top: 6px;
  line-height: 1.5;
}

.form-header .question {
  border-left: none;
  text-align: center;
  padding-left: 0;
  display: block !important;
  margin-bottom: 10px;
}

.lead-form {
  margin-top: 15px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
  color: #222;
  font-size: 1rem;
}

.form-group input {
  width: 100%;
  padding: 18px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.05rem;
  font-family: inherit;
  background-color: #fff;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.submit-btn {
  background-color: var(--primary-color);
  color: var(--submit-btn-color, #000);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 20px;
  border-radius: 30px;
  border: none;
  width: 100%;
  cursor: pointer;
  margin-top: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.25);
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.submit-btn:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.3);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-loading {
  display: none;
  align-items: center;
  gap: 10px;
}

.privacy-text {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 12px;
  padding: 0;
}

/* ===================================
   SUCCESS PAGE
   =================================== */
.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
}

.success-icon-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--primary-color);
  color: var(--primary-color);
  font-size: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.success-title {
  color: var(--primary-color);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.success-message {
  font-size: 1.1rem;
  color: var(--text-grey);
  margin-bottom: 20px;
}

.redirect-box {
  background-color: #f8f9fa;
  border: 2px solid #e9ecef;
  padding: 30px;
  border-radius: 15px;
  width: 100%;
  max-width: 400px;
  margin-top: 25px;
}

.redirect-text {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.countdown-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary-color);
}

.redirect-sub {
  font-size: 1rem;
  color: var(--text-grey);
  margin-top: 5px;
}

/* ===================================
   CHECKMARK ANIMATION
   =================================== */
.success-animation {
  margin-bottom: 25px;
}

.checkmark {
  width: 90px;
  height: 90px;
  display: block;
  margin: 0 auto;
}

.checkmark-circle {
  stroke: var(--primary-color);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  stroke: var(--primary-color);
  stroke-width: 3;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

/* ===================================
   NAVIGATION
   =================================== */
.navigation {
  padding: 15px 24px 30px;
  display: flex;
  justify-content: center;
}

.back-btn {
  background: transparent;
  border: none;
  color: #999;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.back-btn:hover {
  color: #555;
}

.back-btn span {
  font-size: 1.2rem;
}

/* ===================================
   PAGE CONTENT (WordPress Pages)
   =================================== */
.page-content-wrapper {
  margin-bottom: 35px;
  animation: fadeIn 0.4s ease;
}

.page-content-loading {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-grey);
}

.page-content-loading .spinner {
  width: 45px;
  height: 45px;
  margin: 0 auto 18px;
  animation: rotate 2s linear infinite;
}

.page-content-loading .spinner circle {
  stroke: var(--primary-color);
  stroke-linecap: round;
  stroke-dasharray: 1, 200;
  stroke-dashoffset: 0;
  animation: dash 1.5s ease-in-out infinite;
  stroke-width: 3;
  fill: none;
}

.page-content {
  background: transparent;
  padding: 0;
  border: none;
  line-height: 1.6;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6,
.page-content p,
.page-content ul,
.page-content ol,
.page-content li,
.page-content a,
.page-content img,
.page-content table,
.page-content div {
  all: revert;
}

.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.page-content-error {
  text-align: center;
  padding: 35px 20px;
  color: #ff6b6b;
  background: #fff5f5;
  border-radius: 10px;
  border: 2px solid #ffcccc;
}

.question-wrapper {
  animation: fadeIn 0.4s ease;
}

.options-wrapper {
  animation: fadeIn 0.4s ease;
  margin-top: 20px;
}

/* ===================================
   COM TEMA WORDPRESS (Header/Footer)
   =================================== */
.quiz-wrapper-with-theme {
  min-height: calc(100vh - 200px);
  padding: 24px 16px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.quiz-wrapper-with-theme .quiz-container {
  margin: 0 auto;
}

/* Desktop/Tablet - Centralização apenas em telas maiores */
@media (min-width: 481px) {
  .quiz-wrapper-with-theme {
    align-items: center;
  }
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}

/* ===================================
   RESPONSIVE - TABLET
   =================================== */
@media (max-width: 768px) {
  .quiz-wrapper {
    padding: 16px;
  }
  
  .quiz-wrapper-with-theme {
    padding: 16px;
  }
  
  .quiz-container {
    max-width: 650px;
    border-radius: 10px;
  }
  
  .quiz-content {
    padding: 0 20px 20px;
  }
  
  .navigation {
    padding: 12px 20px 25px;
  }
  
  .question {
    font-size: 1.4rem;
  }
}

/* ===================================
   RESPONSIVE - MOBILE
   =================================== */
@media (max-width: 480px) {
  .quiz-wrapper,
  .quiz-wrapper-with-theme {
    padding: 0 !important;
    min-height: auto !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
  
  .quiz-container {
    max-width: 100% !important;
    width: 100% !important;
    min-height: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }
  
  .quiz-header {
    padding: 20px 16px 10px !important;
    flex-shrink: 0;
  }
  
  .progress-container {
    width: 90%;
    margin: 10px auto 20px !important;
    flex-shrink: 0;
  }
  
  .quiz-content {
    padding: 20px 16px 20px !important;
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
  }
  
  .question-wrapper {
    width: 100%;
  }
  
  .options-wrapper {
    width: 100%;
    margin-top: 15px;
  }
  
  .navigation {
    padding: 10px 16px 20px;
    flex-shrink: 0;
  }
  
  .question {
    font-size: 1.25rem;
    padding-left: 12px;
    margin-bottom: 20px;
    line-height: 1.3;
  }
  
  .options {
    gap: 12px;
  }
  
  .option-btn {
    padding: 14px 16px;
    font-size: 0.95rem;
    gap: 12px;
  }
  
  .option-btn::before {
    width: 20px;
    height: 20px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-group label {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .form-group input {
    padding: 14px;
    font-size: 0.95rem;
  }
  
  .submit-btn {
    padding: 16px;
    font-size: 1.05rem;
  }
  
  .success-title {
    font-size: 1.6rem;
  }
  
  .success-message {
    font-size: 1rem;
  }
  
  .countdown-number {
    font-size: 2.5rem;
  }
  
  .quiz-logo {
    max-height: var(--logo-size-mobile, 45px);
    max-width: 160px;
  }
  
  .redirect-box {
    padding: 20px;
    max-width: 90%;
    background-color: #f8f9fa !important;
    border: 2px solid #e9ecef !important;
    border-radius: 15px !important;
    display: block !important;
    visibility: visible !important;
  }
  
  .redirect-text,
  .countdown-number,
  .redirect-sub {
    display: block !important;
    visibility: visible !important;
  }
  
  .success-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px 20px !important;
  }
  
  .form-header .question,
  .form-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 800;
  }
  
  .form-header .subtitle,
  .form-subtitle {
    font-size: 0.9rem;
  }
  
  .step {
    width: 100% !important;
  }
  
  .step:not(.active) {
    display: none !important;
  }
  
  .step.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    height: auto !important;
    min-height: auto !important;
  }
  
  /* Garantir que success-step apareça quando ativo */
  .success-step.active {
    display: flex !important;
  }
}
