:root {
  --navy: #0f1b4d;
  --navy-2: #1f2a5c;
  --cyan: #1fc3cd;
  --cyan-2: #3fd6dd;
  --cyan-soft: #bdf0f3;
  --cyan-border: #a9e3ea;
  --track: #c9eef2;
  --yellow-1: #ffe55c;
  --yellow-2: #ffc928;
  --yellow-dark: #e8a800;
  --bg-1: #e6f8fb;
  --bg-2: #f5fdfe;
  --wave-1: #d3f3f7;
  --wave-2: #dff6f9;
  --wave-3: #c6eff5;
  --text: #2b3566;
  --radius-card: 24px;
  --radius-opt: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg-1); }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--navy);
  font-size: 16px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-1) 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Decorative background */
body { position: relative; }
.deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.deco svg { position: absolute; left: 0; width: 100%; }
.deco .wave-top { top: 0; height: 340px; }
.deco .wave-bottom { bottom: 0; height: 180px; }

#app { position: relative; z-index: 1; max-width: 30rem; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 16px 110px; }

/* Sparkles */
.spark { position: absolute; width: 22px; height: 22px; color: #ffd21f; filter: drop-shadow(0 1px 0 #f0a800); }
.spark.sm { width: 14px; height: 14px; }
.spark svg { width: 100%; height: 100%; display: block; }
.spark { animation: twinkle 2.4s ease-in-out infinite; }
.spark:nth-child(2n) { animation-delay: .8s; }
@keyframes twinkle { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.75); opacity: .7; } }

/* Header */
.header { position: relative; padding-top: 10px; text-align: center; }
.header .back {
  position: absolute; left: -6px; top: 10px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.7); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--navy); box-shadow: 0 2px 8px rgba(15,27,77,.08); z-index: 2;
}
.header .back svg { width: 20px; height: 20px; }
.logo-wrap { position: relative; display: inline-block; }
.logo-wrap .logo { display: block; width: 160px; height: auto; margin: 0 auto; filter: drop-shadow(0 6px 10px rgba(15,27,77,.15)); }
.header.big .logo-wrap .logo { width: 172px; }
.logo-wrap .spark.l1 { left: -46px; top: 52%; }
.logo-wrap .spark.l2 { left: -62px; top: 68%; }
.logo-wrap .spark.r1 { right: -48px; top: 62%; }
.logo-wrap .spark.r2 { right: -64px; top: 76%; }

/* Hero */
.hero { position: relative; text-align: center; margin-top: 8px; }
.hero .text h1 {
  position: relative; display: inline-block; font-size: 1.95rem; line-height: 1.08; font-weight: 900; color: var(--navy);
  letter-spacing: -.01em; padding: 0 34px;
}
.hero .text h1::before, .hero .text h1::after {
  content: ""; position: absolute; top: 50%; width: 28px; height: 44px; transform: translateY(-55%);
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 44'%3E%3Cg stroke='%23ffcb1f' stroke-width='6' stroke-linecap='round'%3E%3Cpath d='M22 6 12 14'/%3E%3Cpath d='M22 22H8'/%3E%3Cpath d='M22 38 12 30'/%3E%3C/g%3E%3C/svg%3E");
}
.hero .text h1::before { left: -2px; }
.hero .text h1::after { right: -2px; transform: translateY(-55%) scaleX(-1); }
.hero .layer { text-align: center; }

/* Progress */
.progress-wrap { margin: 18px 12px 0; }
.progress-label { font-size: 1rem; font-weight: 900; color: var(--navy); margin-bottom: 8px; }
.progress { height: 13px; background: var(--track); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--cyan-2)); border-radius: 999px; transition: width .45s ease; }

