/* Mobile-first, system fonts only (no external font requests). */
:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #5f6368;
  --line: #e2e0da;
  --accent: #b45309;      /* warm amber; deliberately not the green/red of the Portuguese flag */
  --accent-ink: #ffffff;
  --primary: #174a5c;
  --primary-ink: #ffffff;
  --ok: #1e7d3c;
  --ok-bg: #e6f4ea;
  --bad: #b3261e;
  --bad-bg: #fce8e6;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --card: #1e1e1e;
    --text: #ececec;
    --muted: #a3a3a3;
    --line: #333;
    --primary: #7cc4d8;
    --primary-ink: #0b1a28;
    --ok: #7fd396;
    --ok-bg: #16301f;
    --bad: #f28b82;
    --bad-bg: #3a1d1b;
    --accent: #f0a85a;
    --accent-ink: #1d1d1f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Mangal", sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--primary); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.75rem; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.small { font-size: 0.875rem; }
.muted { color: var(--muted); }

/* top bar */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 56px; gap: 6px 8px; padding-block: 6px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); border-inline-start: 6px solid var(--accent); padding-inline-start: 8px; }
.langs { display: flex; flex-wrap: wrap; gap: 4px; }
.langs button {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  border-radius: 999px; padding: 6px 9px; font: inherit; font-size: 0.85rem; min-height: 40px; min-width: 40px; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* hero */
.hero { padding: 28px 0 20px; }
.kicker { color: var(--accent); font-weight: 700; font-size: 0.9rem; margin: 0; text-transform: uppercase; letter-spacing: 0.04em; }
html:not([lang^="pt"]):not([lang="en"]) .kicker { text-transform: none; letter-spacing: 0; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 1.25rem; }
.cta-row { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; border-radius: 12px; border: 0; cursor: pointer;
  min-height: 48px; padding: 12px 18px; text-align: center;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-secondary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.btn-link { background: transparent; color: var(--primary); text-decoration: underline; font-weight: 500; padding-inline: 4px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn:focus-visible, .option:focus-visible, .langs button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; }
.facts, .checks { padding-inline-start: 1.2rem; margin: 0 0 0.75rem; }
.facts li, .checks li { margin-bottom: 0.4rem; }
.checks { list-style: none; padding-inline-start: 0; }
.checks li { padding-inline-start: 1.6rem; position: relative; }
.checks li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--ok); font-weight: 700; }
.price { font-size: 1.15rem; font-weight: 700; margin: 0.5rem 0 0.75rem; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; }

/* quiz */
.quiz-head { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; }
.bar { height: 6px; background: var(--line); border-radius: 999px; margin: 8px 0 16px; overflow: hidden; }
#q-bar { height: 100%; background: var(--primary); width: 0; transition: width .25s; }
.q-text { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.5rem; }
.q-trans { color: var(--muted); margin: 0 0 0.25rem; }
.options { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: start; font: inherit; color: var(--text);
  background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; min-height: 52px; cursor: pointer; width: 100%;
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.opt-pt { font-weight: 600; }
.opt-tr { color: var(--muted); font-size: 0.92rem; width: 100%; }
.option.is-right { border-color: var(--ok); background: var(--ok-bg); }
.option.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.option:disabled { cursor: default; }
.feedback { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.feedback .btn { width: 100%; margin-top: 4px; }
.verdict { font-weight: 700; margin: 0 0 0.25rem; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

/* result */
.score { font-size: 1.5rem; font-weight: 700; margin: 0; }
.upsell { border-color: var(--accent); }
.upsell .btn, .btn-block { width: 100%; }
.status { border-inline-start: 4px solid var(--accent); }

/* dialog */
dialog {
  border: 0; border-radius: var(--radius); padding: 20px; width: min(520px, calc(100vw - 32px));
  background: var(--card); color: var(--text); max-height: calc(100vh - 32px); overflow: auto;
}
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog label { display: block; font-weight: 600; margin: 12px 0 4px; }
dialog input[type=email], dialog select {
  width: 100%; font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); min-height: 48px;
}
dialog label.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.92rem; }
dialog label.consent input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.error { color: var(--bad); font-weight: 600; }
.dialog-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }

/* footer */
.footer { padding: 24px 0 40px; color: var(--muted); }

@media (min-width: 640px) {
  h1 { font-size: 2.2rem; }
  .hero { padding: 48px 0 28px; }
  .cta-row { flex-direction: row; align-items: center; }
  .dialog-actions { flex-direction: row; }
}
