/* =========================================================
   Quiz Funnel — Brigadeiros Gourmet de Lucro
   theme_id: chocolatier-luxe (boutique parisiense)
   by @josh-haynam — vanilla CSS, mobile-first, zero deps
   Escrito do ZERO a partir de artifacts/quiz-ux-spec.md
   ========================================================= */

/* =========== TOKENS =========== */
:root {
  /* Paleta chocolatier-luxe */
  --c-cacao: #3D2817;
  --c-cacao-deep: #2E1D11;
  --c-ink: #2A1810;
  --c-bronze: #8B6F47;
  --c-gold: #C9A961;
  --c-gold-soft: #D4B97A;
  --c-gold-deep: #A8884A;
  --c-cream: #F5EFE6;
  --c-cream-deep: #EFE7D9;
  --c-paper: #FFFFFF;
  --c-line: rgba(139, 111, 71, 0.18);
  --c-line-gold: rgba(201, 169, 97, 0.42);
  --c-success: #4A6B3E;
  --c-error: #8B3A2E;

  /* Tipografia */
  --f-serif: 'Cormorant Garamond', 'Georgia', serif;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Hierarquia tipográfica editorial (assinatura do tema) */
  --fs-hero: clamp(34px, 7vw, 56px);     /* Cormorant italic */
  --fs-h2:   clamp(28px, 5.5vw, 42px);   /* Cormorant */
  --fs-h3:   clamp(22px, 4.5vw, 30px);   /* Cormorant */
  --fs-q:    clamp(24px, 5vw, 34px);     /* Cormorant pergunta */
  --fs-body: clamp(16px, 3.6vw, 18px);   /* Inter */
  --fs-micro: clamp(13px, 2.8vw, 14px);  /* Inter */
  --fs-numeral: clamp(56px, 12vw, 88px); /* Cormorant timeline */

  /* Tracking editorial (apertado, signature boutique) */
  --tr-headings: -0.02em;
  --tr-cta: 0.12em;        /* CTA uppercase boutique */
  --tr-eyebrow: 0.18em;    /* small caps eyebrow */

  /* Espaçamento editorial (assinatura do tema — generoso) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;
  --sp-7: 80px;

  /* Radius (anguloso boutique — não chubby/playful) */
  --r-sm: 2px;
  --r-md: 4px;
  --r-card: 6px;

  /* Sombras (soft elevation, sem hard shadow) */
  --sh-rest: 0 1px 2px rgba(42, 24, 16, 0.04);
  --sh-card: 0 1px 2px rgba(42, 24, 16, 0.04), 0 12px 32px -16px rgba(61, 40, 23, 0.18);
  --sh-hover-gold: 0 0 0 1px var(--c-gold), 0 16px 40px -16px rgba(201, 169, 97, 0.45);
  --sh-cta: 0 1px 2px rgba(42, 24, 16, 0.08), 0 8px 24px -8px rgba(61, 40, 23, 0.30);

  /* Transições */
  --t-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 480ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========== RESET MINIMAL =========== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--c-ink);
  background-color: var(--c-cream);
  /* Paper texture sutil — assinatura boutique */
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.24, 0 0 0 0 0.16, 0 0 0 0 0.09, 0 0 0 0.025 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga' 1, 'kern' 1;
}
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea { font-family: inherit; font-size: inherit; color: inherit; background: transparent; border: 0; }
ul { list-style: none; }
em { font-style: italic; font-family: var(--f-serif); font-weight: 500; }
a { color: inherit; text-decoration: none; }

/* =========== CONTAINER EDITORIAL =========== */
.app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-3) var(--sp-7);
}
@media (min-width: 768px) {
  .app-container {
    padding: var(--sp-7) var(--sp-5) calc(var(--sp-7) + var(--sp-4));
  }
}

/* =========== ORNAMENTOS REUTILIZÁVEIS =========== */

/* Divisor ornamental (linha + diamante dourado) — signature do tema */
.ornament,
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin: var(--sp-5) 0;
  color: var(--c-gold);
}
.ornament::before,
.ornament::after,
.ornament-divider::before,
.ornament-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-line-gold), transparent);
  max-width: 120px;
}
.ornament::before,
.ornament-divider::before { background: linear-gradient(to left, var(--c-line-gold), transparent); }
.ornament::after,
.ornament-divider::after { background: linear-gradient(to right, var(--c-line-gold), transparent); }
.ornament-diamond {
  width: 8px;
  height: 8px;
  background: var(--c-gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Triplo diamante (header ornamento) */
.ornament-triple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.ornament-triple .d {
  width: 5px;
  height: 5px;
  background: var(--c-gold);
  transform: rotate(45deg);
}
.ornament-triple .d:nth-child(2) { width: 7px; height: 7px; background: var(--c-gold-deep); }

/* Eyebrow (small caps dourado) */
.eyebrow {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--c-gold-deep);
  margin-bottom: var(--sp-2);
}

/* =========== PROGRESS BAR (fina · invisível quase) =========== */
.progress-wrap {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-cream);
  border-bottom: 1px solid var(--c-line);
}
.progress-bar {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  height: 2px;
  background: var(--c-line);
  position: relative;
}
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: var(--c-gold);
  transition: width 480ms cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-label {
  max-width: 680px;
  margin: var(--sp-1) auto 0;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--c-bronze);
  text-align: right;
}