/* Step + card */
.step { flex: 1; padding-top: 16px; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card {
  background: rgba(255,255,255,.92); border-radius: var(--radius-card);
  padding: 18px 14px; display: flex; flex-wrap: wrap; gap: 14px 0;
  box-shadow: 0 10px 30px rgba(31,195,205,.18), 0 2px 6px rgba(15,27,77,.05);
  border: 1px solid rgba(255,255,255,.9);
}
.card + .card, .card + .cta-row, .cta-row + .card, .cta-row + .cta-row, .plain + .cta-row, .cta-row + .plain { margin-top: 20px; }
.plain { display: flex; flex-wrap: wrap; gap: 12px 0; }
.layer { width: 100%; min-width: 0; }
.layer.half { width: 50%; padding: 0 4px; }

/* Text (Quill) */
.text { color: var(--text); line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.text h1, .text h2, .text h3 { color: var(--navy); font-weight: 900; line-height: 1.2; }
.text h1 { font-size: 1.6rem; }
.text h2 { font-size: 1.4rem; }
.text h3 { font-size: 1.3rem; }
.text p { font-size: 1rem; }
.text p + p, .text h1 + p, .text h2 + p, .text h3 + p { margin-top: 6px; }
.text [style^="color: rgb(0, 0, 0)"], .text [style*="; color: rgb(0, 0, 0)"],
.text [style^="color: rgb(9, 9, 11)"], .text [style*="; color: rgb(9, 9, 11)"],
.text [style^="color: rgb(2, 6, 23)"], .text [style*="; color: rgb(2, 6, 23)"] { color: var(--navy) !important; }
.card .text h1 .ql-size-small, .card .text h2 .ql-size-small, .card .text h3 .ql-size-small { font-size: 1em; }
.text [style*="background-color: transparent"], .text [style*="background-color: rgb(255, 255, 255)"], .text [style*="background-color: rgb(248, 247, 250)"] { background: transparent !important; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-size-small { font-size: .78em; }
.ql-size-large { font-size: 1.5em; }

/* Options */
.options { display: grid; grid-template-columns: 1fr; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 54px; padding: 10px 16px; text-align: left;
  background: #fff; border: 2px solid var(--cyan-border); border-radius: var(--radius-opt);
  font: inherit; color: var(--navy); cursor: pointer;
  box-shadow: 0 2px 6px rgba(31,195,205,.12);
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.option:hover { border-color: var(--cyan); }
.option:active { transform: scale(.985); }
.option .radio {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--cyan);
  background: #fff; display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.option .radio svg { width: 16px; height: 16px; color: #fff; opacity: 0; }
.option .emoji { flex: none; font-size: 22px; line-height: 1; }
.option .label { flex: 1; min-width: 0; font-size: 1.08rem; line-height: 1.3; font-weight: 800; overflow-wrap: anywhere; }
.option .label p { margin: 0; text-align: left !important; }
.option .label * { color: inherit !important; background: transparent !important; font-style: normal; }
.option.selected {
  background: linear-gradient(180deg, #c9f5f6, var(--cyan-soft));
  border-color: var(--cyan); box-shadow: 0 4px 12px rgba(31,195,205,.3);
}
.option.selected .radio { background: var(--cyan); border-color: var(--cyan); }
.option.selected .radio svg { opacity: 1; }
.half .option { gap: 8px; padding: 10px 8px; min-height: 70px; }
.half .option .radio { width: 22px; height: 22px; border-width: 2px; }
.half .option .radio svg { width: 13px; height: 13px; }
.half .option .emoji { display: none; }
.half .option .label { font-size: .88rem; font-weight: 700; }

/* CTA */
.cta-row { position: relative; padding: 0 30px; }
.cta-row .spark.a { left: 0; top: 18px; }
.cta-row .spark.b { left: 16px; top: 46px; }
.cta-row .spark.c { right: 2px; top: 6px; }
.cta-row .spark.d { right: 18px; top: 34px; }
.btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  min-height: 62px; padding: 12px 22px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, var(--yellow-1) 0%, var(--yellow-2) 100%);
  color: var(--navy); font: inherit; font-size: 1.45rem; font-weight: 900; line-height: 1.15;
  cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: 0 6px 0 var(--yellow-dark), 0 12px 22px rgba(232,168,0,.3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn::before {
  content: ""; position: absolute; left: 7%; top: 7px; width: 34%; height: 13px; border-radius: 999px;
  background: rgba(255,255,255,.65); transform: rotate(-4deg);
}
.btn .arrow { flex: none; width: 30px; height: 30px; }
.btn.long { font-size: 1.08rem; }
.btn.long::before { height: 8px; top: 5px; opacity: .7; }
.btn.long .arrow { width: 22px; height: 22px; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--yellow-dark), 0 6px 12px rgba(232,168,0,.25); }
.btn.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* Alerts */
.alert { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: var(--radius-opt); border: 2px solid; line-height: 1.4; font-weight: 700; }
.alert .icon { font-size: 18px; flex: none; }
.alert .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert.danger { background: #fff1f1; border-color: #fecaca; color: #dc2626; }
.alert.success { background: #effdfd; border-color: var(--cyan-border); color: var(--navy); }
.alert p { margin: 0; }
.alert.highlight { background: transparent; border: 0; padding: 4px 0; box-shadow: none; }
.alert.highlight .body { text-align: center; color: #111; font-size: 1.3rem; font-weight: 900; line-height: 1.6; }
.alert.highlight strong {
  color: #111; padding: 2px 8px;
  background: linear-gradient(180deg, transparent 18%, #ffd93b 18%, #ffd93b 88%, transparent 88%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Image */
.img { display: block; width: 100%; height: auto; border-radius: 16px; }

/* Spacer */
.clear { height: .5rem; }

/* Loading */
.loading { text-align: center; padding: 8px 0; }
.loading .ltitle { font-weight: 900; font-size: 1.25rem; color: var(--navy); margin-bottom: 14px; }
.loading .bar { height: 16px; background: var(--track); border-radius: 999px; overflow: hidden; }
.loading .bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--cyan-2)); border-radius: 999px; }
.loading .pct { margin-top: 10px; font-weight: 900; color: var(--cyan); font-size: 1.3rem; }
.loading .desc { margin-top: 6px; }

/* Charts */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chart { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; background: #fff; border: 2px solid var(--cyan-border); border-radius: var(--radius-opt); min-width: 0; }
.chart .ring { position: relative; width: 100px; height: 100px; }
.chart .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.chart .ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.35rem; }
.chart .legend { font-size: 13px; line-height: 1.3; }

/* Fields */
.field label { display: block; font-weight: 800; margin-bottom: 6px; color: var(--navy); }
.field input {
  width: 100%; height: 56px; padding: 0 16px; font: inherit; font-weight: 700; color: var(--navy);
  border: 2px solid var(--cyan-border); border-radius: var(--radius-opt); outline: none; background: #fff;
}
.field input::placeholder { color: #8a93b8; font-weight: 600; }
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(31,195,205,.2); }
.field.error input { border-color: #dc2626; }
.field .err { color: #dc2626; font-size: 13px; font-weight: 700; margin-top: 4px; display: none; }
.field.error .err { display: block; }

.chart .ring circle:first-child { stroke: var(--track); }

/* Primeira tela sem logo: conteúdo mais para baixo */
#app.first { padding-top: 12vh; }

/* Logo com metade do tamanho */
.logo-wrap .logo, .header.big .logo-wrap .logo { width: 80px; }
.logo-wrap .spark.l1 { left: -26px; } .logo-wrap .spark.l2 { left: -36px; }
.logo-wrap .spark.r1 { right: -28px; } .logo-wrap .spark.r2 { right: -38px; }
