/* ===================================================================
   Quiz MCMV — Blendi Empreendimentos
   Vanilla CSS, mobile first.
   =================================================================== */

:root {
  /* Paleta Blendi */
  --brand-lime: #9dc528;
  --brand-green: #5baa3f;
  --brand-green-deep: #2e7d32;
  --brand-dark: #2b2b2b;
  --brand-gray: #8a8a8a;
  --brand-gray-soft: #e6e7e3;

  /* Acentos */
  --accent-mcmv: #f0a836;
  --danger: #d64545;
  --success: #3aa55a;

  /* Superfícies */
  --bg-base: #f4f8ec;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --surface-glass-border: rgba(255, 255, 255, 0.6);
  --surface-option: #ffffff;
  --surface-option-border: rgba(43, 43, 43, 0.08);

  /* Raios e sombras */
  --radius-card: 28px;
  --radius-option: 16px;
  --radius-pill: 999px;
  --shadow-glass: 0 24px 60px -20px rgba(46, 125, 50, 0.35),
    0 6px 18px -8px rgba(0, 0, 0, 0.12);
  --shadow-option: 0 4px 12px -6px rgba(46, 125, 50, 0.18);
  --shadow-option-hover: 0 10px 24px -10px rgba(46, 125, 50, 0.32);

  /* Tipografia */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--brand-dark);
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at top left, rgba(157, 197, 40, 0.35), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(46, 125, 50, 0.4), transparent 60%),
    linear-gradient(135deg, #eaf3d5 0%, #d3e9c4 50%, #b9d8a3 100%);
  background-attachment: fixed;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Acessibilidade — skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  padding: 10px 14px;
  background: var(--brand-green-deep);
  color: #fff;
  border-radius: 12px;
  z-index: 99;
  width: auto;
  height: auto;
}

/* ===================================================================
   Decoração de fundo (blobs flutuantes)
   =================================================================== */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: floaty 18s ease-in-out infinite;
}
.bg-blob--1 {
  width: 360px;
  height: 360px;
  background: var(--brand-lime);
  top: -80px;
  left: -100px;
}
.bg-blob--2 {
  width: 420px;
  height: 420px;
  background: var(--brand-green);
  bottom: -160px;
  right: -140px;
  animation-delay: -6s;
}
.bg-blob--3 {
  width: 280px;
  height: 280px;
  background: var(--brand-green-deep);
  top: 40%;
  right: 10%;
  opacity: 0.25;
  animation-delay: -12s;
}

@keyframes floaty {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob { animation: none; }
}

/* ===================================================================
   Layout do quiz
   =================================================================== */
.quiz {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}
.quiz-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}
.quiz-logo--brand {
  height: 44px;
}
.quiz-logo--mcmv {
  height: 52px;
}

/* ===================================================================
   Card glass
   =================================================================== */
.card {
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-card);
  padding: 22px 18px 16px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

/* ===================================================================
   Progresso
   =================================================================== */
.progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-green-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.progress-track {
  height: 8px;
  background: rgba(43, 43, 43, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-lime), var(--brand-green-deep));
  border-radius: var(--radius-pill);
  transition: width 360ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer {
  to { transform: translateX(100%); }
}

/* ===================================================================
   Micro-elogio
   =================================================================== */
.cheer {
  min-height: 0;
  font-weight: 700;
  color: var(--brand-green-deep);
  text-align: center;
  font-size: 1.05rem;
  transition: opacity 200ms ease, transform 200ms ease;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}
.cheer.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   Steps
   =================================================================== */
.step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: stepIn 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.step[hidden] { display: none; }

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

.step-title {
  margin: 0;
  font-size: clamp(1.35rem, 4.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
  line-height: 1.2;
}
.step-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--brand-gray);
}

/* ===================================================================
   Options (multiple choice)
   =================================================================== */
.options {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-option);
  border: 1.5px solid var(--surface-option-border);
  background: var(--surface-option);
  color: var(--brand-dark);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  text-align: left;
  width: 100%;
  cursor: pointer;
  box-shadow: var(--shadow-option);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 200ms ease,
    background 160ms ease;
}
.option-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-green);
  box-shadow: var(--shadow-option-hover);
}
.option-card:focus-visible {
  outline: none;
  border-color: var(--brand-green-deep);
  box-shadow: 0 0 0 4px rgba(91, 170, 63, 0.25);
}
.option-card:active {
  transform: translateY(0);
}
.option-card.is-selected {
  background: linear-gradient(
    135deg,
    rgba(157, 197, 40, 0.18),
    rgba(91, 170, 63, 0.22)
  );
  border-color: var(--brand-green-deep);
  color: var(--brand-green-deep);
}

