/* AcessaWeb – sistema visual: sinalização de metrô.
   Faixa-placa preta, linhas coloridas por área do produto, estações em anel, Atkinson Hyperlegible. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("/assets/fonts/atkinson-mono.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #ffffff;
  --enamel: #f2f3f4;
  --ink: #111214;
  --muted: #565b62;
  --rule: #d5d8dc;
  --rule-strong: #111214;
  --sign: #111214;
  --sign-ink: #ffffff;
  --azul: #0455a1;
  --verde: #00704f;
  --vermelha: #c8102e;
  --amarela: #ffd400;
  --line: var(--azul);
  --link: #0455a1;
  --ok: #00704f;
  --warn: #8a5a00;
  --danger: #c8102e;
  --focus: #ffd400;
  --btn-bg: #111214;
  --btn-ink: #ffffff;
  --radius: 6px;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d0e10;
    --enamel: #17191c;
    --ink: #f1f2f3;
    --muted: #a6acb4;
    --rule: #2e3238;
    --rule-strong: #f1f2f3;
    --sign: #000000;
    --azul: #6fa8ff;
    --verde: #3fcf9a;
    --vermelha: #ff6b7a;
    --link: #8fbcff;
    --ok: #3fcf9a;
    --warn: #f4c06b;
    --danger: #ff8a95;
    --btn-bg: #f1f2f3;
    --btn-ink: #0d0e10;
    color-scheme: dark;
  }
}

[data-line="azul"] { --line: var(--azul); }
[data-line="verde"] { --line: var(--verde); }
[data-line="vermelha"] { --line: var(--vermelha); }
[data-line="amarela"] { --line: var(--amarela); }
[data-line="neutra"] { --line: var(--muted); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--muted) var(--enamel); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  background: var(--ground);
  color: var(--ink);
  caret-color: var(--azul);
  font-feature-settings: "tnum" 0;
}
::selection { background: var(--amarela); color: #111214; }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 14px; }
h3 { font-size: 1rem; font-weight: 700; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px #111214; border-radius: 2px; }
main:focus { outline: none; box-shadow: none; }

.skip { position: absolute; left: 12px; top: -80px; padding: 12px 16px; background: var(--amarela); color: #111214; font-weight: 700; z-index: 20; border-radius: var(--radius); }
.skip:focus { top: 12px; }

/* ---------- marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--sign-ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(2, 11px); grid-template-rows: repeat(2, 11px); gap: 3px; flex: none; }
.brand-mark i { display: block; border-radius: 50%; }
.brand-mark i:nth-child(1) { background: #3d8be0; }
.brand-mark i:nth-child(2) { background: #2fb67f; }
.brand-mark i:nth-child(3) { background: #ef3e57; }
.brand-mark i:nth-child(4) { background: #ffd400; }

/* ---------- faixa-placa ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px;
  min-height: 64px; padding: 0 28px;
  background: var(--sign); color: var(--sign-ink);
  border-bottom: 1px solid #2b2e33;
}
.topbar a:focus-visible, .topbar button:focus-visible { box-shadow: 0 0 0 6px #000; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; align-self: stretch; }
.nav a {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 0 12px; min-height: 64px;
  color: #d9dce0; text-decoration: none; font-weight: 600; font-size: .95rem;
}
.nav a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, #8a9099); flex: none; }
.nav a[data-line="azul"] { --dot: #3d8be0; }
.nav a[data-line="verde"] { --dot: #2fb67f; }
.nav a[data-line="vermelha"] { --dot: #ef3e57; }
.nav a[data-line="amarela"] { --dot: #ffd400; }
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 5px; border-radius: 3px 3px 0 0; background: var(--dot, #fff); transform: scaleY(0); transform-origin: bottom; transition: transform .25s var(--ease); }
.nav a:hover { color: #fff; }
.nav a:hover::after { transform: scaleY(.6); }
.nav a[aria-current="page"] { color: #fff; }
.nav a[aria-current="page"]::after { transform: scaleY(1); }
.user { display: flex; align-items: center; gap: 14px; font-size: .92rem; }
.user a, .user .link { color: #fff; }

/* ---------- página ---------- */
main#main { max-width: 1240px; margin: 0 auto; padding: 32px 28px 64px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 3px solid var(--ink); }
.page-head h1 { display: flex; align-items: center; gap: 14px; }
.page-head h1::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--line); box-shadow: inset 0 0 0 2px rgba(0,0,0,.18); flex: none; }
.page-head p { color: var(--muted); margin: 0; max-width: 70ch; }

.card { background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card > h2:first-child, .card > div > h2:first-child { display: flex; align-items: center; gap: 10px; }
.card > h2:first-child::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--ground); border: 4px solid var(--line); box-sizing: border-box; flex: none; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid > .card { margin-bottom: 0; }

