/* Identidade: vitral e dourado da série "Servir" (PIB Curitiba); escala em círculos, no estilo dos testes de perfil. */
:root {
  --bg: #faf6ec;
  --card: #ffffff;
  --ink: #2a1c0d;
  --muted: #6a5d4a;
  --line: #e7dcc3;
  --gold: #d3ac27;
  --gold-deep: #7a5a08;
  --gold-soft: #f6ecc8;
  --on-gold: #2a1c0d;
  --focus: #2a1c0d;
  --warn: #a8261e;
  --warn-bg: #fdeceb;
  --cat0: #9b2c3a;
  --cat1: #2f5d8a;
  --cat2: #7a4aa0;
  --cat3: #2f7d5b;
  --topo: 56px;
  --raio: 18px;
  --sombra: 0 1px 2px rgba(42, 28, 13, .06), 0 8px 24px rgba(42, 28, 13, .07);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120b; --card: #221a10; --ink: #f6efe0; --muted: #b8aa90; --line: #3a2e1d;
    --gold: #e0b73a; --gold-deep: #e8c660; --gold-soft: #3a2f12; --on-gold: #1b1307; --focus: #f6efe0;
    --warn: #ff9a92; --warn-bg: #3a1f1d;
    --cat0: #e58a96; --cat1: #8fb6e6; --cat2: #bf9ae0; --cat3: #7fcba6;
    --sombra: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { line-height: 1.12; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6vw, 44px); font-weight: 800; margin: 0 0 12px; }
h2 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.peq { font-size: 14px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; color: var(--gold-deep); margin: 0 0 8px; }

