/* AvaFly Pesquisa — visual acolhedor e pé no chão */
:root {
  --bg: #f5f1ea;
  --surface: #fffdf9;
  --surface-2: #efe9df;
  --ink: #1e1c19;
  --muted: #6b655c;
  --faint: #a39b8f;
  --line: #e3dccf;
  --green: #24584a;
  --green-soft: #dfe9e3;
  --terra: #d0613b;
  --terra-soft: #f6e1d7;
  --ok: #2f7d5b;
  --warn: #b5532f;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(30 28 25 / 0.04), 0 8px 24px -12px rgb(30 28 25 / 0.12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* topo */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.top-inner { max-width: 720px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.org { font-family: var(--serif); font-weight: 600; font-size: 17px; }
.by { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.by svg { height: 22px; width: auto; color: var(--ink); }
.progress { height: 4px; background: var(--line); }
.progress > span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 0 4px 4px 0; transition: width .45s cubic-bezier(.22,1,.36,1); }

/* palco */
.stage { max-width: 720px; margin: 0 auto; padding: 32px 20px 140px; }
.screen { animation: enter .45s cubic-bezier(.22,1,.36,1); }
.screen.back { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .progress > span { transition: none; } }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--green); background: var(--green-soft); padding: 6px 12px; border-radius: 999px; }
.q-title { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 5.2vw, 36px); line-height: 1.15; letter-spacing: -0.01em; margin: 18px 0 8px; }
.q-hint { color: var(--muted); margin: 0 0 22px; }
.q-num { color: var(--faint); font-size: 14px; font-weight: 600; margin-top: 4px; }

/* opções */
.options { display: grid; gap: 10px; margin-top: 22px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  text-align: left; padding: 16px 18px; min-height: 60px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color .15s, background .15s, transform .15s;
}
.opt:hover { border-color: var(--faint); transform: translateY(-1px); }
.opt .key {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  border: 1.5px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); background: var(--bg);
}
.opt[aria-checked="true"], .opt[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.opt[aria-checked="true"] .key, .opt[aria-pressed="true"] .key { background: var(--green); border-color: var(--green); color: #fff; }
.opt .label { flex: 1; }
.opt.check .key { border-radius: 8px; }

/* escala */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 26px; }
.scale button {
  aspect-ratio: 1 / 1; max-height: 74px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line);
  font-family: var(--serif); font-size: 26px; font-weight: 600; box-shadow: var(--shadow); transition: all .15s;
}
.scale button:hover { border-color: var(--faint); }
.scale button[aria-checked="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin-top: 10px; }

/* likert */
.likert { display: grid; gap: 14px; margin-top: 22px; }
.likert-item { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.likert-item p { margin: 0 0 12px; font-weight: 500; }
.likert-item .scale { margin-top: 0; }
.likert-item .scale button { font-size: 20px; max-height: 52px; aspect-ratio: auto; height: 52px; }
.likert-item .scale-labels { font-size: 13px; margin-top: 8px; }

/* texto */
.text-input {
  width: 100%; min-height: 150px; resize: vertical; margin-top: 18px;
  padding: 16px 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 18px; line-height: 1.5; box-shadow: var(--shadow);
}
.text-input:focus { outline: none; border-color: var(--green); }
.other-input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--surface); margin-top: 4px; }
.other-input:focus { outline: none; border-color: var(--green); border-style: solid; }
.count { text-align: right; color: var(--faint); font-size: 13px; margin-top: 6px; }

/* rodapé de navegação */
.nav {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
}
.nav-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px; border: 0; font-weight: 600; font-size: 16px;
  background: var(--ink); color: var(--bg); transition: transform .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .35; transform: none; cursor: not-allowed; }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); padding-left: 6px; padding-right: 6px; }
.btn kbd { font: 600 12px var(--sans); opacity: .65; }
.helper { color: var(--faint); font-size: 13px; }
.error { color: var(--warn); font-weight: 500; margin-top: 14px; }

