/* Autenticação Documental por QR Code — ASFPM
   Identidade institucional: verde #1b3120 e ouro #e9ba5a (Design Brief, secção 3), Raleway.
   Telemóvel primeiro; medidas em rem, para respeitar o tamanho de letra escolhido no navegador. */

@font-face { font-family: "Raleway"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/raleway-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/raleway-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Raleway"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/raleway-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Raleway"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/raleway-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --g-950: #0b1a11; --g-900: #12261a; --g-800: #1b3120; --g-700: #24432d; --g-600: #2d583c;
  --g-100: #e4ede6; --g-50: #f1f5f2;
  --gold: #e9ba5a; --gold-600: #c9982f; --gold-800: #6f520f; --gold-50: #fbf5e5;
  --ink: #16201a; --ink-2: #36403a; --muted: #57615a; --line: #d2d7d3; --line-2: #8f9991;
  --bg: #ffffff; --bg-2: #f3f4f2; --bg-3: #e9ece9;
  --ok: #17663a; --ok-bg: #e4f1e8; --bad: #a3241a; --bad-bg: #fbe8e6; --warn: #845600; --warn-bg: #fdf2d8;
  --info: #1d4f86; --info-bg: #e4ecf7; --neutral: #4b544d; --neutral-bg: #eceeec;
  --r: 3px;
  --wrap: 73.75rem;
  --gutter: 1rem;
}
@media (min-width: 48em) { :root { --gutter: 1.5rem; } }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Raleway, "Segoe UI", system-ui, sans-serif;
  font-weight: 500; font-size: 1rem; line-height: 1.6; font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
  display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
