:root {
  --primary: #00699e;
  --page-bg: #ffffff;
  --body-bg: #f8fafc;
  --loading-bg: #f9fafb;
  --card-bg: #f9fafb;
  --card-border: #e5e7eb;
  --text: #020617;
  --shadow: 0 10px 15px -3px rgb(100 116 139 / .05), 0 4px 6px -4px rgb(100 116 139 / .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--body-bg);
  color: var(--text);
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 16px; line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

.page { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 28px 20px; background: var(--page-bg); }
main { width: 100%; min-width: 320px; max-width: 512px; display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 640px) { main { gap: 40px; padding-top: 12px; } }
@media (min-width: 768px) { main { gap: 48px; } }

/* animações */
@keyframes appear { from { opacity: 0 } to { opacity: 1 } }
.fade-in { animation: appear 125ms ease-in-out forwards; }
@keyframes pulse { 0% { transform: scale(.98) } 50% { transform: scale(1.02) } 100% { transform: scale(.98) } }
.pulse { animation: pulse 1s ease infinite; }
@keyframes bounce { 0% { transform: translateX(0) } 50% { transform: translateX(-12px) } 100% { transform: translateX(0) } }
@keyframes arrowRight { 0% { transform: translateX(0) } 50% { transform: translateX(-2px) } 100% { transform: translateX(0) } }

/* header */
.header { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 4px; text-align: center; }
.header img { grid-column: 2; margin: 0 auto; width: 100%; max-width: 109px; height: auto; }
.header.small img { max-width: 50px; }

/* progresso */
.progress-track { height: 10px; background: #f9fafb; border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 10px; border-radius: 0 9999px 9999px 0; background-color: #000; background-image: linear-gradient(to right, #00699eCC, #00699e); transition: width 300ms ease-out; }

/* texto rico */
.title-block { display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.rich { white-space: pre-wrap; width: 100%; overflow-wrap: break-word; }
.rich p { margin: 0; white-space: pre-wrap; }
.rich p:empty::before { content: " "; display: inline-block; }
.rich mark { padding: .1rem .5rem; border-radius: .5rem; }

/* opções */
.options { display: grid; grid-template-columns: 1fr; gap: 8px; }
.option { background: var(--card-bg); border: 1px solid var(--primary); border-bottom-width: 4px; border-radius: 12px; box-shadow: var(--shadow); }
.option button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px; background: none; border: 0; cursor: pointer; }
.option .emoji { flex: none; font-size: 36px; line-height: 40px; padding: 4px 0; }
.option .label { flex: 1; text-align: center; font-size: 14px; line-height: 20px; color: var(--text); }

/* CTA */
.cta-wrap { position: relative; z-index: 1; padding-bottom: 8px; width: 100%; }
.cta {
  position: relative; z-index: 2; display: block; width: 100%; padding: 20px 0;
  border-radius: 12px; border: 0; border-bottom: 8px solid transparent;
  background-color: #000;
  background-image: linear-gradient(to bottom right, rgba(0,105,158,.75), rgba(0,105,158,.95));
  color: #fff; font-weight: 700; font-size: 16px; line-height: 24px; text-align: center; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.cta p { margin: 0; }
.cta:hover, .cta:active { transform: scale(1.05); box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04); }
.cta:active { opacity: .8; transition-duration: .1s; }

/* imagem */
.img { width: 100%; height: auto; margin: 0 auto; }

/* carrossel */
.carousel { display: flex; flex-direction: column; gap: 12px; }
.carousel-card { position: relative; overflow: hidden; border-radius: 12px; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; animation: bounce 1s ease-out 1s 1; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track img { min-width: 100%; width: 100%; flex-shrink: 0; scroll-snap-align: center; }
.carousel-arrow {
  position: absolute; right: 8px; top: 50%; margin-top: -20px; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  animation: arrowRight 2s ease-in-out infinite;
}
.carousel-arrow.left { right: auto; left: 8px; }
.carousel-arrow[hidden] { display: none; }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: #e5e7eb; opacity: .3; transition: opacity .2s; }
.dots span.on { opacity: 1; }

/* loading */
.loading { position: fixed; inset: 0; z-index: 50; background: var(--loading-bg); display: flex; align-items: center; justify-content: center; }
.loading-inner { width: 100%; min-width: 320px; max-width: 512px; padding: 16px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.loading-track { position: relative; width: 91.6667%; background: #e5e7eb; border-radius: 9999px; padding: 2px; }
.loading-fill { height: 20px; width: 0; border-radius: 9999px; background-color: #000; background-image: linear-gradient(to right, rgba(0,105,158,.6), #00699e); }
.loading-pct { position: absolute; inset: 0; width: 100%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; }
.loading-text { display: flex; flex-direction: column; gap: 12px; text-align: center; }
.loading-title { font-size: 16px; font-weight: 700; line-height: 24px; }
.loading-sub { line-height: 20px; }
.loading-sub p { margin: 0; }

/* cards neutros */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; box-shadow: var(--shadow); }

/* áudio */
.audio { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.audio-name { font-size: 12px; line-height: 16px; }
.audio-row { display: flex; align-items: center; gap: 16px; }
.audio-btn { flex: none; width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--primary); }
.audio-btn svg { display: block; width: 18px; height: 18px; }
.wave { position: relative; flex: 1; height: 40px; min-width: 0; }
.wave-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.wave-bars i { flex: none; width: 4px; border-radius: 4px; background: #d1d5db; opacity: .5; }
.wave-bars i.on { opacity: 1; }
.wave-dot { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.3); transform: translate(-50%, -50%); transition: all .7s; }
.avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* relatório */
.report { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.report-left { padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.report-title { font-size: 12px; line-height: 16px; font-weight: 700; text-align: center; }
.ring { width: 100%; aspect-ratio: 1; border-radius: 50%; padding: 14px; flex: none; }
.ring-in { width: 100%; height: 100%; border-radius: 50%; background: var(--card-bg); display: flex; align-items: center; justify-content: center; font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.05em; }
.report-right { display: flex; flex-direction: column; gap: 8px; }
.report-result { padding: 12px 4px; font-size: 12px; line-height: 16px; font-weight: 700; text-align: center; }
.report-img { flex: 1; display: flex; align-items: flex-end; padding: 12px 12px 0; overflow: hidden; }
.report-img img { width: 100%; }

/* níveis */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); padding: 28px 8px; }
.level { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 0 4px; }
.level + .level { border-left: 1px solid var(--card-border); }
.level-bar { width: 32px; height: 96px; border-radius: 6px; background: #e5e7eb; overflow: hidden; display: flex; align-items: flex-end; }
.level-fill { width: 100%; height: 0; background-color: #000; background-image: linear-gradient(to top, rgba(0,105,158,.6), #00699e); color: #fff; font-size: 8px; line-height: 12px; font-weight: 700; padding-top: 6px; text-align: center; transition: height 1s ease-out; }
.level-title { font-size: 12px; line-height: 16px; font-weight: 700; }
.level-desc { font-size: 10px; line-height: 16px; }