/* indicadores: numerais de casa fixa */
.kpis { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 20px; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--ground); }
.kpi { padding: 18px 20px; border-right: 1px solid var(--rule); border-top: 5px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .label { font-size: .88rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 4px 0 2px; }
.kpi .hint { font-size: .82rem; color: var(--muted); }

/* ---------- formulários ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--enamel); border-color: transparent; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-weight: 700; font-size: .92rem; }
.field .help, .help { font-size: .85rem; color: var(--muted); }
.filters .field { margin-bottom: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], input[type="month"], input[type="datetime-local"], select, textarea {
  font: inherit; color: var(--ink); background: var(--ground);
  border: 2px solid #8a9099; border-radius: var(--radius); padding: 9px 12px; min-height: 46px;
  transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 100px; resize: vertical; font-family: var(--mono); font-size: .92rem; }
textarea.prose { font-family: inherit; font-size: 1rem; }
input[type="color"] { width: 68px; height: 46px; padding: 3px; border: 2px solid #8a9099; border-radius: var(--radius); background: var(--ground); }
input[type="checkbox"] { accent-color: var(--ink); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.check label { font-weight: 600; }
.check small { display: block; color: var(--muted); font-weight: 400; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 22px; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 18px 6px; margin: 0 0 18px; }
legend { font-weight: 800; padding: 0 8px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 9px 18px; border-radius: var(--radius); border: 2px solid var(--ink);
  background: var(--ground); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--enamel); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.btn.primary:hover { background: #2b2e33; border-color: #2b2e33; }
@media (prefers-color-scheme: dark) { .btn.primary:hover { background: #d9dce0; border-color: #d9dce0; } }
.btn.accent { background: var(--amarela); color: #111214; border-color: #111214; }
.btn.accent:hover { background: #ffe14d; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 5px 12px; font-size: .88rem; }
.btn[aria-current="true"] { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.link { background: none; border: 0; padding: 4px; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- tabelas ---------- */
table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 800; padding-bottom: 10px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-size: .82rem; font-weight: 800; color: var(--ink); border-bottom: 2px solid var(--ink); }
tbody tr:hover { background: var(--enamel); }
td.num, th.num { text-align: right; }
td small { color: var(--muted); }
.table-wrap { overflow-x: auto; }
code, .mono { font-family: var(--mono); font-size: .9rem; }
.snippet { display: block; white-space: pre-wrap; word-break: break-all; background: #111214; color: #f1f2f3; border-radius: var(--radius); padding: 16px 18px; border-left: 0; }
@media (prefers-color-scheme: dark) { .snippet { background: #000; border: 1px solid var(--rule); } }

/* ---------- selos ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: .82rem; font-weight: 700; border: 2px solid currentColor; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); }
.badge.off { color: var(--muted); border-style: dashed; }
.badge.off::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--danger); }
.badge.info { color: var(--link); }

/* ---------- gráficos ---------- */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(130px, 36%) 1fr auto; gap: 12px; align-items: center; padding: 6px 0; font-size: .94rem; }
.bar { position: relative; height: 10px; border-radius: 5px; background: var(--enamel); overflow: visible; }
.bar span { position: relative; display: block; height: 100%; background: var(--line); border-radius: 5px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--rule); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .s1 { fill: var(--azul); }
.chart .s2 { fill: var(--verde); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: .88rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
.legend .s1 { background: var(--azul); }
.legend .s2 { background: var(--verde); }
details summary { cursor: pointer; font-weight: 700; color: var(--link); margin-top: 10px; }

.empty { color: var(--muted); padding: 20px 0; }
.error { color: var(--danger); font-weight: 700; }
.error:empty { display: none; }
.site-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.site-list .card { margin: 0; display: flex; flex-direction: column; gap: 10px; border-top: 5px solid var(--line); }
.site-list .card h2 { margin: 0; }
.site-list .card h2::before { display: none; }

/* ---------- acesso ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); background: var(--ground); }
.login-sign { position: relative; overflow: hidden; background: #111214; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-sign .brand { font-size: 1.35rem; }
.login-sign .claim { color: #fff; font-size: clamp(2rem, 1.2rem + 2.4vw, 3.4rem); font-weight: 800; line-height: 1.04; letter-spacing: -.025em; margin: 0; max-width: 14ch; }
.login-sign p { color: #c8ccd1; max-width: 46ch; margin: 0; }
.login-lines { position: relative; height: 140px; }
.login-lines span { position: absolute; left: -48px; right: -48px; height: 12px; border-radius: 6px; }
.login-lines span:nth-child(1) { top: 0; background: #3d8be0; }
.login-lines span:nth-child(2) { top: 34px; background: #2fb67f; }
.login-lines span:nth-child(3) { top: 68px; background: #ef3e57; }
.login-lines span:nth-child(4) { top: 102px; background: #ffd400; }
.login-lines b { position: absolute; top: -10px; width: 34px; height: 146px; border-radius: 17px; background: #fff; border: 5px solid #111214; box-shadow: 0 0 0 3px #fff; }
.login-form { display: grid; place-items: center; padding: 40px 28px; }
.login-form .card { width: min(420px, 100%); border: 0; padding: 0; margin: 0; }
.login-form h1 { font-size: 2rem; margin-bottom: 6px; }
.login-form h1::before { display: none; }
.login-form .btn { width: 100%; margin-top: 6px; }
.login-foot { font-size: .85rem; color: var(--muted); margin-top: 28px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-sign { padding: 28px 20px; gap: 22px; }
  .login-lines { height: 96px; }
  .login-lines span { height: 8px; }
  .login-lines span:nth-child(2) { top: 24px; }
  .login-lines span:nth-child(3) { top: 48px; }
  .login-lines span:nth-child(4) { top: 72px; }
  .login-lines b { height: 100px; width: 26px; }
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: #111214; color: #fff; padding: 13px 20px; border-radius: var(--radius); font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28); max-width: calc(100vw - 32px);
}
.toast::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--amarela); flex: none; }
.toast:empty { display: none; }

/* ---------- suporte, níveis de serviço e status ---------- */
.thread { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; display: flex; flex-direction: column; gap: 14px; }
.thread::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 6px; border-radius: 3px; background: var(--vermelha); }
.thread li { position: relative; border: 1px solid var(--rule); border-radius: var(--radius); padding: 13px 16px; background: var(--ground); }
.thread li::before { content: ""; position: absolute; left: -26px; top: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--ground); border: 4px solid var(--ink); }
.thread li.from-support { border-color: var(--ink); }
.thread li.internal { background: var(--enamel); border-style: dashed; }
.thread li.event { background: transparent; border: 0; padding: 2px 4px; color: var(--muted); font-size: .9rem; }
.thread li.event::before { width: 14px; height: 14px; left: -22px; top: 6px; border-width: 3px; }
.thread .meta { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.thread .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 22px; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 3px; }
.facts dt { font-size: .82rem; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.rating { display: flex; gap: 6px; flex-wrap: wrap; }
.rating .btn { min-width: 46px; }
.uptime-bars { display: flex; gap: 3px; height: 44px; align-items: stretch; }
.uptime-bars span { flex: 1; border-radius: 3px; min-width: 2px; }
.uptime-bars .up, .legend .up { background: var(--verde); }
.uptime-bars .warn, .legend .warn { background: var(--amarela); box-shadow: inset 0 0 0 1px #111214; }
.uptime-bars .down, .legend .down { background: var(--vermelha); }
.uptime-bars .nodata, .legend .nodata { background: var(--rule); }
.status-now { border-top: 6px solid var(--verde); }
.status-now.is-bad { border-top-color: var(--vermelha); }
.status-now h2 { font-size: 1.5rem; }
.status-now.is-ok h2 { color: var(--ok); }
.status-now.is-bad h2 { color: var(--danger); }
.components { list-style: none; margin: 0; padding: 0; }
.components li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-weight: 600; }
.components li:last-child { border-bottom: 0; }
.contact { display: flex; flex-wrap: wrap; gap: 10px 28px; }
kbd { font-family: var(--mono); font-size: .85em; border: 2px solid var(--ink); border-radius: 4px; padding: 0 6px; background: var(--ground); }
.manual ol, .manual ul { padding-left: 22px; }
.manual li { margin-bottom: 7px; }
.manual .card { max-width: 860px; }
.manual .card[id] { scroll-margin-top: 84px; }

.print-only { display: none; }

@media (max-width: 720px) {
  .topbar { padding: 0 16px; gap: 0 16px; }
  .topbar .brand { min-height: 56px; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 8px; }
  .nav a { min-height: 50px; white-space: nowrap; }
  .user { margin-left: auto; }
  main#main { padding: 22px 16px 48px; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--rule); }
  .bars li { grid-template-columns: 1fr auto; }
  .bars li .bar { grid-column: 1 / -1; grid-row: 2; }
  .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .nav a::after, .kpi, .badge, .bar span { forced-color-adjust: auto; }
  .page-head h1::before, .brand-mark i { border: 2px solid CanvasText; }
}

@media print {
  .topbar, .skip, .no-print, .toast, .filters { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .kpi, .kpis { break-inside: avoid; border-color: #999; }
  main#main { max-width: none; padding: 0; }
  .print-only { display: block !important; }
  .page-head { border-bottom-color: #000; }
}
.topbar-label { color: #d9dce0; font-weight: 600; }
.manual .nav a::before { display: none; }
.status-now.is-idle { border-top-color: var(--muted); }
.uptime-bars { gap: clamp(1px, .25vw, 3px); }
.uptime-bars span { min-width: 0; }
@media (max-width: 860px) { .login-lines span { left: -20px; right: -20px; } }
td .mono, td a.mono { white-space: nowrap; }
.demo-banner { margin: 0; padding: 8px 16px; background: #ffd400; color: #111214; font-weight: 800; text-align: center; font-size: .92rem; border-bottom: 2px solid #111214; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; }
.inline-form .grow { flex: 1 1 360px; }
td.report-body { max-width: 46ch; white-space: pre-wrap; overflow-wrap: anywhere; }
