/* ==========================================================================
   Coco Bambu — Funil App (shell + quiz unificado) — refinado v12
   ========================================================================== */

html.coco-html,
body.coco-app {
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  -webkit-tap-highlight-color: transparent;
  background-color: var(--dark-brown);
  background-image:
    radial-gradient(ellipse 72% 46% at 50% -8%, rgba(232, 201, 106, 0.15), transparent 70%),
    radial-gradient(ellipse 60% 40% at 110% 6%, rgba(201, 162, 39, 0.07), transparent 60%),
    linear-gradient(178deg, #221813 0%, #1f1612 42%, #18110d 100%);
  background-attachment: fixed;
}

/* Troca de etapa instantânea (sem fade/slide) */
.funnel-app__body,
.funnel-app__chrome,
.funnel-header {
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.funnel-app__body.is-swapping,
.funnel-app__body.is-ready,
body.funnel-enter .funnel-app__body,
body.funnel-enter .funnel-header,
body.funnel-enter-active .funnel-app__body,
body.funnel-enter-active .funnel-header,
body.funnel-visible .funnel-app__body,
body.funnel-visible .funnel-header {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto;
}

.funnel-app {
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
}

/* ---------- Barra de progresso ---------- */
.funnel-app__progress {
  position: relative;
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.funnel-app__progress-fill {
  position: relative;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(232, 201, 106, 0.5);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Stepper ---------- */
.funnel-app__steps {
  display: flex;
  justify-content: space-between;
  gap: 0.15rem;
  padding: 0.8rem 0.85rem 0.55rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.funnel-app__steps::-webkit-scrollbar {
  display: none;
}

.funnel-app__step {
  flex: 1;
  min-width: 3.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.72;
  transition: opacity 0.25s ease;
}

.funnel-app__step.is-active,
.funnel-app__step.is-done {
  opacity: 1;
}

.funnel-app__step-dot {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  color: rgba(245, 239, 230, 0.88);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.funnel-app__step-dot .coco-icon,
.funnel-app__step-dot svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.funnel-app__step.is-active .funnel-app__step-dot {
  background: rgba(201, 162, 39, 0.22);
  border-color: var(--gold);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.16);
}

.funnel-app__step.is-done .funnel-app__step-dot {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: var(--gold-light);
  color: #1f1612;
}

.funnel-app__step-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(245, 239, 230, 0.78);
  text-align: center;
  line-height: 1.1;
  transition: color 0.25s ease;
}

.funnel-app__step.is-active .funnel-app__step-label {
  color: var(--gold-light);
}

/* ---------- Corpo ---------- */
.funnel-app__body {
  flex: 1;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 0.85rem 1rem 1.25rem;
}

@media (max-width: 767px) {
  .funnel-app__body {
    padding: 0.65rem 0.85rem 1rem;
  }

  .funnel-app__steps {
    padding: 0.5rem 0.55rem 0.35rem;
  }

  .funnel-app__step {
    min-width: 2.55rem;
  }

  .funnel-app__step-dot {
    width: 1.75rem;
    height: 1.75rem;
  }

  .funnel-app__step-dot .coco-icon,
  .funnel-app__step-dot svg {
    width: 0.82rem;
    height: 0.82rem;
  }

  .funnel-app__step-label {
    font-size: 0.48rem;
  }

  .app-card {
    border-radius: 1.15rem;
  }

  .app-card__head {
    padding: 1rem 1rem 0.65rem;
  }

  .app-card__head h1 {
    font-size: 1.25rem;
  }

  .app-card__body {
    padding: 0 1rem 1rem;
  }

  .quiz-app__q-title {
    font-size: 1.15rem;
  }

  .quiz-app__option {
    padding: 0.8rem 0.85rem;
    gap: 0.65rem;
  }

  .quiz-app__option-icon {
    width: 2rem;
    height: 2rem;
  }

  .btn-app-primary {
    min-height: 48px;
    font-size: 0.95rem;
  }
}

@media (min-width: 768px) {
  .funnel-app__body {
    max-width: 32rem;
    padding: 1.15rem 1.25rem 2rem;
  }
}

.funnel-app__footer {
  flex-shrink: 0;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.funnel-app__footer p {
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  color: rgba(245, 239, 230, 0.4);
  margin: 0;
}

/* ---------- Card app ---------- */
.app-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fdfaf4 100%);
  border-radius: 1.4rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 20px 50px rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(201, 162, 39, 0.18);
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.4rem;
  right: 1.4rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 999px;
}

.app-card__head {
  padding: 1.3rem 1.3rem 0.85rem;
  text-align: center;
}

.app-card__head h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.app-card__head p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.app-card__body {
  padding: 0 1.3rem 1.3rem;
}

/* ---------- Quiz app ---------- */
.quiz-app {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-app__meter {
  padding: 0 0.25rem;
}

.quiz-app__meter-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(245, 239, 230, 0.82);
}

.quiz-app__meter-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-app__meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(232, 201, 106, 0.45);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-app__question {
  display: none;
}

.quiz-app__question.is-visible {
  display: block;
  animation: quizAppIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes quizAppIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.quiz-app__q-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 1rem;
  line-height: 1.28;
}

.quiz-app__options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.quiz-app__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1.5px solid #e8e2d8;
  background: #faf8f5;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease,
              transform 0.15s ease, box-shadow 0.18s ease;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.quiz-app__option:active {
  transform: scale(0.99);
}

.quiz-app__option.is-selected {
  border-color: var(--gold);
  background: #fff9e8;
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.22);
}

.quiz-app__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quiz-app__option-icon {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 0.7rem;
  background: rgba(201, 162, 39, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dark);
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease;
}

.quiz-app__option.is-selected .quiz-app__option-icon {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #fff;
}

.quiz-app__option-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

/* marcador de seleção */
.quiz-app__option::after {
  content: "";
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  border: 2px solid #d8d0c4;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.quiz-app__option.is-selected::after {
  border-color: var(--gold);
  background: var(--gold)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 0.7rem no-repeat;
}

.quiz-app__actions {
  padding-top: 0.35rem;
}

/* ---------- Botão primário ---------- */
.btn-app-primary {
  position: relative;
  width: 100%;
  min-height: 54px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  color: #2a1c0c;
  background: linear-gradient(135deg, #f0d785 0%, #d4af3e 48%, #c9a227 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 10px 26px rgba(201, 162, 39, 0.45);
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-app-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  animation: appBtnShine 5s ease-in-out infinite;
}

@keyframes appBtnShine {
  0%, 64%, 100% { left: -120%; }
  80% { left: 135%; }
}

.btn-app-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-app-primary:disabled::after {
  display: none;
}

.btn-app-primary:not(:disabled):active {
  transform: scale(0.98);
}

.quiz-app__q-sub {
  font-size: 0.8rem;
  color: var(--text-muted, #6b5d54);
  margin: -0.5rem 0 0.85rem;
  line-height: 1.4;
}

.quiz-app__bone-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.quiz-app__bone-grid .quiz-app__bone-pick {
  padding: 0.5rem 0.4rem 0.55rem;
}

.quiz-app__bone-grid .bone-showcase__photo {
  margin-bottom: 0.35rem;
  padding: 0.35rem;
}

.quiz-app__bone-grid .bone-showcase__name {
  font-size: 0.68rem;
}

.quiz-app__hint {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(245, 239, 230, 0.55);
  margin: 0.5rem 0 0;
}

/* ---------- Oferta compacta no quiz ---------- */
.offer-strip {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: 1.1rem;
  padding: 0.95rem 1rem;
  text-align: center;
}

.offer-strip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.1rem;
  right: 1.1rem;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.offer-strip__price {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
}

.offer-strip__compare {
  font-size: 0.8rem;
  color: rgba(245, 239, 230, 0.5);
  text-decoration: line-through;
  margin-right: 0.35rem;
}

.offer-strip__tagline {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(245, 239, 230, 0.72);
  margin-top: 0.4rem;
}

.offer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.7rem;
}

.offer-chip {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.14);
  color: var(--gold-light);
  border: 1px solid rgba(201, 162, 39, 0.26);
}

/* ---------- Loading / sucesso ---------- */
.app-screen-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
}

.app-loading-card {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .btn-app-primary::after {
    animation: none;
  }
}
