/* Pesquisa de Clima — identidade KRAH (Lato, vermelho #e30514, grafite #424044) */
:root {
  --red: #e30514; --red-dark: #b00510; --red-soft: #fdeceb; --red-line: #f6b9bd;
  --ink: #2b2a2f; --ink-2: #3a393f; --heading: #424044; --text: #404040; --steel: #5d5a64;
  --muted: #7b7882; --line: #e4e2e7; --line-2: #d3d0d8; --bg: #f3f2f4; --card: #fff;
  --radius: 4px; --ease: cubic-bezier(.22, .9, .32, 1);
  --shadow: 0 1px 2px rgba(43, 42, 47, .05), 0 8px 24px rgba(43, 42, 47, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--text); font: 16px/1.65 'Lato', 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
img, svg { display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { color: var(--heading); font-weight: 300; letter-spacing: 1px; line-height: 1.25; margin: 0; }
h1 strong, h2 strong, h3 strong { font-weight: 900; }
p { margin: 0 0 12px; }
b, strong { font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* ---------- topo ---------- */
.topbar { background: var(--ink); color: #fff; position: relative; z-index: 10; }
.topbar-inner { max-width: 880px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 18px; }
.logo img { height: 32px; width: auto; }
.topbar-title { font-size: .78rem; letter-spacing: 2.5px; text-transform: uppercase; color: #c7c3cd; padding-left: 18px; border-left: 1px solid #55535b; }
.topbar-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; letter-spacing: 1px; text-transform: uppercase; color: #c7c3cd; }
.topbar-badge svg { width: 15px; height: 15px; color: var(--red); }

.app { max-width: 880px; margin: 0 auto; padding: 0 24px 140px; }
.loading { display: flex; gap: 8px; justify-content: center; padding: 120px 0; }
.loading span { width: 8px; height: 8px; background: var(--red); animation: blink 1s infinite var(--ease); }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }

/* ---------- botões ---------- */
.btn { font: 700 .92rem/1 'Lato', sans-serif; letter-spacing: .5px; border: 1px solid transparent; border-radius: var(--radius); padding: 14px 22px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.btn svg { width: 18px; height: 18px; stroke-width: 2.4; transition: transform .2s var(--ease); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(227, 5, 20, .22); }
.btn.primary:hover { background: var(--red-dark); }
.btn.primary:hover svg { transform: translateX(3px); }
.btn.dark { background: var(--steel); color: #fff; }
.btn.dark:hover { background: var(--red); }
.btn.ghost { background: transparent; color: var(--steel); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--steel); color: var(--heading); }
.btn.ghost:hover svg { transform: translateX(-3px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.wide { width: 100%; }

/* ---------- hero (tela do código) ---------- */
.hero { position: relative; margin: 0 calc(50% - 50vw); padding: 56px max(24px, calc(50vw - 416px)) 120px; background: var(--ink); color: #fff; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; width: 180px; height: 180px; background: var(--red); clip-path: polygon(0 0, 100% 0, 0 100%); opacity: .95; animation: corner .9s var(--ease) both; }
.hero::after { content: ''; position: absolute; right: -80px; bottom: -120px; width: 380px; height: 380px; border: 1px solid #ffffff12; transform: rotate(45deg); }
.hero > * { position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--red); margin-bottom: 16px; }
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; }
.hero .eyebrow { color: #c7c3cd; }
.hero .eyebrow::before { background: var(--red); }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 6.5vw, 3.6rem); letter-spacing: 1.5px; margin-bottom: 18px; }
.hero .lead { max-width: 540px; color: #c7c3cd; font-size: 1.05rem; font-weight: 300; }

.access { position: relative; margin: -76px 0 0; background: var(--card); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(43, 42, 47, .14); padding: clamp(22px, 4vw, 36px); border-top: 3px solid var(--red); }
.access h2 { font-size: 1.35rem; margin-bottom: 6px; }
.access form { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.code-input { flex: 1 1 260px; min-width: 0; font: 900 1.7rem/1 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 6px; text-align: center; text-transform: uppercase; padding: 16px; border: 2px solid var(--line-2); border-radius: var(--radius); color: var(--heading); background: #faf9fb; transition: border-color .2s, box-shadow .2s, background .2s; }
.code-input::placeholder { color: #cfccd4; }
.code-input:focus { outline: none; border-color: var(--heading); background: #fff; box-shadow: 0 0 0 4px #4240441a; }
.code-input.ok { border-color: var(--heading); }
.access .btn { flex: 0 0 auto; min-width: 150px; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.trust div { display: flex; gap: 12px; align-items: flex-start; font-size: .86rem; line-height: 1.45; color: var(--muted); }
.trust svg { flex: 0 0 auto; width: 34px; height: 34px; padding: 8px; color: var(--red); background: var(--red-soft); border-radius: var(--radius); stroke-width: 2; }
.trust b { display: block; color: var(--heading); font-size: .9rem; margin-bottom: 2px; }

.error { display: flex; gap: 10px; align-items: center; color: var(--red-dark); background: var(--red-soft); border-left: 3px solid var(--red); padding: 11px 14px; font-size: .92rem; width: 100%; animation: shake .4s var(--ease); }

/* ---------- títulos de página ---------- */
.page-head { padding: 44px 0 8px; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 14px; }
.page-head .lead { color: var(--muted); max-width: 640px; font-size: 1.04rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3.6vw, 30px); margin: 16px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 1.2rem; margin-bottom: 16px; }

/* ---------- introdução ---------- */
.glossary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.glossary div { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: var(--radius); padding: 18px 20px; font-size: .94rem; }
.glossary b { display: block; color: var(--heading); font-weight: 900; margin-bottom: 4px; }
.scale-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.scale-legend div { text-align: center; font-size: .8rem; line-height: 1.35; color: var(--muted); }
.scale-legend svg { width: 40px; height: 40px; margin: 0 auto 8px; color: var(--steel); stroke-width: 1.6; }
.scale-legend b { display: block; color: var(--heading); font-size: .88rem; margin-bottom: 2px; }
.extras-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line-2); font-size: .86rem; color: var(--muted); }
.extras-legend b { color: var(--heading); }
.parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; counter-reset: part; }
.parts li { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .94rem; color: var(--heading); }
.parts li::before { counter-increment: part; content: counter(part, decimal-leading-zero); font-weight: 900; color: var(--red); font-size: .8rem; letter-spacing: 1px; }
.parts li span { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.notice { display: flex; gap: 12px; align-items: flex-start; background: #fff8e6; border: 1px solid #f3dfa6; color: #6b5413; border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; margin: 16px 0; }
.notice svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; }

/* ---------- progresso ---------- */
.progress-head { position: sticky; top: 0; z-index: 8; margin: 0 -24px; padding: 14px 24px 12px; background: rgba(243, 242, 244, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.progress-head.stuck { border-bottom-color: var(--line); }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.steps button { height: 6px; padding: 0; border: 0; border-radius: 1px; background: var(--line-2); cursor: pointer; position: relative; overflow: hidden; }
.steps button:disabled { cursor: default; }
.steps button i { position: absolute; inset: 0; background: var(--heading); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .5s var(--ease); }
.steps button.current i { background: var(--red); }
.steps button:not(:disabled):hover { background: #c3c0c8; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: .76rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.progress-meta b { color: var(--heading); }

/* ---------- capa da seção ---------- */
.sec-head { display: flex; align-items: flex-end; gap: 20px; padding: 30px 0 10px; }
.sec-num { font-size: clamp(3.6rem, 11vw, 5.4rem); font-weight: 900; line-height: .8; color: transparent; -webkit-text-stroke: 1.5px var(--red); letter-spacing: -2px; flex: 0 0 auto; }
.sec-head .eyebrow { margin-bottom: 8px; }
.sec-head h1 { font-size: clamp(1.55rem, 4.4vw, 2.2rem); }
.sec-notes { color: var(--muted); margin: 14px 0 4px; max-width: 680px; }

/* ---------- perguntas ---------- */
.q { position: relative; scroll-margin-top: 110px; transition: border-color .25s, box-shadow .25s; }
.q::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--red); border-radius: var(--radius) 0 0 var(--radius); transform: scaleY(0); transform-origin: top; transition: transform .35s var(--ease); }
.q.done::before { transform: scaleY(1); }
.q-head { display: flex; gap: 14px; align-items: flex-start; }
.q-num { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); color: var(--steel); font-weight: 900; font-size: .82rem; transition: background .25s, color .25s; position: relative; }
.q-num svg { width: 16px; height: 16px; stroke-width: 3; position: absolute; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s var(--ease); }
.q.done .q-num { background: var(--heading); color: transparent; }
.q.done .q-num svg { opacity: 1; transform: none; color: #fff; }
.q-title { font-size: 1.04rem; font-weight: 700; color: var(--heading); line-height: 1.5; padding-top: 4px; }
.q-opt { font-weight: 400; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.q-ex { font-size: .88rem; color: var(--muted); margin: 8px 0 0; }
.q-ex em { font-style: normal; font-weight: 700; color: var(--steel); }
.q-note { font-size: .86rem; color: var(--muted); font-style: italic; margin: 6px 0 0; }
.q-body { margin-left: 48px; }
.q-hint { display: none; color: var(--red-dark); font-size: .84rem; font-weight: 700; margin-top: 12px; }
.q.missing { border-color: var(--red-line); box-shadow: 0 0 0 4px var(--red-soft); animation: shake .45s var(--ease); }
.q.missing .q-hint { display: block; }

/* likert */
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 20px; }
.opt { font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease), box-shadow .2s; }
.opt:hover { border-color: var(--steel); }
.opt:active { transform: scale(.96); }
.likert .opt { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 14px 4px 12px; font-size: .8rem; font-weight: 700; line-height: 1.2; color: var(--steel); min-height: 92px; }
.likert .opt svg { width: 32px; height: 32px; stroke-width: 1.6; transition: transform .3s var(--ease); }
.likert .opt:hover svg { transform: translateY(-2px); }
.opt.sel { background: var(--heading); border-color: var(--heading); color: #fff; box-shadow: 0 6px 16px rgba(66, 64, 68, .25); }
.likert .opt.sel { background: var(--red); border-color: var(--red); box-shadow: 0 6px 16px rgba(227, 5, 20, .25); }
.likert .opt.sel svg { animation: pop .4s var(--ease); }
.extras { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.extras .or { font-size: .78rem; color: var(--muted); margin-right: 2px; }
.extras .opt { padding: 8px 13px; font-size: .82rem; color: var(--muted); border-style: dashed; }
.extras .opt.sel { border-style: solid; color: #fff; }

/* nps */
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; margin: 20px 0 10px; }
.nps .opt { padding: 13px 0; font-weight: 900; font-size: .98rem; color: var(--heading); position: relative; }
.nps .opt::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: 5px; height: 2px; border-radius: 2px; background: var(--c); opacity: .7; }
.nps .opt.sel { background: var(--red); border-color: var(--red); box-shadow: 0 6px 16px rgba(227, 5, 20, .25); }
.nps .opt.sel::after { background: #fff; }
.nps-labels { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; color: var(--muted); }

/* múltipla escolha */
.opts { display: grid; gap: 8px; margin-top: 18px; }
.opts .opt { display: flex; align-items: center; gap: 14px; text-align: left; padding: 13px 16px; font-size: .95rem; line-height: 1.4; }
.opts .opt .dot { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; transition: border-color .2s, background .2s; }
.opts .opt .dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform .25s var(--ease); }
.opts .opt.sel { background: var(--red-soft); color: var(--heading); border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.opts .opt.sel .dot { border-color: var(--red); background: #fff; }
.opts .opt.sel .dot::after { transform: scale(1); }

/* texto */
textarea { display: block; width: 100%; min-height: 150px; margin-top: 18px; resize: vertical; font: inherit; font-size: .98rem; color: var(--text); background: #faf9fb; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; transition: border-color .2s, box-shadow .2s, background .2s; }
textarea:focus { outline: none; border-color: var(--heading); background: #fff; box-shadow: 0 0 0 4px #4240441a; }
.counter { text-align: right; font-size: .76rem; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- navegação ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); animation: rise .45s var(--ease) both; }
.nav-inner { max-width: 832px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.nav-count { font-size: .8rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.nav-count b { color: var(--heading); }
.nav .btn { min-width: 132px; }

/* ---------- final ---------- */
.thanks { text-align: center; padding: 72px 0 40px; }
.check { width: 96px; height: 96px; margin: 0 auto 28px; }
.check circle { stroke: var(--red); stroke-width: 2.5; stroke-dasharray: 290; stroke-dashoffset: 290; animation: draw .8s var(--ease) .1s forwards; }
.check path { stroke: var(--heading); stroke-width: 4; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .45s var(--ease) .75s forwards; }
.thanks h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin-bottom: 14px; }
.thanks .lead { color: var(--muted); max-width: 480px; margin: 0 auto 10px; font-size: 1.05rem; }
.thanks .card { max-width: 480px; margin: 28px auto 0; text-align: left; display: flex; gap: 14px; align-items: flex-start; font-size: .92rem; }
.thanks .card svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--red); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 20; max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 13px 18px; border-left: 3px solid var(--red); border-radius: var(--radius); font-size: .9rem; box-shadow: 0 14px 34px rgba(0, 0, 0, .22); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .25s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- animações ---------- */
.enter > * { animation: fadeUp .55s var(--ease) both; animation-delay: calc(min(var(--i, 0), 8) * 55ms); }
.app.leave { animation: fadeOut .18s ease forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes corner { from { clip-path: polygon(0 0, 0 0, 0 0); } }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* ---------- celular ---------- */
@media (max-width: 640px) {
  .topbar-inner, .app { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { height: 54px; gap: 12px; }
  .logo img { height: 28px; }
  .topbar-title { font-size: .66rem; letter-spacing: 1.5px; padding-left: 12px; }
  .topbar-badge { font-size: 0; }
  .topbar-badge svg { width: 18px; height: 18px; }
  .progress-head { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 44px; padding-bottom: 110px; }
  .hero::before { width: 110px; height: 110px; }
  .access .btn { width: 100%; }
  .trust, .glossary, .parts { grid-template-columns: 1fr; }
  .scale-legend { gap: 4px; }
  .scale-legend div { font-size: .7rem; }
  .scale-legend svg { width: 32px; height: 32px; }
  .scale-legend b { font-size: .76rem; }
  .card { padding: 18px 16px; margin: 12px 0; }
  .q-head { gap: 11px; }
  .q-num { width: 30px; height: 30px; font-size: .76rem; }
  .q-title { font-size: .98rem; padding-top: 3px; }
  .q-body { margin-left: 0; }
  .likert { gap: 4px; }
  .likert .opt { font-size: .66rem; min-height: 80px; padding: 11px 2px 9px; gap: 7px; }
  .likert .opt svg { width: 28px; height: 28px; }
  .nps { grid-template-columns: repeat(6, 1fr); }
  .sec-head { gap: 14px; padding-top: 22px; }
  .nav { padding-left: 16px; padding-right: 16px; }
  .nav .btn { min-width: 0; padding: 13px 16px; }
  .nav-count { font-size: .72rem; }
  .toast { bottom: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .check circle, .check path { stroke-dashoffset: 0; }
}

/* apagar progresso (aparelho compartilhado) */
.forget { text-align: center; margin: 28px 0 0; }
.forget button { font: inherit; font-size: .82rem; color: var(--muted); background: none; border: 0; padding: 6px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.forget button:hover { color: var(--red-dark); }
