/* Giga Dados — estilo base (formulário e painel). Tema claro: o disco é sempre preto e branco. */
:root {
  color-scheme: light;
  --paper: #f4f3ef;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #4a4a47;
  --ink-3: #8a8983;
  --line: #d9d7d0;
  --line-strong: #111111;
  --accent: #111111;
  --ok: #1d7a46;
  --warn: #9a5b00;
  --danger: #b3261e;
  --radius: 14px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Cabeçalho ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 600px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--ink);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 6px;
}
.brand-mark i { background: #fff; border-radius: 1px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4), .brand-mark i:nth-child(9) { opacity: .35; }
.brand-name { font-weight: 800; letter-spacing: .08em; font-size: 14px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--ink-2); letter-spacing: .02em; }
.topbar .spacer { flex: 1; }

.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis;
}
.chip.needs { border-color: var(--warn); color: var(--warn); }

.progress { max-width: 600px; margin: 0 auto; padding: 0 16px 12px; display: flex; gap: 6px; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .2s; }
.progress span.on { background: var(--ink); }

/* ---------- Estrutura ---------- */
main { max-width: 600px; margin: 0 auto; padding: 20px 16px 40px; }
.screen { animation: in .22s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
  margin: 0 0 6px;
}
h1.q { font-size: clamp(21px, 5.4vw, 26px); line-height: 1.22; margin: 0 0 10px; font-weight: 700; letter-spacing: -.01em; }
.instr {
  font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line);
  border-radius: 10px; padding: 8px 12px; margin: 0 0 16px;
}
.instr b { letter-spacing: .06em; font-size: 11px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; }
.field + .field, .field + #perfil-resto { margin-top: 20px; }
.label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.err { font-size: 13px; color: var(--danger); margin-top: 6px; min-height: 0; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg button {
  height: 56px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.seg button .box {
  width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 5px; display: grid; place-items: center;
}
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg button[aria-checked="true"] .box::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

.input, .select {
  width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 0 14px; font-size: 17px; outline: none; appearance: none; -webkit-appearance: none;
}
.input:focus, .select:focus { border-color: var(--ink); }
.input.bad, .select.bad { border-color: var(--danger); }
.select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat;
  padding-right: 36px;
}
/* Lista com busca (bairro) */
.combo { position: relative; }
.combo .input { padding-right: 44px; }
.combo.bad .input { border-color: var(--danger); }
.combo-clear {
  position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border: 0; background: none;
  font-size: 24px; line-height: 1; color: var(--ink-2); cursor: pointer; border-radius: 8px;
}
.combo-list {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  max-height: min(320px, 50vh); overflow-y: auto; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14); overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
.combo-list [role=option] {
  padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 16px;
}
.combo-list [role=option] small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.combo-list [role=option].active, .combo-list [role=option]:hover { background: #efeee9; }
.combo-list [role=option][aria-selected="true"] { font-weight: 700; }
.combo-group {
  padding: 10px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  position: sticky; top: -4px; background: var(--surface);
}
.combo-empty { padding: 12px 14px; color: var(--ink-2); font-size: 14px; }

.age { display: flex; align-items: center; gap: 10px; }
.age .input { width: 110px; text-align: center; font-weight: 700; font-size: 20px; }
.age span { color: var(--ink-2); }

.notice {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff7e8; border: 1px solid #f0d49c;
  color: #5d3a00; font-size: 14px;
}

/* ---------- Ações ---------- */
.actions { display: flex; gap: 10px; margin-top: 22px; }
.btn {
  height: 56px; border-radius: 12px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 700; font-size: 17px; padding: 0 22px; cursor: pointer; flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.ghost { background: transparent; color: var(--ink); flex: 0 0 auto; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.small { height: 40px; font-size: 14px; padding: 0 14px; flex: 0 0 auto; border-radius: 10px; }

/* ---------- Disco estimulado ---------- */
.disc-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.disc { display: block; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.disc .slice path { fill: #fff; stroke: #000; stroke-width: 1.6; cursor: pointer; transition: fill .12s; }
.disc .slice text { fill: #000; pointer-events: none; font-family: "Archivo", "Arial Narrow", Arial, sans-serif; font-stretch: 82%; }
.disc .slice .nm { font-weight: 700; }
.disc .slice .pt { font-weight: 400; }
.disc .slice[aria-checked="true"] path { fill: #000; }
.disc .slice[aria-checked="true"] text { fill: #fff; }
.disc .slice:focus { outline: none; }
.disc .slice:focus-visible path { stroke-width: 4; }
.disc .rim { fill: none; stroke: #000; stroke-width: 2.4; }
.disc .hub { fill: #fff; stroke: #000; stroke-width: 1.6; }

.extras { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.extras button {
  min-height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 14px; line-height: 1.15; padding: 6px 8px; cursor: pointer;
}
.extras button[aria-checked="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.extras.one { grid-template-columns: 1fr; margin-top: 10px; }
.pergunta + .pergunta { margin-top: 28px; padding-top: 24px; border-top: 2px solid var(--ink); }
.qnum { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.input.area { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.35; font-family: inherit; }
.input.area:disabled { background: #efeee9; color: var(--ink-3); }
.picked { margin-top: 12px; font-size: 14px; color: var(--ink-2); min-height: 20px; text-align: center; }
.picked b { color: var(--ink); }

/* ---------- Fim ---------- */
.done { text-align: center; padding: 36px 8px 8px; }
.done .mark {
  width: 76px; height: 76px; border-radius: 50%; border: 2px solid var(--ink); margin: 0 auto 18px;
  display: grid; place-items: center;
}
.done h1 { font-size: 26px; margin: 0 0 8px; }
.done p { color: var(--ink-2); margin: 0 auto 6px; max-width: 420px; }
.sync { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 26px; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync.pend::before { background: var(--warn); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h2 { margin: 0 0 12px; font-size: 18px; }

footer.foot { max-width: 600px; margin: 0 auto; padding: 0 16px 28px; font-size: 12px; color: var(--ink-3); text-align: center; }

@media (max-width: 340px) {
  .extras { grid-template-columns: 1fr; }
  .extras button { min-height: 46px; }
}