/* =========== SCREENS =========== */
.screen { display: none; animation: fade-in var(--t-slow) both; }
.screen.active { display: block; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========== LANDING =========== */
.landing {
  text-align: center;
  padding: var(--sp-3) 0;
}
.badge-mini {
  display: inline-block;
  font-family: var(--f-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--c-gold-deep);
  padding: 6px 14px;
  border: 1px solid var(--c-line-gold);
  border-radius: 999px;
  margin-bottom: var(--sp-4);
}
.badge-mini--success {
  color: var(--c-success);
  border-color: rgba(74, 107, 62, 0.30);
}

.headline {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: var(--fs-hero);
  line-height: 1.08;
  letter-spacing: var(--tr-headings);
  color: var(--c-ink);
  margin-bottom: var(--sp-3);
}
.headline em {
  font-style: italic;
  color: var(--c-gold-deep);
}
.headline-md {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: var(--tr-headings);
  color: var(--c-ink);
  margin-bottom: var(--sp-2);
}

.subheadline {
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--c-bronze);
  max-width: 540px;
  margin: 0 auto var(--sp-4);
}

/* Trust row — inline pills com tipografia Cormorant small caps + separador dourado */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-5);
}
.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--c-cacao);
  position: relative;
}
.trust-row li:not(:last-child)::after {
  content: "◆";
  color: var(--c-gold);
  font-size: 8px;
  margin-left: var(--sp-3);
  font-style: normal;
}
.trust-row li span[aria-hidden] {
  color: var(--c-gold-deep);
}

/* =========== CTA (assinatura boutique — anguloso, uppercase, refinado) =========== */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 var(--sp-4);
  background: var(--c-cacao);
  color: var(--c-paper);
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: var(--tr-cta);
  text-transform: uppercase;
  border-radius: var(--r-md);
  box-shadow: var(--sh-cta);
  transition: background var(--t-base), transform var(--t-fast), box-shadow var(--t-base);
  position: relative;
  overflow: hidden;
}
.cta--primary { width: 100%; max-width: 420px; }
.cta:hover {
  background: var(--c-cacao-deep);
  transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(42, 24, 16, 0.08), 0 12px 32px -8px rgba(61, 40, 23, 0.40);
}
.cta:active { transform: translateY(0); }
.cta:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}
/* Underline animado dourado abaixo do label (signature) */
.cta::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 0;
  height: 1px;
  background: var(--c-gold);
  transition: width var(--t-base), left var(--t-base);
}
.cta:hover::after {
  width: 32px;
  left: calc(50% - 16px);
}

.microcopy {
  margin-top: var(--sp-3);
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--c-bronze);
  text-align: center;
}

/* =========== QUIZ QUESTIONS =========== */
.question-card {
  padding: var(--sp-3) 0;
}
.q-counter {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--c-gold-deep);
  margin-bottom: var(--sp-3);
  text-align: center;
}
.q-text {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: var(--fs-q);
  line-height: 1.18;
  letter-spacing: var(--tr-headings);
  color: var(--c-ink);
  margin-bottom: var(--sp-2);
  text-align: center;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.q-microcopy {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--c-bronze);
  text-align: center;
  margin-bottom: var(--sp-5);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Options — boutique style: border dourada fina, paper bg, sem fill total */
.options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: 560px;
  margin: 0 auto;
}
.option {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.45;
  box-shadow: var(--sh-rest);
  transition: border-color var(--t-fast), box-shadow var(--t-base), transform var(--t-fast);
  position: relative;
  cursor: pointer;
  /* L-shape ornamento de canto sup. esq. dourado fino — só visível em hover */
}
.option::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 12px;
  height: 12px;
  border-top: 1px solid transparent;
  border-left: 1px solid transparent;
  transition: border-color var(--t-base);
}
.option::after {
  content: "";
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-bottom: 1px solid transparent;
  border-right: 1px solid transparent;
  transition: border-color var(--t-base);
}
.option:hover {
  border-color: var(--c-gold);
  box-shadow: var(--sh-hover-gold);
  transform: translateY(-2px);
}
.option:hover::before,
.option:hover::after {
  border-color: var(--c-gold);
}
.option:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}
/* Selected — boutique: NÃO preenche fundo. Apenas border dourada 2px + check */
.option--selected {
  border-color: var(--c-gold);
  border-width: 2px;
  padding: calc(var(--sp-3) - 1px) calc(var(--sp-4) - 1px);
  box-shadow: var(--sh-hover-gold);
}
.option--selected::before,
.option--selected::after {
  border-color: var(--c-gold);
}

