/*
 * One stylesheet, no build step.
 *
 * The marketing pages and the application share it because they share a
 * vocabulary — a panel, a badge, a table, a field — and two stylesheets that
 * drift apart is how a product ends up looking like two products.
 *
 * Colour is load-bearing here in a way it is not on most sites: pass, warning
 * and block are the three things a reviewer reads first. So each carries a
 * symbol as well as a hue, and none of them is the only signal for anything.
 */

:root {
  color-scheme: light dark;

  --ink: #131820;
  --ink-soft: #46505e;
  --muted: #6b7688;
  --bg: #ffffff;
  --bg-sunk: #f4f6fa;
  --panel: #ffffff;
  --line: #e2e7ef;
  --line-strong: #cbd3e0;

  --accent: #2b5fd9;
  --accent-ink: #ffffff;
  --accent-soft: #eaf0fe;

  --pass: #17754a;
  --pass-soft: #e6f5ed;
  --warn: #8a5800;
  --warn-soft: #fdf2dc;
  --block: #b02020;
  --block-soft: #fdecec;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px -12px rgba(16, 24, 40, .25);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8edf5;
    --ink-soft: #b3bECD;
    --muted: #8c98ab;
    --bg: #0c1017;
    --bg-sunk: #10151e;
    --panel: #141a24;
    --line: #232c3a;
    --line-strong: #33405260;

    --accent: #6f9bff;
    --accent-ink: #0c1017;
    --accent-soft: #17233d;

    --pass: #5ed49a;
    --pass-soft: #10281e;
    --warn: #f0c063;
    --warn-soft: #2a2110;
    --block: #ff8b8b;
    --block-soft: #2c1516;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -16px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }

/* A display rule beats the user agent's [hidden], so anything this stylesheet
 * gives a display to needs telling again. Without this, `node.hidden = true` on
 * a .field or a .step silently does nothing. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { letter-spacing: -0.018em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.6vw, 46px); }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
small { font-size: 13px; }
code, .mono { font-family: var(--mono); font-size: .92em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ── Page chrome ───────────────────────────────────────────────────────── */

.site-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-head .inner,
.site-foot .inner { max-width: 1080px; margin: 0 auto; padding: 14px 22px; }
.site-head .inner { display: flex; align-items: center; gap: 22px; }
.site-head nav { display: flex; gap: 18px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.site-head nav a { color: var(--ink-soft); text-decoration: none; font-size: 15px; }
.site-head nav a:hover { color: var(--ink); }

.wordmark {
  font-weight: 700; font-size: 19px; letter-spacing: -.03em;
  color: var(--ink); text-decoration: none;
}
.wordmark span { color: var(--accent); }

.site-foot { border-top: 1px solid var(--line); margin-top: 72px; color: var(--muted); }
.site-foot .inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 26px 22px 46px; }
.site-foot a { color: var(--muted); }
.site-foot .spacer { flex: 1 1 auto; }

main { max-width: 1080px; margin: 0 auto; padding: 44px 22px; }
main.narrow { max-width: 720px; }

/* ── Type ─────────────────────────────────────────────────────────────── */

.lede { font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); max-width: 62ch; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
.muted { color: var(--muted); }
.hint { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ── Layout helpers ───────────────────────────────────────────────────── */

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
/* A cluster of badges or buttons stays on one line. Wrapping "Edit" under
 * "Delete" in a table cell reads as two rows of one action rather than one row
 * of two, and the table scrolls sideways if it has to. */
.row.tight { gap: 8px; flex-wrap: nowrap; }
.row .spacer { flex: 1 1 auto; }
.stack { display: grid; gap: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel h2, .panel h3 { margin-top: 0; }
.panel.sunk { background: var(--bg-sunk); box-shadow: none; }

.section-head { display: flex; align-items: baseline; gap: 14px; margin: 34px 0 14px; }
.section-head h2 { margin: 0; }
.section-head .spacer { flex: 1 1 auto; }

/* ── Stat tiles ───────────────────────────────────────────────────────── */

.tile {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.tile .label { font-size: 13px; color: var(--muted); display: block; }
.tile .value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; display: block; margin-top: 2px; }
.tile .note { font-size: 13px; color: var(--muted); }
.tile.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
a.tile, .tile a { text-decoration: none; color: inherit; }
a.tile:hover { border-color: var(--muted); }
a.tile .value { color: var(--accent); }

/* ── Badges and check rows ────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.7;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-pass  { background: var(--pass-soft);  color: var(--pass);  border-color: color-mix(in srgb, var(--pass) 30%, transparent); }
.badge-warn  { background: var(--warn-soft);  color: var(--warn);  border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge-block { background: var(--block-soft); color: var(--block); border-color: color-mix(in srgb, var(--block) 30%, transparent); }
.badge-info  { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.badge-plain { background: var(--bg-sunk); color: var(--muted); border-color: var(--line); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.checklist li {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start;
  background: var(--panel); padding: 11px 14px;
}
.checklist .mark { font-size: 15px; line-height: 1.5; font-weight: 700; }
.checklist .pass .mark  { color: var(--pass); }
.checklist .fail .mark  { color: var(--block); }
.checklist .warn .mark  { color: var(--warn); }
.checklist .skip .mark  { color: var(--muted); }
.checklist .name { font-weight: 600; }
.checklist .detail { color: var(--ink-soft); font-size: 14.5px; }
.checklist .expectation { color: var(--muted); font-size: 13px; }

.verdict {
  display: grid; gap: 6px; padding: 18px 20px;
  border-radius: var(--radius-lg); border: 1px solid;
}
.verdict h3 { margin: 0; font-size: 20px; }
.verdict .why { margin: 0; font-size: 14.5px; }
.verdict-approve { background: var(--pass-soft);  border-color: color-mix(in srgb, var(--pass) 35%, transparent);  color: var(--pass); }
.verdict-review  { background: var(--warn-soft);  border-color: color-mix(in srgb, var(--warn) 35%, transparent);  color: var(--warn); }
.verdict-reject  { background: var(--block-soft); border-color: color-mix(in srgb, var(--block) 35%, transparent); color: var(--block); }
.verdict ul { margin: 4px 0 0; padding-left: 20px; }
.verdict li { font-size: 14.5px; }

/* A confidence bar reads faster than a percentage on its own. */
.meter { display: grid; gap: 4px; }
.meter .track { height: 7px; border-radius: 999px; background: var(--bg-sunk); border: 1px solid var(--line); overflow: hidden; }
.meter .fill { height: 100%; background: var(--accent); }
.meter.high .fill { background: var(--pass); }
.meter.medium .fill { background: var(--warn); }
.meter.low .fill { background: var(--block); }
.meter .legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* ── Tables ───────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-sunk); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ── Forms ────────────────────────────────────────────────────────────── */

.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field-label { font-size: 14px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
textarea { resize: vertical; min-height: 96px; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
label.inline { display: flex; gap: 8px; align-items: center; font-size: 14.5px; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  border-radius: 8px; padding: 9px 15px; text-decoration: none; display: inline-flex;
  align-items: center; gap: 7px;
}
button:hover, .button:hover { border-color: var(--muted); }
button[disabled] { opacity: .55; cursor: progress; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.approve { background: var(--pass); border-color: var(--pass); color: #fff; }
.reject  { background: var(--block); border-color: var(--block); color: #fff; }
.ghost { background: transparent; }
.small { padding: 5px 10px; font-size: 13.5px; }
.danger-text { color: var(--block); }

.form-error {
  background: var(--block-soft); color: var(--block);
  border: 1px solid color-mix(in srgb, var(--block) 30%, transparent);
  border-radius: 8px; padding: 9px 12px; font-size: 14.5px; margin: 0 0 12px;
}
.form-ok {
  background: var(--pass-soft); color: var(--pass);
  border: 1px solid color-mix(in srgb, var(--pass) 30%, transparent);
  border-radius: 8px; padding: 9px 12px; font-size: 14.5px; margin: 0 0 12px;
}

dialog.sheet {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel);
  color: var(--ink); padding: 22px; max-width: min(620px, 94vw); width: 100%; box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: rgba(10, 14, 20, .55); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 17px; border-radius: 999px;
  font-size: 14.5px; z-index: 90; box-shadow: var(--shadow);
}
.toast-erro { background: var(--block); color: #fff; }

/* ── The application shell ────────────────────────────────────────────── */

body.app { background: var(--bg-sunk); }
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.app-side {
  display: flex; flex-direction: column; gap: 3px; padding: 18px 14px;
  border-right: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; height: 100vh;
}
.app-side .wordmark { padding: 4px 10px 16px; }
.app-side .spacer { flex: 1 1 auto; }
.nav-link {
  display: block; padding: 8px 11px; border-radius: 8px; text-decoration: none;
  color: var(--ink-soft); font-size: 14.5px; font-weight: 500;
}
.nav-link:hover { background: var(--bg-sunk); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side-foot { display: grid; gap: 8px; padding: 12px 10px 0; border-top: 1px solid var(--line); }
.side-foot .who { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.app-main { padding: 26px 30px 70px; max-width: 1280px; }
.app-main > header { margin-bottom: 20px; }
.app-main > header h1 { font-size: 26px; margin-bottom: 4px; }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .app-side .wordmark { padding: 4px 10px; }
  .app-side .spacer { display: none; }
  .side-foot { border-top: none; padding: 0; grid-auto-flow: column; align-items: center; }
  .app-main { padding: 20px 16px 60px; }
}

/* ── The review screen ────────────────────────────────────────────────── */

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .compare { grid-template-columns: 1fr; } }
.compare > section { display: grid; gap: 14px; }
.pane-title { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 0; }

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 16px; font-size: 14.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.kv dd.differs { color: var(--warn); }

.doc-frame { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-sunk); }
.doc-image { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filters .field { margin-bottom: 0; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button {
  border: none; background: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 9px 13px; color: var(--muted); font-weight: 600;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.step { display: grid; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.step[hidden] { display: none; }
.step-number { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

.map-row { display: grid; grid-template-columns: 1fr 26px 1fr 130px; gap: 10px; align-items: center; margin-bottom: 8px; }
.map-row .arrow { text-align: center; color: var(--muted); }
@media (max-width: 720px) { .map-row { grid-template-columns: 1fr; } .map-row .arrow { display: none; } }

.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: 34px; text-align: center; color: var(--muted); background: var(--bg-sunk);
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ── Marketing ────────────────────────────────────────────────────────── */

.hero { padding: 40px 0 20px; }
.hero .lede { margin-bottom: 26px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.rule { height: 1px; background: var(--line); border: 0; margin: 52px 0; }

.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 26px 0; }
.flow div {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  background: var(--panel); font-size: 14px; font-weight: 600;
}
.flow div span { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 3px; }

.faq h3 { margin-bottom: 4px; }
.faq > div { padding: 16px 0; border-bottom: 1px solid var(--line); }