a { color: var(--g-600); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--g-800); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 0; box-shadow: 0 0 0 5px var(--g-900); }
a:focus-visible { background: var(--gold); color: var(--g-950); box-shadow: 0 3px 0 var(--g-950); outline: none; text-decoration: none; }
h1, h2, h3 { font-weight: 800; color: var(--g-800); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.005em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h2 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li + li { margin-top: .25em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); color: var(--ink-2); max-width: 46em; }
code, .code { font-family: inherit; font-weight: 700; letter-spacing: .03em; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85em; letter-spacing: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--gutter); top: .5rem; z-index: 50; background: var(--gold); color: var(--g-950); padding: .5rem 1rem; font-weight: 700; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------------------------------------------------------- cabeçalho */
.masthead { background: var(--bg); border-bottom: 1px solid var(--line); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; padding-top: .6rem; padding-bottom: .6rem; }
.logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--g-800); flex: none; }
.logo img.full { height: 3.9rem; width: auto; display: none; }
.logo img.mini { height: 2.6rem; width: 2.6rem; }
.logo .mini-name { font-weight: 800; font-size: 1.05rem; letter-spacing: .06em; line-height: 1.05; }
.logo .mini-name small { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); max-width: 13rem; line-height: 1.25; }
@media (min-width: 52em) { .logo img.full { display: block; } .logo img.mini, .logo .mini-name { display: none; } }
.service { text-align: right; border-left: 3px solid var(--gold); padding-left: .85rem; line-height: 1.2; }
.service .k { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.service .n { display: block; font-size: 1.05rem; font-weight: 800; color: var(--g-800); }
@media (max-width: 36em) { .masthead .service { display: none; } }
.userbox { text-align: right; font-size: .85rem; line-height: 1.35; }
.userbox strong { display: block; color: var(--g-800); font-size: .95rem; }
.userbox .links { margin-top: .2rem; display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 40em) { .userbox .meta { display: none; } }
.role { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: .12rem .5rem; border-radius: 2px; margin-bottom: .25rem; }
.role-admin { background: var(--gold); color: var(--g-950); }
.role-staff { background: var(--g-800); color: #fff; }
.area-label { display: flex; align-items: center; padding-right: 1.25rem; margin-right: .5rem; border-right: 1px solid rgba(255,255,255,.2); color: var(--gold); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.is-admin .mainnav { background: var(--g-950); }
.is-admin .mainnav a:hover { background: var(--g-800); }
.is-admin .mainnav a[aria-current="page"] { background: var(--g-800); }
@media (max-width: 54em) { .area-label { border: 0; padding: .7rem 0 0; margin: 0; } }

/* navegação principal */
.mainnav { background: var(--g-800); border-bottom: 4px solid var(--gold); }
.mainnav .wrap { display: flex; align-items: stretch; }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.mainnav li { margin: 0; }
.mainnav a { display: flex; align-items: center; min-height: 3rem; padding: 0 1rem; color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem; border-bottom: 4px solid transparent; margin-bottom: -4px; }
.mainnav a:hover { background: var(--g-700); color: #fff; }
.mainnav a[aria-current="page"] { border-bottom-color: #fff; background: var(--g-900); }
.mainnav a:focus-visible { background: var(--gold); color: var(--g-950); box-shadow: none; }
.navtoggle { display: none; align-items: center; gap: .5rem; background: none; border: 0; color: #fff; font: 700 .95rem Raleway, sans-serif; min-height: 3rem; padding: 0; cursor: pointer; }
.navtoggle svg { width: 1.25rem; height: 1.25rem; }
@media (max-width: 54em) {
  .js .navtoggle { display: inline-flex; }
  .js .mainnav ul { display: none; }
  .js .mainnav.open ul { display: block; }
  .mainnav .wrap { flex-direction: column; }
  .mainnav ul { flex-direction: column; padding-bottom: .5rem; }
  .mainnav a { min-height: 2.75rem; padding: 0 .25rem; border-bottom: 0; margin: 0; border-left: 4px solid transparent; padding-left: .75rem; }
  .mainnav a[aria-current="page"] { border-left-color: var(--gold); }
}

/* ---------------------------------------------------------------- cabeçalho de página */
.pagehead { background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 1.5rem 0 1.4rem; }
.pagehead h1 { margin-bottom: .35rem; }
.pagehead .lead { margin: 0; }
.pagehead .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; }
.crumbs { font-size: .875rem; margin: 0 0 .6rem; color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: .3rem; color: var(--line-2); }
.crumbs a { color: var(--ink-2); }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-800); margin-bottom: .4rem; }

.main { padding-top: 1.75rem; padding-bottom: 3rem; }
.section { padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section > h2, .section-title { display: flex; align-items: center; gap: .6rem; }
.section-title::before, .section > h2::before { content: ""; width: .35rem; height: 1.3em; background: var(--gold); flex: none; }

/* grelhas */
.grid { display: grid; gap: 1.25rem; }
.cols-2, .cols-3, .cols-4, .split, .split-r { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40em) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 52em) {
  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); gap: 2rem; }
  .split-r { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2rem; }
}
.stack > * + * { margin-top: 1.25rem; }
@media (max-width: 51.99em) { .only-desktop { display: none !important; } }
@media (min-width: 52em) { .only-mobile { display: none !important; } }
.sticky { position: sticky; top: 1rem; }

/* ---------------------------------------------------------------- painéis */
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); }
.panel > .ph { padding: .85rem 1.15rem; border-bottom: 1px solid var(--line); background: var(--bg-2); display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.panel > .ph h2, .panel > .ph h3 { margin: 0; font-size: 1.05rem; }
.panel > .pb { padding: 1.1rem 1.15rem; }
.panel > .pb > :last-child { margin-bottom: 0; }
.panel.accent { border-top: 4px solid var(--g-800); }
.panel.gold { border-top: 4px solid var(--gold); }
.panel.help { background: var(--g-50); border-color: var(--g-100); }
.panel.help > .ph { background: transparent; border-color: var(--g-100); }
.empty { color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 3rem; padding: .55rem 1.25rem;
  border-radius: var(--r); font: 700 1rem/1.2 Raleway, sans-serif; text-decoration: none; cursor: pointer; border: 2px solid transparent;
  text-align: center; }
.btn svg { width: 1.3rem; height: 1.3rem; flex: none; }
.btn-primary { background: var(--g-800); color: #fff; box-shadow: 0 2px 0 var(--g-950); }
.btn-primary:hover { background: var(--g-700); color: #fff; }
.btn-secondary { background: #fff; color: var(--g-800); border-color: var(--g-800); }
.btn-secondary:hover { background: var(--g-50); color: var(--g-800); }
.btn-quiet { background: var(--bg-2); color: var(--g-800); border-color: var(--line); }
.btn-quiet:hover { background: var(--bg-3); color: var(--g-800); }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-danger.solid { background: var(--bad); color: #fff; box-shadow: 0 2px 0 #5e140e; }
.btn-gold { background: var(--gold); color: var(--g-950); box-shadow: 0 2px 0 var(--gold-800); }
.btn-gold:hover { background: #f0c96f; color: var(--g-950); }
.btn-sm { min-height: 2.35rem; padding: .3rem .8rem; font-size: .9rem; border-width: 1.5px; }
.btn-lg { min-height: 3.6rem; font-size: 1.08rem; padding: .7rem 1.5rem; }
.btn-block { width: 100%; }
.btn:focus-visible { outline: 3px solid var(--gold); box-shadow: 0 0 0 5px var(--g-950); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
@media (max-width: 30em) { .actions.fill > .btn { flex: 1 1 100%; } }

/* ---------------------------------------------------------------- etiquetas de estado */
.tag { display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .5rem; border-radius: 2px; font-size: .74rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border: 1px solid currentColor; line-height: 1.5; vertical-align: middle; }
.tag::before { content: ""; width: .45rem; height: .45rem; background: currentColor; border-radius: 1px; }
.t-ok { color: var(--ok); background: var(--ok-bg); } .t-bad { color: var(--bad); background: var(--bad-bg); }
.t-warn { color: var(--warn); background: var(--warn-bg); } .t-info { color: var(--info); background: var(--info-bg); }
.t-muted { color: var(--neutral); background: var(--neutral-bg); }

/* avisos */
.notice, .banner { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-left: 5px solid currentColor; margin: 0 0 1.25rem; font-weight: 600; border-radius: 0 var(--r) var(--r) 0; }
.notice > span, .banner > span { color: var(--ink); }
.notice svg, .banner svg { width: 1.3rem; height: 1.3rem; flex: none; margin-top: .1rem; }

/* ---------------------------------------------------------------- tabelas */
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 800;
  padding: .6rem .75rem; background: var(--bg-2); border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: #fafbfa; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a strong { color: var(--g-800); }
.scroll { overflow-x: auto; }
@media (max-width: 47.99em) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { border: 0; padding: .2rem 1rem; display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .75rem; }
  .table.stack td::before { content: attr(data-label); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: .2rem; }
  .table.stack td[data-label=""]::before { content: none; }
  .table.stack td[data-label=""] { display: block; }
  .table.stack td > .tag, .table.stack td > .btn { justify-self: start; }
}

/* lista de dados (registo) */
.register { width: 100%; border-collapse: collapse; margin: 0; }
.register th, .register td { text-align: left; padding: .7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.register th { width: 38%; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-right: 1rem; padding-top: .85rem; }
.register td { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.register tr:last-child th, .register tr:last-child td { border-bottom: 0; }
@media (max-width: 30em) { .register th, .register td { display: block; width: 100%; padding: .1rem 0; border: 0; } .register tr { display: block; padding: .55rem 0; border-bottom: 1px solid var(--line); } .register th { padding-top: 0; } }
.kv { display: grid; grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr); gap: .45rem 1.25rem; margin: 0; font-size: .95rem; }
.kv dt { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding-top: .2rem; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 30em) { .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .55rem; } }

/* ---------------------------------------------------------------- formulários */
.form-section { border: 0; padding: 0; margin: 0 0 1.75rem; counter-increment: secao; min-width: 0; }
.form-section > legend { font-size: 1.1rem; font-weight: 800; color: var(--g-800); padding: 0 0 .5rem; margin-bottom: 1rem; border-bottom: 2px solid var(--g-800); width: 100%; display: flex; gap: .6rem; align-items: baseline; }
.form-section > legend::before { content: counter(secao); display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; background: var(--g-800); color: #fff; font-size: .85rem; border-radius: 2px; flex: none; transform: translateY(-.1rem); }
.numbered { counter-reset: secao; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.25rem; }
@media (min-width: 40em) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fields > .field { grid-column: 1 / -1; } .fields > .field.half { grid-column: auto; } }
.field { margin-bottom: 1.15rem; min-width: 0; }
.field > label, .field > .label { display: block; font-weight: 700; font-size: .98rem; margin-bottom: .3rem; color: var(--ink); }
.field .hint { display: block; font-weight: 500; color: var(--muted); font-size: .86rem; margin: -.1rem 0 .4rem; }
.field input:not([type=checkbox]):not([type=radio]), .field textarea, .field select, .input {
  width: 100%; min-height: 3rem; border: 2px solid var(--line-2); border-radius: var(--r); font: 500 1rem Raleway, sans-serif;
  padding: .55rem .75rem; background: #fff; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--g-900); box-shadow: inset 0 0 0 1px var(--g-900); }
.field input[readonly] { background: var(--bg-2); color: var(--muted); }
.field textarea { min-height: 11rem; line-height: 1.55; resize: vertical; }
.field.err { border-left: 5px solid var(--bad); padding-left: .85rem; }
.field.err input, .field.err textarea, .field.err select { border-color: var(--bad); }
.field .msg { color: var(--bad); font-size: .92rem; margin: 0 0 .35rem; font-weight: 700; }
.req { color: var(--bad); font-weight: 800; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 1.4rem; height: 1.4rem; margin: .1rem 0 0; accent-color: var(--g-800); flex: none; }
.input-code { text-transform: uppercase; letter-spacing: .08em; font-weight: 700 !important; font-size: 1.15rem !important; }
.formbar { position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); margin: 1.5rem calc(-1 * 1.15rem) -1.1rem; padding: .9rem 1.15rem; }
.formbar .check { margin-bottom: .8rem; font-size: .95rem; }

/* ---------------------------------------------------------------- portal: abertura */
.hero { background: var(--g-800); color: #fff; position: relative; overflow: hidden; border-bottom: 4px solid var(--gold); }
.hero::after { content: ""; position: absolute; right: -8rem; top: -8rem; width: 26rem; height: 26rem; border-radius: 50%; border: 2.5rem solid rgba(233,186,90,.10); pointer-events: none; }
.hero .wrap { display: grid; gap: 2rem; padding-top: 2.25rem; padding-bottom: 2.5rem; position: relative; z-index: 1; }
@media (min-width: 56em) { .hero .wrap { grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); align-items: center; padding-top: 3rem; padding-bottom: 3.25rem; } }
.hero h1 { color: #fff; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.7rem); }
.hero .lead { color: #e2ebe4; }
.hero .eyebrow { color: var(--gold); }
.hero .actions { margin-top: 1.5rem; }
.hero .btn-secondary { background: transparent; color: #fff; border-color: #fff; }
.hero .btn-secondary:hover { background: rgba(255,255,255,.1); color: #fff; }
.hero .facts { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 1.25rem 0 0; padding: 0; list-style: none; font-size: .9rem; color: #d3ded6; }
.hero .facts li { display: flex; gap: .4rem; align-items: center; margin: 0; }
.hero .facts svg { width: 1.05rem; height: 1.05rem; color: var(--gold); }
.hero figure { margin: 0; justify-self: center; width: min(100%, 21rem); }
@media (max-width: 55.99em) { .hero figure { display: none; } }
.hero figcaption { color: #d3ded6; font-size: .85rem; margin-top: .75rem; text-align: center; }

/* miniatura de documento com o local do QR assinalado */
.docthumb { position: relative; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 12px 28px rgba(0,0,0,.18); line-height: 0; overflow: hidden; }
.docthumb img { width: 100%; height: auto; display: block; }
.docthumb .spot { position: absolute; border: 3px solid var(--bad); border-radius: 4px; box-shadow: 0 0 0 9999px rgba(11,26,17,.16); animation: pulse 2.4s ease-in-out infinite; }
.docthumb .spot-label { position: absolute; transform: translate(-100%, -50%); background: var(--bad); color: #fff; font: 800 .72rem/1.2 Raleway, sans-serif; padding: .3rem .5rem; border-radius: 2px; white-space: nowrap; letter-spacing: .02em; margin-left: -.5rem; }
.docthumb .spot-label.below { transform: translate(-100%, 0); }
.thumbcrop { max-height: 12rem; overflow: hidden; position: relative; }
.thumbcrop::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5rem; background: linear-gradient(transparent, #fff); }
@keyframes pulse { 0%, 100% { border-color: var(--bad); } 50% { border-color: #ff7a6b; } }
.models { display: grid; gap: 1.25rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.models > figure:first-child { grid-column: 1 / -1; }
@media (max-width: 39.99em) { .models figcaption { font-size: .85rem; } .models .spot-label { font-size: .62rem; padding: .2rem .35rem; } }
@media (min-width: 40em) and (max-width: 63.99em) { .models > figure:first-child { grid-column: auto; } }
@media (min-width: 64em) { .models { grid-template-columns: 1.42fr 1fr 1fr; align-items: end; } }
.models figure { margin: 0; }
.models figcaption { margin-top: .9rem; font-size: .92rem; color: var(--ink-2); line-height: 1.45; }
.models figcaption strong { display: block; color: var(--g-800); font-size: 1rem; }

/* passos */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; counter-reset: passo; }
@media (min-width: 52em) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; } }
.steps > li { counter-increment: passo; margin: 0; padding: 1.15rem 1.15rem 1.2rem; border: 1px solid var(--line); border-top: 4px solid var(--g-800); background: #fff; }
.steps > li::before { content: counter(passo); display: grid; place-items: center; width: 2.4rem; height: 2.4rem; background: var(--gold); color: var(--g-950); font-weight: 800; font-size: 1.2rem; margin-bottom: .75rem; }
.steps h3 { margin-bottom: .35rem; }
.steps p { margin: 0; color: var(--ink-2); font-size: .97rem; }
.steps.compact > li { padding: .9rem 1rem; border-top-width: 3px; }
.steps.compact > li::before { width: 1.9rem; height: 1.9rem; font-size: 1rem; margin-bottom: .5rem; }
@media (min-width: 52em) { .steps.vertical { grid-template-columns: 1fr; gap: .75rem; } }

/* lista numerada de ajuda */
.howto { list-style: none; padding: 0; margin: 0; counter-reset: h; }
.howto li { counter-increment: h; position: relative; padding: 0 0 .8rem 2.3rem; margin: 0; }
.howto li::before { content: counter(h); position: absolute; left: 0; top: .05rem; width: 1.55rem; height: 1.55rem; display: grid; place-items: center; background: var(--g-800); color: #fff; font-size: .8rem; font-weight: 800; border-radius: 2px; }
.howto li:last-child { padding-bottom: 0; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 1.6rem; margin: 0 0 .55rem; }
.ticks li::before { content: ""; position: absolute; left: .2rem; top: .35rem; width: .45rem; height: .8rem; border: solid var(--ok); border-width: 0 3px 3px 0; transform: rotate(45deg); }

/* significado dos resultados */
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52em) { .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legend li { margin: 0; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: .85rem; padding: .9rem 1rem; border: 1px solid var(--line); border-left: 5px solid currentColor; background: #fff; }
.legend .ic { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; }
.legend .ic svg { width: 1.6rem; height: 1.6rem; }
.legend strong { display: block; color: var(--ink); font-size: 1rem; }
.legend span { color: var(--ink-2); font-size: .93rem; }

/* perguntas frequentes */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 2.5rem 1rem 0; font-weight: 700; color: var(--g-800); position: relative; font-size: 1.02rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .6rem; top: 1.2rem; width: .6rem; height: .6rem; border: solid var(--g-800); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.45rem; }
.faq summary:hover { color: var(--g-600); text-decoration: underline; }
.faq .answer { padding: 0 0 1.1rem; color: var(--ink-2); max-width: 48em; }
.faq .answer > :last-child { margin-bottom: 0; }

/* ajuda contextual curta */
.helptip { margin: .35rem 0 0; }
.helptip summary { cursor: pointer; color: var(--g-600); font-size: .9rem; font-weight: 700; display: inline-flex; gap: .35rem; align-items: center; list-style: none; }
.helptip summary::-webkit-details-marker { display: none; }
.helptip summary svg { width: 1.05rem; height: 1.05rem; }
.helptip .tip { margin-top: .5rem; padding: .8rem 1rem; background: var(--g-50); border-left: 4px solid var(--g-600); font-size: .92rem; }

/* exemplo do QR com o código por baixo */
.codesample { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.codesample .qrmock { background: #fff; border: 1px solid var(--line); padding: .4rem .4rem .3rem; text-align: center; }
.codesample .qrmock svg { width: 100%; height: auto; display: block; }
.codesample .qrmock b { display: block; font-size: .5rem; letter-spacing: .02em; margin-top: .2rem; color: var(--ink); white-space: nowrap; }
.codesample .arrow { color: var(--bad); font-weight: 800; font-size: .9rem; }

/* contactos */
.contact { font-style: normal; font-size: .95rem; line-height: 1.55; }
.contact dt { font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: .6rem; }
.contact dt:first-child { margin-top: 0; }
.contact dd { margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------- portal: resultado */
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem 1.25rem; align-items: start; padding: 1.35rem 1.25rem; border: 2px solid currentColor; border-left-width: 10px; background: #fff; margin-bottom: 1.75rem; }
.verdict .ic { width: 3.25rem; height: 3.25rem; display: grid; place-items: center; background: currentColor; border-radius: 2px; }
.verdict .ic svg { width: 2.1rem; height: 2.1rem; color: #fff; }
.verdict .k { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .2rem; }
.verdict h1 { color: var(--ink); margin: 0; font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.2rem); }
.verdict p { color: var(--ink); margin: .55rem 0 0; font-size: 1.05rem; max-width: 46em; }
.verdict.t-ok { background: var(--ok-bg); } .verdict.t-bad { background: var(--bad-bg); } .verdict.t-warn { background: var(--warn-bg); }
.verdict.t-info { background: var(--info-bg); } .verdict.t-muted { background: var(--neutral-bg); }
@media (max-width: 30em) { .verdict { grid-template-columns: 1fr; padding: 1.1rem 1rem; border-left-width: 2px; border-top-width: 10px; } }
.stamp { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .9rem; color: var(--muted); padding: 1rem 0 0; border-top: 1px solid var(--line); margin-top: 1.5rem; }
.stamp strong { color: var(--ink-2); }
.drop { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 1.25rem; text-align: center; background: var(--bg-2); }
.drop.over { background: var(--ok-bg); border-color: var(--ok); }
.drop p { margin: 0 0 .75rem; }
.printhead { display: none; }

/* ---------------------------------------------------------------- leitor de QR */
.scanner .viewfinder { position: relative; overflow: hidden; background: #000; margin-bottom: 1rem; aspect-ratio: 1 / 1; max-height: 70vh; border-radius: var(--r); }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 15%; border: 3px solid var(--gold); box-shadow: 0 0 0 9999px rgba(0,0,0,.42); }
.scanner .frame::before, .scanner .frame::after { content: ""; position: absolute; left: 6%; right: 6%; height: 2px; background: rgba(233,186,90,.85); top: 50%; animation: scan 2.2s ease-in-out infinite; }
.scanner .frame::after { display: none; }
@keyframes scan { 0%, 100% { top: 12%; } 50% { top: 88%; } }
.scanner .options { display: grid; gap: .75rem; }
.scanner .opt { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: .85rem; align-items: center; text-align: left; width: 100%; padding: .85rem 1rem;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r); cursor: pointer; font: inherit; color: var(--ink); text-decoration: none; }
.scanner .opt:hover { border-color: var(--g-800); background: var(--g-50); color: var(--ink); }
.scanner .opt:focus-within, .scanner .opt:focus-visible { outline: 3px solid var(--gold); border-color: var(--g-900); }
.scanner .opt.primary { background: var(--g-800); border-color: var(--g-800); color: #fff; box-shadow: 0 2px 0 var(--g-950); }
.scanner .opt.primary:hover { background: var(--g-700); }
.scanner .opt .oi { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; background: var(--g-50); color: var(--g-800); border-radius: 2px; }
.scanner .opt.primary .oi { background: rgba(255,255,255,.12); color: var(--gold); }
.scanner .opt .oi svg { width: 1.5rem; height: 1.5rem; }
.scanner .opt strong { display: block; font-size: 1.02rem; }
.scanner .opt small { display: block; color: var(--muted); font-size: .86rem; font-weight: 500; line-height: 1.35; }
.scanner .opt.primary small { color: #cfdcd3; }
.scanner [role=status] { margin-bottom: 1rem; }

/* ---------------------------------------------------------------- rodapé */
.site-foot { background: var(--g-900); color: #d6e0d9; border-top: 4px solid var(--gold); font-size: .92rem; margin-top: auto; }
.site-foot .wrap.cols { display: grid; gap: 1.75rem; padding-top: 2.25rem; padding-bottom: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48em) { .site-foot .wrap.cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-foot h2 { color: #fff; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .8rem; }
.site-foot a { color: #fff; }
.site-foot a:hover { color: var(--gold); }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 0 0 .45rem; }
.site-foot .id { display: flex; gap: .9rem; align-items: flex-start; }
.site-foot .id img { width: 3.4rem; height: 3.4rem; flex: none; }
.site-foot .id strong { color: #fff; display: block; line-height: 1.35; font-size: .98rem; }
.site-foot .id em { display: block; color: var(--gold); margin-top: .4rem; font-size: .88rem; }
.site-foot address { font-style: normal; line-height: 1.7; }
.site-foot .base { background: var(--g-950); font-size: .82rem; color: #b5c3b9; }
.site-foot .base .wrap { display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap; padding-top: .8rem; padding-bottom: .8rem; }

/* ---------------------------------------------------------------- área interna */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1.5rem; }
@media (min-width: 60em) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { border: 1px solid var(--line); border-left: 5px solid var(--g-800); padding: .9rem 1rem; background: #fff; }
.stat b { display: block; font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-weight: 800; color: var(--g-800); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .86rem; font-weight: 600; line-height: 1.3; display: block; margin-top: .25rem; }
.stat.ok { border-left-color: var(--ok); } .stat.bad { border-left-color: var(--bad); } .stat.gold { border-left-color: var(--gold-600); }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { padding: .7rem 0; border-bottom: 1px solid var(--line); margin: 0; display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.doclist li:first-child { padding-top: 0; }
.doclist li:last-child { border-bottom: 0; padding-bottom: 0; }
.doclist .meta { color: var(--muted); font-size: .86rem; display: block; }
.searchbar { display: flex; gap: .5rem; flex-wrap: wrap; }
.searchbar .input { flex: 1 1 14rem; width: auto; }
.typecards { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 44em) { .typecards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.typecard { display: flex; flex-direction: column; border: 1px solid var(--line); border-top: 4px solid var(--g-800); background: #fff; text-decoration: none; color: var(--ink); }
.typecard:hover { border-color: var(--g-800); color: var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.typecard .thumb { background: var(--bg-2); padding: 1.1rem 1.5rem 0; display: flex; align-items: flex-start; justify-content: center; height: 13.5rem; overflow: hidden; border-bottom: 1px solid var(--line); }
.typecard .thumb .docthumb { width: 100%; max-width: 10.5rem; }
.typecard .thumb .docthumb.landscape { max-width: 15rem; margin-top: 1rem; }
.typecard .body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.typecard h2 { margin: 0; font-size: 1.2rem; }
.typecard p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.typecard .go { margin-top: auto; padding-top: .6rem; font-weight: 800; color: var(--g-600); display: flex; align-items: center; gap: .35rem; }
.typecard .go svg { width: 1.1rem; height: 1.1rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1rem .75rem; font-size: .93rem; margin: 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -1.72rem; top: .35rem; width: .8rem; height: .8rem; background: var(--line-2); border: 2px solid #fff; }
.timeline li.ok::before { background: var(--ok); } .timeline li.bad::before { background: var(--bad); } .timeline li.info::before { background: var(--info); }
.qrbox { text-align: center; }
.qrbox img { width: 11rem; height: 11rem; }
.prose { font-size: .95rem; line-height: 1.55; text-align: justify; font-weight: 400; }
.prose p { margin: 0 0 .5em; }
.prose ul, .prose ol { margin: 0 0 .5em; }

/* ---------------------------------------------------------------- editor de texto (como num processador de texto) */
.rte { border: 2px solid var(--line-2); border-radius: var(--r); background: #fff; }
.rte:focus-within { border-color: var(--g-900); outline: 3px solid var(--gold); }
.field.err .rte { border-color: var(--bad); }
.rte-bar { display: flex; flex-wrap: wrap; gap: .3rem .5rem; padding: .45rem .5rem; background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; }
.rte-group { display: flex; gap: .15rem; align-items: center; padding-right: .5rem; border-right: 1px solid var(--line); }
.rte-group:last-child { border-right: 0; }
.rte-btn { width: 2.15rem; height: 2.15rem; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 2px; cursor: pointer; color: var(--ink); padding: 0; position: relative; }
.rte-btn:hover { background: #fff; border-color: var(--line); }
.rte-btn[aria-pressed="true"] { background: var(--g-100); border-color: var(--g-600); color: var(--g-800); }
.rte-btn svg { width: 1.15rem; height: 1.15rem; }
.rte-btn .bar { position: absolute; left: .45rem; right: .45rem; bottom: .25rem; height: .22rem; border-radius: 1px; }
.rte-select { height: 2.15rem; border: 1px solid var(--line-2); border-radius: 2px; background: #fff; font: 600 .86rem Raleway, sans-serif; color: var(--ink); padding: 0 .35rem; max-width: 11.5rem; }
.rte-select.size { width: 4.6rem; }
.rte-pop { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: .6rem; width: 13.5rem; border-radius: var(--r); }
.rte-pop p { margin: 0 0 .4rem; font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.rte-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; margin-bottom: .5rem; }
.rte-swatch { width: 100%; aspect-ratio: 1; border: 1px solid rgba(0,0,0,.2); border-radius: 2px; cursor: pointer; padding: 0; }
.rte-swatch:hover, .rte-swatch:focus-visible { outline: 2px solid var(--g-900); outline-offset: 1px; box-shadow: none; }
.rte-pop label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .85rem; font-weight: 600; }
.rte-pop input[type=color] { width: 2.5rem; height: 1.8rem; border: 1px solid var(--line-2); padding: 0; background: none; cursor: pointer; }
.rte-pop .none { margin-top: .5rem; width: 100%; }
.rte-page { background: var(--bg-3); padding: 1rem; max-height: 34rem; overflow: auto; }
.rte-doc { background: #fff; margin: 0 auto; width: 100%; max-width: calc(433pt + 64px); min-height: 18rem; padding: 26px 32px; box-shadow: 0 1px 3px rgba(0,0,0,.18);
  font: 400 10.5pt/1.48 Raleway, sans-serif; color: #17231b; text-align: justify; outline: none; overflow-wrap: break-word; }
.rte-doc p { margin: 0 0 6pt; }
.rte-doc ul, .rte-doc ol { margin: 0 0 6pt; padding-left: 1.7em; }
.rte-doc li { margin: 0 0 1.5pt; }
.rte-doc:empty::before, .rte-doc.is-empty::before { content: attr(data-placeholder); color: var(--line-2); }
@media (max-width: 40em) { .rte-page { padding: .5rem; } .rte-doc { padding: 16px 14px; } }
.rte-foot { display: flex; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; padding: .45rem .75rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); background: var(--bg-2); }
.rte-foot .count.over { color: var(--bad); font-weight: 800; }
.rte-source { display: none; }
.rte-full { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; border-radius: 0; border: 0; outline: none; }
.rte-full .rte-page { flex: 1; max-height: none; padding: 1.5rem; }
.rte-full .rte-doc { min-height: calc(100% - 1rem); }

/* ---------------------------------------------------------------- número do documento e classificação (static/js/numero.js) */
.numbox { border: 1px solid var(--line); border-left: 5px solid var(--g-800); background: var(--g-50); padding: .85rem 1rem; margin: 0 0 1.75rem; border-radius: 0 var(--r) var(--r) 0; }
.numbox .k { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.numbox .v { display: block; margin: .15rem 0 .35rem; font-size: 1.35rem; font-weight: 800; color: var(--g-800); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.numbox p { margin: .3rem 0 0; }
.numbox .numwarn { color: var(--warn); background: var(--warn-bg); padding: .45rem .65rem; font-size: .88rem; font-weight: 700; }
.clsf-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .65rem; padding: .55rem .75rem; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: var(--r); }
.clsf-chosen strong { color: var(--g-800); font-variant-numeric: tabular-nums; }
.clsf-chosen button { margin-left: auto; }
.clsf-head { margin: .5rem 0 .4rem; }
.clsf-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); max-height: 24rem; overflow: auto; }
.clsf-list li { margin: 0; border-bottom: 1px solid var(--line); }
.clsf-list li:last-child { border-bottom: 0; }
.clsf-list button { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: .1rem .6rem; width: 100%; padding: .55rem .75rem; border: 0; background: var(--bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.clsf-list button:hover, .clsf-list button:focus-visible { background: var(--g-50); }
.clsf-list .c { grid-row: span 2; font-weight: 800; color: var(--g-800); font-variant-numeric: tabular-nums; }
.clsf-list .s { font-weight: 600; }
.clsf-list .p { grid-column: 2; font-size: .8rem; color: var(--muted); }
.clsf-all { margin-top: .5rem; }
.clsf + select { margin-top: .5rem; }

/* ---------------------------------------------------------------- aviso de sessão (mudou noutro separador, terminou, vai expirar) */
.session-alert { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 200; width: min(44rem, calc(100% - 2rem));
  background: #fff; border: 2px solid var(--warn); border-left-width: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 1rem 1.15rem;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; border-radius: var(--r); }
.session-alert.bad { border-color: var(--bad); }
.session-alert p { margin: 0; flex: 1 1 18rem; font-weight: 600; }

/* ---------------------------------------------------------------- impressão */
@media print {
  .mainnav, .site-foot, .no-print, .skip, .navtoggle, .btn, .scanner { display: none !important; }
  .masthead { border-bottom: 2px solid #000; }
  .printhead { display: block; }
  body { font-size: 11pt; }
  .verdict { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