/* Image grid (Q1) — aspect 3:4 portrait editorial · texto ABAIXO */
.options--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  max-width: 560px;
}
.option--image {
  padding: 0;
  text-align: center;
  overflow: hidden;
}
.option--image::before,
.option--image::after { display: none; }
.option-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--c-cream-deep);
  border-bottom: 1px solid var(--c-line);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-slow);
}
.option-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.option-img-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(48px, 12vw, 72px);
  filter: grayscale(20%) sepia(15%);
}
.option--image:hover .option-img {
  transform: scale(1.05);
}
.option-text {
  display: block;
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--c-ink);
  min-height: 64px;
}
@media (min-width: 600px) {
  .option-text { font-size: 15px; padding: var(--sp-3); }
}

/* =========== INTERSTITIAL =========== */
.interstitial-card {
  text-align: center;
  padding: var(--sp-5) 0;
  max-width: 580px;
  margin: 0 auto;
}
.interstitial-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 28px;
  color: var(--c-gold-deep);
  margin-bottom: var(--sp-3);
}
.interstitial-title {
  font-family: var(--f-serif);
  font-weight: 500;
  font-style: italic;
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: var(--tr-headings);
  color: var(--c-ink);
  margin-bottom: var(--sp-4);
}
.interstitial-body {
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--c-cacao);
  text-align: left;
}
.interstitial-body p {
  margin-bottom: var(--sp-2);
}
.interstitial-body p:first-of-type::first-letter {
  /* Drop cap serif dourado (assinatura boutique) */
  font-family: var(--f-serif);
  font-size: 3.4em;
  font-weight: 500;
  float: left;
  line-height: 0.9;
  margin: 6px 8px 0 0;
  color: var(--c-gold-deep);
}
.interstitial-body strong {
  color: var(--c-cacao);
  font-weight: 600;
}
.interstitial-body ul {
  margin: var(--sp-2) 0;
  padding-left: 0;
}
.interstitial-body li {
  position: relative;
  padding-left: 20px;
  margin-bottom: var(--sp-1);
}
.interstitial-body li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--c-gold);
  font-size: 8px;
}
.interstitial-card .cta {
  margin-top: var(--sp-5);
}

/* =========== LEAD CAPTURE =========== */
.lead-card {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}
.checklist {
  margin: var(--sp-3) auto var(--sp-5);
  max-width: 440px;
  text-align: left;
}
.checklist li {
  position: relative;
  padding: 8px 0 8px 28px;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--c-cacao);
  border-bottom: 1px solid var(--c-line);
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: "◆";
  position: absolute;
  left: 6px;
  top: 12px;
  color: var(--c-gold);
  font-size: 9px;
}

/* Form — underline only style (assinatura boutique) */
form .field {
  display: block;
  text-align: left;
  margin-bottom: var(--sp-4);
}
.field-label {
  display: block;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--c-bronze);
  margin-bottom: 4px;
}
.field-opt {
  color: var(--c-gold-deep);
  font-style: normal;
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
}
form input[type="text"],
form input[type="email"],
form input[type="tel"] {
  width: 100%;
  padding: 12px 2px 10px;
  font-family: var(--f-sans);
  font-size: 17px;
  color: var(--c-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  border-radius: 0;
  transition: border-color var(--t-base);
}
form input:focus {
  outline: none;
  border-bottom: 2px solid var(--c-gold);
  padding-bottom: 9px;
}
.field-error {
  display: block;
  margin-top: 4px;
  font-family: var(--f-sans);
  font-size: 13px;
  color: var(--c-error);
  min-height: 1em;
}
form .cta { margin-top: var(--sp-3); }

/* =========== LOADING SCREEN =========== */
.loading-card {
  text-align: center;
  padding: var(--sp-6) var(--sp-3);
  max-width: 460px;
  margin: 0 auto;
}
.spinner {
  width: 56px;
  height: 56px;
  border: 1px solid var(--c-line);
  border-top: 2px solid var(--c-gold);
  border-radius: 50%;
  margin: 0 auto var(--sp-4);
  animation: spin 1.4s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-msg {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--c-cacao);
  line-height: 1.4;
  transition: opacity 300ms;
}
.loading-msg.fade { opacity: 0; }

/* =========== ACCESSIBILITY =========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible global */
:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}
