/*
 * netinfo.convertize.com.br — teste de conexão, no visual do Desk.
 * Tokens COPIADOS de frontend/src/lib/palette.ts (claro e escuro) e frontend/tailwind.config.ts (fonte, tamanhos,
 * raios 2/4/8 px, botão lg = 40 px). Se a paleta do Desk mudar, atualize as variáveis abaixo (mesmos nomes).
 */
:root {
  color-scheme: light;
  --fg: #293239; --fg-muted: #5C6970; --fg-inverse: #FFFFFF;
  --line: #D8DCDE; --line-strong: #B0B8BE;
  --surface: #FFFFFF; --surface-1: #F6F8FA; --surface-2: #E8EAEC;
  --hover: rgba(92,105,112,0.08);
  --action: #1F73B7; --action-hover: #17598D; --action-soft: #E8F1F8;
  --ink: #1E8844; --ink-active: #293239;
  --danger: #CC3340;
  --sla-warn-text: #7A4B00;
  --status-soft-solved: #E4F3E8; --status-soft-open: #FCE8E6;
  --shadow-pop: 0 4px 8px rgba(10,13,14,0.16);
  --shadow-focus: 0 0 0 3px rgba(31,115,183,0.28);
  --btn-primary-bg: var(--action); --btn-primary-hover: var(--action-hover);
  --radius-xs: 2px; --radius: 4px; --radius-lg: 8px; --radius-pill: 100px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fg: #F5F5F5; --fg-muted: #A8A29E; --fg-inverse: #0F0D0C;
    --line: #3A3532; --line-strong: #57504B;
    --surface: #1C1917; --surface-1: #0F0D0C; --surface-2: #292524;
    --hover: rgba(250,250,250,0.06);
    --action: #5AA6E6; --action-hover: #7DB9EC; --action-soft: #1D2833;
    --ink: #3DB46A; --ink-active: #FAFAFA;
    --danger: #F87171;
    --sla-warn-text: #F5D565;
    --status-soft-solved: #253223; --status-soft-open: #3B201D;
    --shadow-pop: 0 4px 8px rgba(0,0,0,0.5);
    --shadow-focus: 0 0 0 3px rgba(90,166,230,0.35);
    /* como o botão primário do Desk no escuro: claro com texto escuro */
    --btn-primary-bg: var(--ink-active); --btn-primary-hover: rgba(250,250,250,0.85);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--surface-1); color: var(--fg);
  font: 14px/18px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center; padding: 24px 16px;
}
::selection { background: rgba(31,115,183,0.22); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 1px; }

.cartao {
  width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; align-self: flex-start; box-shadow: var(--shadow-pop);
}
@media (max-width: 480px) { body { padding: 12px; } .cartao { padding: 16px; } }
.marca { display: flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 12px; line-height: 16px; font-weight: 600; margin-bottom: 20px; }
.marca svg { width: 24px; height: 24px; flex: none; }
h1 { font-size: 22px; line-height: 28px; font-weight: 600; margin: 0 0 8px; }
h2 { font-size: 14px; line-height: 18px; font-weight: 600; margin: 0; }
.sub { color: var(--fg-muted); margin: 0 0 16px; }

.lgpd { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0 0 16px; font-size: 12px; line-height: 16px; }
.lgpd summary { font-weight: 600; font-size: 14px; line-height: 18px; cursor: pointer; }
.lgpd ul { margin: 8px 0; padding-left: 18px; }
.lgpd li { margin: 2px 0; }
.lgpd p { margin: 8px 0 0; color: var(--fg-muted); }

.pular { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; cursor: pointer; }
.pular input { margin: 1px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--action); }
.pular small { color: var(--fg-muted); display: block; font-size: 12px; line-height: 16px; }

.botao {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; width: 100%; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--btn-primary-bg); color: var(--fg-inverse); font: inherit; font-weight: 600; cursor: pointer;
}
.botao:hover { background: var(--btn-primary-hover); }
.botao:focus-visible { box-shadow: var(--shadow-focus); }
.botao.secundario { background: var(--surface); color: var(--fg); border-color: var(--line-strong); margin-top: 16px; }
.botao.secundario:hover { background: var(--hover); }
.botao[disabled] { opacity: .5; cursor: default; }