.option-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex: 0 0 auto;
}
.option-text {
  flex: 1;
  line-height: 1.35;
}

/* ===================================================================
   Form final
   =================================================================== */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-dark);
}
.field input {
  font-family: inherit;
  font-size: 1rem;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--surface-option-border);
  background: #fff;
  color: var(--brand-dark);
  transition: border-color 160ms ease, box-shadow 200ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder {
  color: #b9b9b9;
}
.field input:focus {
  outline: none;
  border-color: var(--brand-green-deep);
  box-shadow: 0 0 0 4px rgba(91, 170, 63, 0.18);
}
.field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.12);
}
.field-error {
  min-height: 1.1em;
  color: var(--danger);
  font-size: 0.82rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-green-deep));
  color: #fff;
  font-family: inherit;
  font-size: 1.04rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 28px -16px rgba(46, 125, 50, 0.7);
  transition:
    transform 160ms ease,
    box-shadow 200ms ease,
    filter 200ms ease;
  margin-top: 6px;
}
.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 36px -18px rgba(46, 125, 50, 0.8);
}
.cta:active {
  transform: translateY(0);
}
.cta:disabled {
  filter: grayscale(0.4);
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.cta-arrow {
  font-weight: 800;
  transition: transform 200ms ease;
}
.cta:hover .cta-arrow { transform: translateX(4px); }

.form-feedback {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
  color: var(--brand-gray);
  min-height: 1.2em;
}
.form-feedback.is-error { color: var(--danger); }
.form-feedback.is-success { color: var(--success); }

.form-disclaimer {
  margin: 0;
  font-size: 0.78rem;
  color: var(--brand-gray);
  text-align: center;
}

/* ===================================================================
   Tela final (sucesso)
   =================================================================== */
.step--done {
  align-items: center;
  text-align: center;
  padding: 12px 0 8px;
  gap: 12px;
}
.check-icon {
  width: 88px;
  height: 88px;
  margin: 4px auto 4px;
}
.check-icon circle {
  fill: rgba(91, 170, 63, 0.12);
  stroke: var(--brand-green);
  stroke-width: 2;
}
.check-icon path {
  fill: none;
  stroke: var(--brand-green-deep);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 600ms ease-out 120ms forwards;
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.done-lead {
  margin: 4px 0 2px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-green-deep);
}
.step--done .step-hint {
  font-size: 0.95rem;
  color: var(--brand-dark);
  line-height: 1.55;
  max-width: 420px;
  margin: 0 auto;
}
.step--done .step-hint strong {
  color: var(--brand-green-deep);
  font-weight: 700;
}

.done-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px auto 6px;
  padding: 14px 18px;
  background: rgba(91, 170, 63, 0.08);
  border: 1px solid rgba(91, 170, 63, 0.18);
  border-radius: 14px;
  max-width: 360px;
  width: 100%;
}
.done-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--brand-dark);
  font-weight: 500;
}

.done-cta {
  margin-top: 10px;
  text-decoration: none;
  max-width: 320px;
  width: 100%;
}

/* ===================================================================
   Footer do card
   =================================================================== */
.quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(43, 43, 43, 0.06);
  margin-top: 4px;
}
.back-btn {
  background: transparent;
  border: none;
  color: var(--brand-green-deep);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background 160ms ease;
}
.back-btn:hover { background: rgba(91, 170, 63, 0.1); }
.back-btn[hidden] { display: none; }
.quiz-foot-mark {
  font-size: 0.78rem;
  color: var(--brand-gray);
  margin-left: auto;
}

/* ===================================================================
   Breakpoints
   =================================================================== */
@media (min-width: 720px) {
  .quiz {
    max-width: 620px;
    padding: 40px 24px 60px;
    gap: 28px;
  }
  .card {
    padding: 32px 28px 22px;
    gap: 22px;
  }
  .quiz-logo--brand { height: 52px; }
  .quiz-logo--mcmv { height: 60px; }
  .option-card {
    padding: 16px 18px;
    font-size: 1rem;
  }
}