/* topo */
.topo { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); transform: translateZ(0); }
.topo-in { max-width: 760px; margin: 0 auto; padding: 0 16px; min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; }
.marca i { width: 28px; height: 28px; border-radius: 8px; background: var(--gold); position: relative; flex: none; }
.marca i::before, .marca i::after { content: ""; position: absolute; background: var(--on-gold); border-radius: 2px; }
.marca i::before { left: 12.5px; top: 6px; width: 3px; height: 16px; }
.marca i::after { left: 7px; top: 11px; width: 14px; height: 3px; }
.status { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.barra { height: 4px; background: var(--line); }
.barra > div { height: 100%; width: 0; background: var(--gold); border-radius: 0 4px 4px 0; transition: width .3s ease; }

.app { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.app.com-barra { padding-bottom: 120px; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  appearance: none; border: 2px solid transparent; border-radius: 999px; padding: 0 28px; min-height: 52px;
  font: inherit; font-weight: 700; letter-spacing: .01em; cursor: pointer;
  background: var(--gold); color: var(--on-gold); box-shadow: 0 2px 0 rgba(42, 28, 13, .18);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover { background: color-mix(in srgb, var(--gold) 86%, #000); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sec { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.sec:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.peq-btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn.grande { min-height: 58px; padding: 0 36px; font-size: 18px; }
.btn:focus-visible, .rank summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.acoes .esp { flex: 1; }

/* abertura */
.hero { position: relative; overflow: hidden; border-radius: var(--raio); padding: 36px 24px 32px; margin-bottom: 20px; background: #211507; color: #fff6dd; }
.hero::before { content: ""; position: absolute; inset: 0; background: url("vitral.svg") center / cover no-repeat; opacity: .7; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(33, 21, 7, .96) 0%, rgba(33, 21, 7, .84) 50%, rgba(33, 21, 7, .45) 100%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #ffffff; }
.hero .eyebrow { color: #f0cf62; }
.hero p { font-size: 18px; max-width: 34em; color: #f3e8c8; }
.hero .btn { background: var(--gold); color: #211507; box-shadow: none; }
.hero .btn:hover { background: #e6c04a; }
.hero .btn.sec { background: transparent; color: #fff6dd; border-color: rgba(255, 246, 221, .45); }
.hero .btn.sec:hover { border-color: #fff6dd; background: rgba(255, 255, 255, .12); }
.hero .btn:focus-visible { outline-color: #fff6dd; }
.passos { display: grid; gap: 12px; margin-bottom: 20px; }
@media (min-width: 640px) { .passos { grid-template-columns: repeat(3, 1fr); } }
.passo { background: var(--card); border-radius: var(--raio); padding: 18px; box-shadow: var(--sombra); box-shadow: var(--sombra), inset 0 4px 0 var(--c, var(--gold)); }
.passo b { display: inline-block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; background: var(--gold-soft); color: var(--gold-deep); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.passo h3 { margin: 0 0 4px; font-size: 18px; }
.passo p { margin: 0; font-size: 15px; color: var(--muted); }
.card { background: var(--card); border-radius: var(--raio); padding: 20px; margin-bottom: 16px; box-shadow: var(--sombra); }
ul.dicas { padding-left: 20px; margin: 0; }
ul.dicas li { margin-bottom: 8px; }
.nota { background: var(--gold-soft); border-radius: 14px; padding: 14px 16px; font-size: 15px; margin-bottom: 16px; }
.nota p:last-child { margin-bottom: 0; }

/* perguntas */
.parte { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.parte b { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-deep); }
.bloco { background: var(--card); border-radius: var(--raio); padding: 18px 20px; margin-bottom: 8px; box-shadow: var(--sombra); border-left: 6px solid var(--gold); }
.bloco .enunc { font-size: 20px; font-weight: 800; margin: 0 0 4px; line-height: 1.25; }
.bloco .dica { margin: 0; font-size: 14px; color: var(--muted); }
.enunc-fixo { position: fixed; left: 0; right: 0; top: var(--topo); z-index: 8; background: var(--bg); padding: 8px max(16px, calc((100% - 760px) / 2 + 16px)); font-weight: 700; font-size: 14px; color: var(--gold-deep); border-bottom: 1px solid var(--line); display: none; opacity: 0; visibility: hidden; transition: opacity .15s ease, visibility .15s; }
.enunc-fixo.mostra { opacity: 1; visibility: visible; }
.perguntas { margin-top: 8px; }
.q { padding: 22px 4px 20px; border-bottom: 1px solid var(--line); border-radius: 6px; transition: opacity .2s ease, background-color .2s ease; }
.q:last-of-type { border-bottom: 0; }
.perguntas.tem-ativa .q:not(.ativa):not(:focus-within) { opacity: .88; }
.q.ativa { background: linear-gradient(90deg, var(--gold-soft), transparent 70%); box-shadow: -4px 0 0 var(--gold); padding-left: 14px; }
.q.falta { background: var(--warn-bg); box-shadow: -4px 0 0 var(--warn); padding-left: 14px; opacity: 1 !important; }
.q .txt { font-size: 19px; font-weight: 650; line-height: 1.4; margin: 0 0 16px; }
.q .num { color: var(--muted); font-weight: 600; font-size: 14px; margin-right: 8px; font-variant-numeric: tabular-nums; }

.escala { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px; min-width: 0; }
.escala legend { position: absolute; left: -9999px; }
.ext { font-size: 13px; color: var(--muted); max-width: 8.5em; line-height: 1.25; }
.ext-hi { text-align: right; justify-self: end; color: var(--gold-deep); font-weight: 700; }
.dots { display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%; max-width: 400px; margin: 0 auto; }
.op { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex: none; }
.op input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.op label { display: block; border-radius: 50%; border: 2.5px solid #b9a67a; background: var(--card); transition: transform .15s ease, background-color .15s ease, border-color .15s ease; pointer-events: none; }
.op.s0 label { width: 22px; height: 22px; }
.op.s1 label { width: 30px; height: 30px; }
.op.s2 label { width: 38px; height: 38px; }
.op.s3 label { width: 46px; height: 46px; }
.op.s4 label { width: 54px; height: 54px; }
.op:hover label { border-color: var(--gold-deep); transform: scale(1.06); }
.op input:checked + label { background: var(--gold); border-color: var(--ink); transform: scale(1.04); box-shadow: 0 0 0 4px var(--gold-soft); }
.op input:checked + label::after { content: ""; display: block; width: 36%; height: 20%; margin: 38% auto 0; border-left: 3px solid var(--on-gold); border-bottom: 3px solid var(--on-gold); transform: rotate(-45deg) translate(1px, -2px); }
.op.s0 input:checked + label::after { width: 40%; height: 18%; margin-top: 30%; border-width: 2.5px; }
.op input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 4px; }
.escolhida { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--gold-deep); min-height: 21px; text-align: center; }
.aviso { color: var(--warn); font-weight: 700; margin: 14px 0 0; text-align: center; }
.topo-esp { margin-top: 16px; }
.res-hero .resumo { margin-top: 12px; }

/* barra inferior fixa */
.barra-inf { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--bg); border-top: 1px solid var(--line); transform: translateZ(0); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.barra-inf-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.barra-inf .prog { flex: 1; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.3; }
.barra-inf .prog b { display: block; color: var(--ink); font-size: 15px; }

/* resultado */
.res-hero { border-radius: var(--raio); padding: 28px 24px; margin-bottom: 18px; background: var(--card); box-shadow: var(--sombra); border-left: 10px solid var(--c); }
.res-hero .pos { color: var(--c); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.res-hero h2 { font-size: clamp(30px, 6vw, 42px); margin: 4px 0 6px; }
.selo { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--c); }
.top3 { display: grid; gap: 12px; margin-bottom: 18px; }
@media (min-width: 700px) { .dom-sec { grid-template-columns: 1fr 1fr; } }
.dom-sec { display: grid; gap: 12px; }
.dom { background: var(--card); border-radius: var(--raio); padding: 18px; box-shadow: var(--sombra); border-left: 6px solid var(--c); }
.dom .pos { color: var(--c); font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.dom h3 { margin: 2px 0 2px; font-size: 21px; }
.dom .pts { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.dom p { font-size: 15px; }
.ref { color: var(--muted); font-size: 14px; margin: 0; }
.legenda-cat { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.legenda-cat li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { border-top: 1px solid var(--line); }
.rank li:first-child { border-top: 0; }
.rank summary { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 32px; gap: 10px; align-items: center; padding: 10px 0; font-size: 15px; cursor: pointer; list-style: none; min-height: 48px; }
.rank summary::-webkit-details-marker { display: none; }
.rank .nm em { color: var(--muted); font-size: 13px; }
.rank .bar { height: 14px; border-radius: 7px; background: color-mix(in srgb, var(--c) 14%, transparent); overflow: hidden; }
.rank .bar i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 7px; transition: width .6s ease; }
.rank .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.rank details p { margin: 0 0 8px; font-size: 15px; }
.rank details .ref { padding-bottom: 8px; }
.toast { color: var(--gold-deep); font-weight: 700; min-height: 24px; margin: 12px 0 0; }
.c0 { --c: var(--cat0); } .c1 { --c: var(--cat1); } .c2 { --c: var(--cat2); } .c3 { --c: var(--cat3); }

.rodape { max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; font-size: 13px; color: var(--muted); }

@media (max-width: 559px) {
  body { font-size: 16px; }
  .app { padding-top: 16px; }
  .hero { padding: 28px 20px 24px; }
  .enunc-fixo { display: block; }
  .escala { grid-template-columns: 1fr 1fr; }
  .dots { grid-column: 1 / -1; grid-row: 1; }
  .ext-lo { grid-row: 2; }
  .ext-hi { grid-row: 2; grid-column: 2; }
  .op { width: 52px; height: 56px; }
  .op.s4 label { width: 50px; height: 50px; }
  .q .txt { font-size: 18px; }
  .rank summary { grid-template-columns: 1fr 32px; }
  .rank .bar { grid-column: 1 / -1; order: 3; }
  .barra-inf .btn { padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .topo, .acoes, .barra-inf, .enunc-fixo { display: none; }
  body { background: #fff; }
  .card, .dom, .res-hero { box-shadow: none; border: 1px solid #ccc; }
  .rank details > p { display: block; }
}
