/* Tema Godina: preto e dourado (o mesmo do godina.com.br). */
:root {
  --bg: #f4f4f2;
  --card: #ffffff;
  --text: #121212;
  --muted: #6b6b6b;
  --line: #e4e2dc;
  --primary: #111111;        /* botões principais */
  --primary-hover: #2c2c2c;
  --on-primary: #ffffff;
  --primary-2: #9a7420;      /* dourado escuro, legível como texto e borda */
  --gold: #d4af37;           /* dourado vivo: barras, seleção */
  --primary-soft: #faf4e4;
  --ok: #15803d;
  --danger: #b91c1c;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --card: #161616;
    --text: #ececec;
    --muted: #a3a3a3;
    --line: #2a2a2a;
    --primary: #d4af37;
    --primary-hover: #e6c35a;
    --on-primary: #111111;
    --primary-2: #d4af37;
    --gold: #d4af37;
    --primary-soft: #2a2414;
    --ok: #4ade80;
    --danger: #f87171;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--primary-2); }
[hidden] { display: none !important; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.topbar { background: #000; color: #fff; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(212, 175, 55, .25); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 10px; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px; flex: none; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-sub { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #d4af37; opacity: .85; }
.timer { font: 700 18px/1 ui-monospace, Consolas, monospace; background: rgba(255,255,255,.14); padding: 8px 12px; border-radius: 8px; }
.timer.warn { background: #b91c1c; }

.screen { padding: 28px 0 40px; }
.card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 24px; border: 1px solid var(--line); }
.narrow { max-width: 520px; margin: 0 auto; }
.center { text-align: center; }

.hero { text-align: center; margin: 12px 0 28px; }
.hero h1 { font-size: clamp(28px, 6vw, 42px); margin: 0 0 8px; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 18px; margin: 0 auto 24px; max-width: 520px; }
.facts { list-style: none; padding: 0; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 640px; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; display: flex; flex-direction: column; }
.facts b { font-size: 22px; color: var(--primary-2); }
.facts span { font-size: 13px; color: var(--muted); line-height: 1.3; }
@media (max-width: 560px) { .facts { grid-template-columns: repeat(2, 1fr); } }

.form { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.form h2 { margin: 0; }
.form p { margin: 0; }
label { font-weight: 600; }
input[type=email], .code-input {
  font: inherit; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--text); width: 100%;
}
input:focus { outline: 2px solid var(--primary-2); outline-offset: 1px; }
.code-input { font-size: 30px; letter-spacing: 10px; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.check { font-weight: 400; font-size: 14px; color: var(--muted); }
.check input { margin: 0 6px 0 0; vertical-align: -2px; }
.msg { min-height: 1.2em; color: var(--danger); font-size: 14px; }
.msg.ok { color: var(--ok); }
.small { font-size: 13px; color: var(--muted); }

.btn {
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1; padding: 13px 18px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--primary-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.finish { border-color: var(--primary-2); color: var(--primary-2); }

.rules { padding-left: 20px; margin: 12px 0 20px; }
.rules li { margin-bottom: 8px; }

.test-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.area { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-2); }
.count { font-size: 14px; color: var(--muted); }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress div { height: 100%; background: var(--gold); width: 0; transition: width .2s; }

.question { padding: 22px; }
.prompt { white-space: pre-line; font-size: 17px; margin: 0 0 16px; }
.seq { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.seq span {
  min-width: 48px; padding: 10px 12px; text-align: center; border-radius: 10px; background: var(--primary-soft);
  font: 700 20px/1 ui-monospace, Consolas, monospace; color: var(--text);
}
.seq span.q { background: transparent; border: 2px dashed var(--muted); color: var(--muted); }
.visual { display: flex; justify-content: center; margin-bottom: 18px; }
.visual:empty { display: none; }
.visual svg { width: 100%; max-width: 300px; height: auto; border-radius: 8px; background: #fff; }

.options { display: grid; gap: 10px; }
.options.text { grid-template-columns: 1fr; }
.options.svg { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
/* Tablet e notebook: alternativas com figura maiores, para comparar com a figura da questão. */
@media (min-width: 640px) {
  .options.svg { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
  .visual svg { max-width: 380px; }
}
.visual.spatial svg { max-width: 210px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card);
  color: var(--text); font: inherit; cursor: pointer; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: var(--primary-2); }
.opt .letter {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: var(--bg); color: var(--muted);
}
.opt.sel { border-color: var(--primary-2); background: var(--primary-soft); }
.opt.sel .letter { background: var(--gold); color: #111; }
.options.svg .opt { flex-direction: column; padding: 10px; gap: 8px; }
.options.svg .opt svg { width: 100%; height: auto; border-radius: 6px; background: #fff; }
.options.text .opt .val { font-size: 16px; }

.test-nav { display: flex; justify-content: space-between; gap: 10px; margin: 16px 0; }
.test-nav .btn { flex: 1; max-width: 220px; }
.palette-wrap { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.palette button {
  width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.palette button.done { background: var(--primary-soft); color: var(--text); border-color: var(--primary-2); }
.palette button.cur { outline: 2px solid var(--primary-2); outline-offset: 1px; }

.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-email {
  font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
  padding-left: 20px; position: relative;
}
.user-email::before { content: "✉"; position: absolute; left: 0; }
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .brand-logo { height: 34px; }
  .user-email { max-width: 34vw; }
}

.result h2 { margin-top: 0; }
.result h3 { font-size: 16px; margin: 22px 0 10px; }
.iq-box { background: var(--primary-soft); border-radius: 12px; padding: 20px; text-align: center; }
.iq-label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.iq { font-size: 64px; font-weight: 800; line-height: 1.1; color: var(--primary-2); }
.iq-class { font-size: 18px; font-weight: 700; }
.iq-pct { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stats div { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-size: 20px; }
.stats span { font-size: 13px; color: var(--muted); }
.areas .row { margin-bottom: 10px; }
.areas .top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 4px; }
.areas .bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.areas .bar div { height: 100%; background: var(--gold); border-radius: 4px; }
.sent { margin: 20px 0 6px; color: var(--ok); font-size: 15px; }

dialog { border: none; border-radius: 14px; padding: 22px; max-width: 420px; width: calc(100% - 32px); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 23, 42, .55); }
dialog h3 { margin: 0 0 8px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding-bottom: 28px; }

.prose h1 { font-size: 28px; }
.prose h2 { font-size: 19px; margin-top: 24px; }
