/* =========================================================
   Quiz Funnel — Geladinho Gourmet R$3K
   by @josh-haynam — vanilla CSS, mobile-first, zero deps
   ========================================================= */

:root {
  /* Cores — paleta tropical premium */
  --color-bg: #FFF8F0;
  --color-bg-card: #FFFFFF;
  --color-text: #2A1810;
  --color-text-muted: #6B5D52;
  --color-text-light: #998877;
  --color-primary: #E85D34;
  --color-primary-hover: #D04822;
  --color-accent: #F7B538;
  --color-success: #4A9B5E;
  --color-error: #C0392B;
  --color-border: #EAD9C7;
  --color-border-active: #E85D34;
  --color-bg-soft: #FFF1EA;

  /* Tipografia */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-question: clamp(22px, 5vw, 30px);
  --fs-option: clamp(15px, 3.8vw, 18px);
  --fs-microcopy: clamp(13px, 3vw, 14px);
  --fs-headline: clamp(28px, 6vw, 42px);
  --fs-headline-md: clamp(24px, 5vw, 32px);

  /* Espaçamento */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --space-xl: 56px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Transições */
  --t-fast: 180ms ease-out;
  --t-base: 280ms ease-out;
  --t-slow: 480ms ease-out;

  /* Sombras */
  --shadow-card: 0 2px 12px rgba(42, 24, 16, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(232, 93, 52, 0.15);
  --shadow-cta: 0 4px 14px rgba(232, 93, 52, 0.35);
}

/* =========== RESET =========== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: 0; }
input, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }
em { font-style: italic; }

/* =========== APP CONTAINER =========== */
.app-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 18px 80px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .app-container { padding: 40px 32px 80px; }
}

/* =========== PROGRESS BAR =========== */
.progress-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--color-bg);
  padding: 12px 16px 8px;
}
.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-pill);
  transition: width var(--t-base);
}
.progress-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 6px;
  font-weight: 500;
}

.progress-wrap[hidden] { display: none; }

/* =========== SCREENS =========== */
.screen { display: none; animation: fadeSlide var(--t-base); }
.screen.active { display: block; }

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

/* =========== LANDING =========== */
.landing {
  text-align: center;
  padding: 32px 0;
}
.badge-mini {
  display: inline-block;
  padding: 6px 14px;
  background: var(--color-bg-soft);
  color: var(--color-primary);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 24px;
}
.badge-mini--success { background: rgba(74, 155, 94, 0.12); color: var(--color-success); }

.headline {
  font-family: var(--font-display);
  font-size: var(--fs-headline);
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: 16px;
  color: var(--color-text);
}
.headline em { color: var(--color-primary); font-style: italic; }

.headline-md {
  font-family: var(--font-display);
  font-size: var(--fs-headline-md);
  font-weight: 700;
  line-height: 1.22;
  margin-bottom: 12px;
}

.subheadline {
  font-size: clamp(15px, 3.8vw, 18px);
  color: var(--color-text-muted);
  margin-bottom: 28px;
  max-width: 500px;
  margin-inline: auto;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
  padding: 0;
}
.trust-row li {
  font-size: 13px;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

/* =========== CTA BUTTON =========== */
.cta {
  display: inline-block;
  width: 100%;
  max-width: 380px;
  padding: 18px 28px;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 700;
  line-height: 1.2;
  border-radius: var(--radius-md);
  transition: all var(--t-fast);
  text-align: center;
  text-decoration: none;
}
.cta--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.cta--primary:hover, .cta--primary:focus-visible {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 6px 18px rgba(232, 93, 52, 0.45);
}
.cta--primary:active { transform: translateY(0); }
.cta:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.microcopy {
  font-size: var(--fs-microcopy);
  color: var(--color-text-light);
  margin-top: 14px;
}

/* =========== QUESTION CARD =========== */
.question-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow-card);
}
@media (min-width: 768px) {
  .question-card { padding: 40px 36px; }
}

.q-counter {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.q-text {
  font-family: var(--font-display);
  font-size: var(--fs-question);
  font-weight: 700;
  line-height: 1.22;
  color: var(--color-text);
  margin-bottom: 10px;
}
.q-microcopy {
  font-size: var(--fs-microcopy);
  color: var(--color-text-muted);
  margin-bottom: 24px;
  font-style: italic;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 18px 20px;
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-option);
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
  line-height: 1.4;
  transition: all var(--t-fast);
}
.option::after {
  content: "→";
  margin-left: auto;
  padding-left: 12px;
  color: var(--color-text-light);
  font-weight: 600;
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.option:hover, .option:focus-visible {
  border-color: var(--color-border-active);
  background: var(--color-bg-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  outline: none;
}
.option:hover::after { transform: translateX(4px); color: var(--color-primary); }
.option--selected {
  border-color: var(--color-primary);
  background: var(--color-bg-soft);
}

/* Image grid for Q1 */
.options--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.option--image {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}
.option--image::after { display: none; }
.option-img {
  width: 100%;
  flex: 1 1 60%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  position: relative;
  overflow: hidden;
}
.option-img-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(48px, 12vw, 72px);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
.option-text {
  flex: 0 0 auto;
  padding: 12px 14px;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 600;
  line-height: 1.3;
  background: #fff;
  text-align: left;
}

/* =========== INTERSTITIAL =========== */
.interstitial-card {
  background: linear-gradient(155deg, var(--color-bg-soft) 0%, #fff 100%);
  border-radius: var(--radius-lg);
  padding: 36px 26px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
@media (min-width: 768px) {
  .interstitial-card { padding: 56px 44px; }
}
.interstitial-icon {
  font-size: 42px;
  margin-bottom: 18px;
  display: inline-block;
}
.interstitial-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5.5vw, 32px);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 18px;
  line-height: 1.2;
}
.interstitial-body {
  font-size: clamp(15px, 3.8vw, 17px);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 28px;
  text-align: left;
}
.interstitial-body strong { color: var(--color-primary); }
.interstitial-body p + p { margin-top: 12px; }
.interstitial-body ul { margin: 14px 0; padding-left: 4px; }
.interstitial-body ul li {
  padding-left: 26px;
  position: relative;
  margin-bottom: 6px;
}
.interstitial-body ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: 700;
}

/* =========== LEAD CAPTURE =========== */
.lead-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 22px;
  box-shadow: var(--shadow-card);
}
@media (min-width: 768px) {
  .lead-card { padding: 48px 40px; }
}

.checklist {
  margin: 18px 0 28px;
  padding: 0;
}
.checklist li {
  padding: 8px 0 8px 30px;
  position: relative;
  font-size: 15px;
  color: var(--color-text);
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--color-success);
  font-weight: 700;
  font-size: 18px;
}

.field {
  display: block;
  margin-bottom: 18px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.field-opt {
  font-weight: 400;
  color: var(--color-text-light);
  font-style: italic;
  font-size: 12px;
}
.field input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--t-fast);
}
.field input:focus {
  border-color: var(--color-primary);
  outline: none;
}
.field--error input {
  border-color: var(--color-error);
  animation: shake 280ms;
}
.field-error {
  display: block;
  font-size: 12px;
  color: var(--color-error);
  margin-top: 6px;
  min-height: 14px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* =========== LOADING SCREEN =========== */
.loading-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 60px 28px;
  box-shadow: var(--shadow-card);
  text-align: center;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 28px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg {
  font-size: clamp(16px, 4vw, 19px);
  font-weight: 500;
  color: var(--color-text);
  max-width: 380px;
  line-height: 1.4;
  transition: opacity 600ms;
}
.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 {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* =========== UTIL =========== */
[hidden] { display: none !important; }