/* abertura */
.hero-card { background: var(--surface); border-radius: 26px; padding: clamp(24px, 5vw, 44px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-title { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 7vw, 54px); line-height: 1.04; letter-spacing: -0.02em; margin: 18px 0 16px; }
.hero-title em { font-style: italic; color: var(--terra); }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 30px; }
.fact { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.fact i { width: 8px; height: 8px; border-radius: 50%; background: var(--terra); display: inline-block; }

/* seção */
.section-card { text-align: left; }
.section-num { font-family: var(--serif); font-size: clamp(72px, 16vw, 120px); line-height: .9; color: var(--terra); font-weight: 600; }
.section-title { font-family: var(--serif); font-size: clamp(30px, 6vw, 44px); font-weight: 600; margin: 8px 0 10px; line-height: 1.1; }

/* final */
.result-card { background: var(--green); color: #fff; border-radius: 26px; padding: clamp(24px, 5vw, 40px); position: relative; overflow: hidden; }
.result-card .label { opacity: .8; font-size: 14px; font-weight: 600; }
.result-card .level { font-family: var(--serif); font-size: clamp(40px, 9vw, 64px); font-weight: 600; line-height: 1; margin: 10px 0 18px; }
.gauge { height: 12px; background: rgb(255 255 255 / .2); border-radius: 999px; overflow: hidden; }
.gauge > span { display: block; height: 100%; background: #f7c9a8; border-radius: 999px; width: 0; transition: width 1.2s cubic-bezier(.22,1,.36,1); }
.gauge-legend { display: flex; justify-content: space-between; font-size: 12px; opacity: .75; margin-top: 8px; }
.tip { background: rgb(255 255 255 / .12); border-radius: 14px; padding: 14px 16px; margin-top: 20px; }
.answers { display: grid; gap: 12px; margin-top: 28px; }
.answer { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.answer .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.answer .tag.hit { background: var(--green-soft); color: var(--ok); }
.answer .tag.miss { background: var(--terra-soft); color: var(--warn); }
.answer h4 { font-family: var(--serif); font-size: 19px; margin: 10px 0 8px; line-height: 1.3; }
.answer p { margin: 0; color: var(--muted); }
.answer .right { color: var(--ink); font-weight: 600; margin-top: 10px; }

.foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: 40px; }

/* ===================== Painel de resultados ===================== */
.dash { max-width: 1200px; margin: 0 auto; padding: 28px 20px 80px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.dash-title { font-family: var(--serif); font-size: clamp(30px, 4.6vw, 48px); font-weight: 600; line-height: 1.05; margin: 10px 0 6px; letter-spacing: -0.01em; }
.dash-meta { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgb(47 125 91 / .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(47 125 91 / 0); } 100% { box-shadow: 0 0 0 0 rgb(47 125 91 / 0); } }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.sm { padding: 10px 16px; font-size: 14px; }
.btn.outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.kpi.feature { background: var(--green); color: #fff; border-color: var(--green); }
.kpi .v { font-family: var(--serif); font-size: clamp(44px, 5.5vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.kpi .v small { font-size: .45em; font-weight: 500; margin-left: 4px; opacity: .7; }
.kpi .l { margin-top: 10px; font-size: 15px; line-height: 1.35; }
.kpi.feature .l, .kpi.feature .s { opacity: .85; }
.kpi .s { margin-top: 6px; font-size: 13px; color: var(--muted); }

.insights { margin: 22px 0; display: grid; gap: 10px; }
.insight { display: flex; gap: 12px; align-items: flex-start; background: var(--terra-soft); color: #5a2a17; border-radius: 14px; padding: 14px 16px; font-weight: 500; }
.insight b { font-family: var(--serif); font-size: 20px; color: var(--terra); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 0 0 4px; line-height: 1.25; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.panel.wide { grid-column: 1 / -1; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 48px; gap: 12px; align-items: center; font-size: 15px; }
.bar-track { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 999px; width: 0; transition: width .9s cubic-bezier(.22,1,.36,1); }
.bar-fill.terra { background: var(--terra); }
.bar-fill.soft { background: #9ab8aa; }
.bar-pct { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row.correct .bar-label::after { content: " ✓"; color: var(--ok); font-weight: 700; }

.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .levels { grid-template-columns: repeat(2, 1fr); } }
.level-box { border-radius: 14px; padding: 16px; background: var(--surface-2); }
.level-box .n { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; }
.level-box .t { font-weight: 600; margin-top: 6px; }
.level-box .p { color: var(--muted); font-size: 14px; }
.level-box:nth-child(1) { background: #f3e1d6; }
.level-box:nth-child(2) { background: #efe6d2; }
.level-box:nth-child(3) { background: #dfe9e3; }
.level-box:nth-child(4) { background: #cfe0d6; }

.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.quote { background: var(--bg); border-radius: 14px; padding: 14px 16px; font-size: 15px; }
.empty { color: var(--faint); font-style: italic; }

.gate { max-width: 420px; margin: 12vh auto 0; padding: 0 20px; }
.gate input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); margin: 16px 0 12px; font-size: 16px; }
.gate input:focus { outline: none; border-color: var(--green); }

/* modo apresentação: maior e sem distrações */
body.present .dash { max-width: 1500px; }
body.present .dash-actions .hide-present { display: none; }
body.present .kpi .v { font-size: clamp(56px, 6vw, 88px); }
body.present .panel h3 { font-size: 24px; }
body.present .bar-row { font-size: 17px; }
.kpi.feature .s { color: #fff; opacity: .8; }
a.btn { text-decoration: none; }

.section-go { margin-top: 26px; }
.section-tip { color: var(--faint); font-size: 14px; margin-top: 12px; }