.etapa-atual { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; line-height: 22px; margin-bottom: 8px; }
.girando { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--action); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .girando { animation: none; } .barra > div { transition: none; } }
.barra { height: 6px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.barra > div { height: 100%; width: 0; background: var(--action); border-radius: var(--radius-pill); transition: width .15s ease-out; }
.etapas { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0; margin: 8px 0 16px; font-size: 12px; line-height: 16px; color: var(--fg-muted); }
.etapas li::before { content: "○ "; }
.etapas li.feita { color: var(--ink); }
.etapas li.feita::before { content: "✓ "; }
.etapas li.atual { color: var(--fg); font-weight: 600; }
.etapas li.atual::before { content: "● "; color: var(--action); }

.medidas { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 16px; }
.medida { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px 12px; min-height: 68px; }
.medida .rotulo { font-size: 10px; line-height: 12px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.medida .valor { font-size: 26px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.medida .unidade { font-size: 12px; color: var(--fg-muted); margin-left: 3px; font-weight: 500; }
.medida.vazia .valor { color: var(--fg-muted); }
.medida.pulada .valor { font-size: 14px; color: var(--fg-muted); font-weight: 500; }
.medida.medindo { border-color: var(--action); }
.medida.medindo .valor { color: var(--action); }

.titulo-lista { margin: 4px 0 8px; }
.servidores { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.servidor { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); }
.servidor:first-child { border-top: 0; }
.servidor .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.servidor .trilho { height: 6px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.servidor .trilho > div { height: 100%; width: 0; background: var(--ink); border-radius: var(--radius-pill); }
.servidor.lento .trilho > div { background: var(--sla-warn-text); }
.servidor .ms { font-variant-numeric: tabular-nums; text-align: right; min-width: 92px; color: var(--fg-muted); }
.servidor.ok .ms { color: var(--fg); }
.servidor.lento .ms { color: var(--sla-warn-text); font-weight: 600; }
.servidor.inacessivel .ms { color: var(--danger); font-weight: 600; }
@media (max-width: 420px) { .servidor { grid-template-columns: minmax(0, 1fr) auto; } .servidor .trilho { display: none; } }

.final { text-align: center; padding: 8px 0; }
.icone { width: 88px; height: 88px; margin: 8px auto 16px; border-radius: 50%; display: grid; place-items: center; }
.icone svg { width: 52px; height: 52px; fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.icone.ok { background: var(--status-soft-solved); }
.icone.ok svg { stroke: var(--ink); }
.icone.erro { background: var(--status-soft-open); }
.icone.erro svg { stroke: var(--danger); }
.numeros { font-size: 12px; line-height: 16px; color: var(--fg-muted); margin: 0; }

.dados { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 12px; margin: 0 0 20px; }
.dados dt { color: var(--fg-muted); }
.dados dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
@media (max-width: 420px) { .dados { grid-template-columns: 1fr; gap: 0; } .dados dd { margin-bottom: 8px; } }
.aviso p { color: var(--fg-muted); }
.isca { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; }
[hidden] { display: none !important; }

.ip-hero { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 16px; margin: 0 0 20px; }
.ip-hero .rotulo { display: block; font-size: 10px; line-height: 12px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.ip-hero strong { display: block; font-size: 26px; line-height: 32px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.brutos-caixa { margin: 16px 0 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.brutos-caixa > summary { font-weight: 600; cursor: pointer; }
.brutos-caixa details { margin-top: 8px; }
.brutos-caixa details > summary { cursor: pointer; color: var(--fg-muted); }
.brutos-caixa pre { margin: 4px 0 0; padding: 8px; background: var(--surface-1); border-radius: var(--radius); font-size: 12px; line-height: 16px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.referencias { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.referencias li { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.referencias .ref-nome { color: var(--fg-muted); }
.referencias code { font: 12px/16px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; overflow-wrap: anywhere; }
.copiar { appearance: none; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.copiar:hover { background: var(--hover); }
@media (max-width: 420px) { .referencias li { grid-template-columns: minmax(0, 1fr) auto; } .referencias .ref-nome { grid-column: 1 / -1; } }
