:root {
  --orange: #ff4800;
  --orange-dark: #d93c00;
  --orange-soft: #fff1ea;
  --ink: #161616;
  --muted: #6f6863;
  --line: #ebe6e2;
  --bg: #f7f5f3;
  --white: #ffffff;
  --black: #0d0d0d;
  --ok: #0f7a45;
  --ok-bg: #e8f6ee;
  --perigo: #b42318;
  --sombra: 0 1px 2px rgba(16, 16, 16, 0.04);
  --raio: 14px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(920px 720px at 108% 112%, rgba(255, 72, 0, 0.14), transparent 58%),
    radial-gradient(640px 480px at -8% -10%, rgba(255, 255, 255, 0.9), transparent 52%),
    var(--bg);
}
.vidro-logo {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  width: min(74vw, 860px);
  height: min(74vw, 860px);
  right: -7vw;
  bottom: -18vh;
  opacity: 0.12;
  background: linear-gradient(152deg, rgba(255, 140, 70, 0.55) 0%, rgba(255, 72, 0, 0.72) 48%, rgba(255, 72, 0, 0.9) 100%);
  -webkit-mask-image: url("qualifaz-marca.png");
  mask-image: url("qualifaz-marca.png");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.vidro-logo img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.shell, .springboard, .login-caixa { position: relative; z-index: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
a, button { touch-action: manipulation; }
a { color: inherit; }

.iphone-bar,
.tabbar { display: none; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  background: var(--black);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.marca {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  padding: 0 8px;
}
.marca img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
}
.marca strong { display: block; font-size: 15px; letter-spacing: -0.02em; }
.marca small { color: #b9b3ae; font-size: 12px; }

.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #d9d3ce;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}
.sidebar nav a svg { width: 18px; height: 18px; flex: none; }
.sidebar nav a em {
  margin-left: auto;
  font-style: normal;
  color: #9c958f;
  font-size: 12px;
}
.sidebar nav a.ativo,
.sidebar nav a:hover { background: #1c1c1c; color: #fff; }
.sidebar nav a.ativo { box-shadow: inset 3px 0 0 var(--orange); }

.sidebar-nota {
  margin-top: auto;
  background: #171717;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 14px;
}
.sidebar-nota span,
.sidebar-nota small { display: block; color: #a39d98; font-size: 12px; }
.sidebar-nota strong {
  display: block;
  margin: 4px 0;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: var(--orange);
}

.conteudo {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 32px 36px 64px;
}

.topo {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.olho {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
h2, h3 { margin: 0; letter-spacing: -0.03em; }
.sub { margin: 6px 0 0; color: var(--muted); }

.botao, button.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}
.botao:hover { background: var(--orange-dark); }
.botao.fantasma, button.fantasma {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.botao.fantasma:hover { border-color: #cfc8c2; background: #fff; }
.botao.perigo {
  background: #fff;
  color: var(--perigo);
  border: 1px solid #f3c9c5;
}
.acoes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.busca {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
}
.busca svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.busca input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 16px 0;
  outline: none;
  font-size: 16px;
}
.limpar { color: var(--orange); font-weight: 700; text-decoration: none; font-size: 14px; }

.lista { display: flex; flex-direction: column; gap: 8px; }
.linha[hidden] { display: none !important; }
.linha {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.4fr) minmax(0, 1.3fr) auto auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  text-decoration: none;
  box-shadow: var(--sombra);
}
.linha:hover { border-color: #f0c2ae; }
.selo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--black);
  color: var(--orange);
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 18px;
}
.selo.vazio { color: #8d8782; }
.quem strong, .host { display: block; }
.quem small, .host { color: var(--muted); font-size: 13px; }
.quem strong { font-size: 15px; }
.host { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ink); }
.porta {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--orange);
}
.porta i { font-style: normal; color: var(--muted); font-size: 13px; font-weight: 600; }

.situacao {
  justify-self: end;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #f3f1ef;
  color: #5e5854;
}
.s-gerado { background: var(--orange-soft); color: var(--orange-dark); }
.s-concluido { background: var(--ok-bg); color: var(--ok); }

.painel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--raio);
  padding: 20px;
  box-shadow: var(--sombra);
}
.vazio-bloco { text-align: center; padding: 48px 20px; }
.vazio-bloco img { width: 72px; height: 72px; border-radius: 18px; }
.vazio-bloco h2 { margin: 14px 0 8px; }
.vazio-bloco p { color: var(--muted); margin: 0 0 18px; }
.oculto { display: none; }
.vazio { color: var(--muted); }

.aviso, .ok {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-weight: 600;
}
.aviso a { color: inherit; }
.aviso { background: #fff1f0; color: var(--perigo); }
.formulario h2 { font-size: 18px; }
.formulario h2.secao { margin-top: 22px; }
.ok { background: var(--ok-bg); color: var(--ok); }

.formulario .grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
label.largo { grid-column: 1 / -1; }
input, select, textarea {
  border: 1px solid var(--line);
  background: #fafafa;
  border-radius: 10px;
  padding: 12px;
  font-weight: 500;
  outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); background: #fff; box-shadow: 0 0 0 3px rgba(255, 72, 0, 0.12); }
.formulario .acoes, .api { margin-top: 16px; }
.previsao, .ajuda { color: var(--muted); margin-top: 0; }
.ajuda { margin-bottom: 0; }
.api pre, .terminal {
  background: var(--black);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}
.voltar {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.voltar:hover { color: var(--ink); }

.gerar-bloco, .fecho {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.gerar-bloco p, .fecho p { color: var(--muted); margin: 6px 0 0; }

.conexao {
  background: var(--black);
  color: #fff;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 14px;
}
.conexao-topo h2 { font-size: 22px; }
.conexao-topo p { margin: 6px 0 16px; color: #c8c2bd; }
.triplo {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.7fr;
  gap: 10px;
}
.triplo article, .valor {
  background: #171717;
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.triplo span, .valor span { color: #a39d98; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.triplo strong, .valor strong { font-size: 20px; letter-spacing: -0.03em; word-break: break-all; }
.triplo .destaque strong { color: var(--orange); font-size: 40px; line-height: 1; }
.triplo button, .valor button, .passo > div > button {
  background: transparent;
  color: var(--orange);
  border: 0;
  padding: 0;
  font-weight: 700;
  cursor: pointer;
}

.passos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.passo { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; }
.passo h3 { font-size: 18px; }
.passo p { color: var(--muted); margin: 6px 0 12px; }
.passo .acoes { margin-bottom: 12px; }
.passo > div > .botao { margin-bottom: 12px; }
.num {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.rota { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.valor {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}
.valor.largo { grid-column: 1 / -1; }
.valor strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; }
.token { display: flex; gap: 10px; align-items: end; margin-bottom: 10px; }
.token label { flex: 1; }
.testar { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.resultado { margin: 0; color: var(--muted); font-weight: 600; }
.resultado.boa { color: var(--ok); }
.resultado.ruim { color: var(--perigo); }
.instrucoes { margin: 0; padding-left: 18px; }
.instrucoes li { margin: 6px 0; }
.instrucoes.claras { color: #f3efe9; margin: 0 0 16px; }
.instrucoes.claras b { color: #fff; }
.fecho { margin-top: 10px; }

body.tela-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
body.tela-login .vidro-logo {
  width: min(108vw, 640px);
  height: min(108vw, 640px);
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -48%);
  opacity: 0.1;
}
.login-caixa { width: min(420px, 100%); display: grid; gap: 12px; }
.login-caixa img { width: 64px; height: 64px; border-radius: 16px; }
.login-caixa form { display: grid; gap: 12px; }
.login-caixa .botao { width: 100%; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 12px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--orange); }
.ativo-usuario { margin-top: 16px; }
.usuario-linha { grid-template-columns: 72px minmax(0, 1fr) auto; }
.sair-menu { margin-top: 12px; }
.sair-menu button, .sair-barra button, .sair-home button {
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 0;
}
.sair-menu button { color: #d9d3ce; }
.sair-barra button { color: var(--orange); font-size: 15px; }
.sair-home { margin-top: 14px; text-align: center; }
.sair-home button { color: #fff; }

.springboard, .so-celular { display: none; }

@media (max-width: 860px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg);
  }
  body {
    min-height: 100dvh;
  }
  .shell {
    display: block;
    min-height: 100dvh;
  }
  .sidebar { display: none; }
  .iphone-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    margin: 0;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: rgba(247, 245, 243, 0.9);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  }
  .marca-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.03em;
  }
  .marca-mini img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
  .iphone-bar strong {
    color: var(--orange);
    font-size: 22px;
    letter-spacing: -0.04em;
  }
  .conteudo {
    width: 100%;
    max-width: none;
    padding: 0 16px calc(128px + env(safe-area-inset-bottom));
  }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.12);
    padding: 6px 12px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #8e8e93;
    font-size: 11px;
    font-weight: 600;
  }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.ativo { color: var(--orange); }
  .topo, .ficha-topo {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }
  h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; }
  .olho { font-size: 13px; }
  .topo .botao, .acoes, .acoes .botao, .acoes form, .gerar-bloco .botao, .passo .botao {
    width: 100%;
  }
  .acoes, .gerar-bloco, .fecho, .token, .testar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .botao, button.botao { min-height: 48px; font-size: 17px; scroll-margin-bottom: 120px; }
  .busca {
    border-radius: 12px;
    background: #e9e6e3;
    border-color: transparent;
    min-height: 44px;
  }
  .busca input { font-size: 16px; padding: 12px 0; }
  input, select, textarea { font-size: 16px; min-height: 48px; }
  textarea { min-height: 96px; }
  .formulario .grade, .triplo, .rota { grid-template-columns: 1fr; }
  .linha {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
      "selo quem"
      "selo host"
      "selo porta"
      "selo situacao";
    padding: 14px;
    border-radius: 16px;
  }
  .linha .selo { grid-area: selo; width: 48px; height: 48px; }
  .linha .quem { grid-area: quem; min-width: 0; }
  .linha .host { grid-area: host; overflow-wrap: anywhere; }
  .linha .porta { grid-area: porta; }
  .linha .situacao { grid-area: situacao; justify-self: start; }
  .voltar {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 17px;
    color: var(--orange);
  }
  .painel, .conexao { border-radius: 18px; }
  .conexao { padding: 16px; }
  .triplo .destaque strong { font-size: 36px; }
  .passo { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .num { width: 36px; height: 36px; }
  .terminal { font-size: 13px; }
  .check input { width: 22px; height: 22px; min-height: 0; }
  .checks { grid-template-columns: 1fr; }
  .vazio-bloco { padding: 28px 12px; }
  .so-celular { display: inline-flex; }
  body.na-home {
    background:
      radial-gradient(80% 42% at 100% -10%, rgba(255, 72, 0, 0.62), transparent 58%),
      radial-gradient(70% 40% at 0% 100%, rgba(255, 72, 0, 0.28), transparent 60%),
      #101010;
  }
  body.na-home .vidro-logo {
    opacity: 1;
    width: min(118vw, 560px);
    height: min(118vw, 560px);
    left: 50%;
    right: auto;
    top: 54%;
    bottom: auto;
    transform: translate(-50%, -50%);
    background: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  body.na-home .vidro-logo img {
    display: block;
    opacity: 0.1;
    filter: brightness(0) saturate(100%) invert(40%) sepia(86%) saturate(4200%) hue-rotate(1deg) brightness(1.05);
  }
  body.na-home .shell,
  body.na-home .tabbar { display: none; }
  body.na-home .springboard {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: calc(6px + env(safe-area-inset-top)) 20px calc(14px + env(safe-area-inset-bottom));
    color: #fff;
    background: transparent;
  }
  .status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.02em;
  }
  .sinais { display: flex; align-items: center; gap: 6px; }
  .sinais svg { width: 18px; height: 12px; }
  .widget {
    margin-top: 22px;
    padding: 16px 18px 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }
  .widget span { display: block; font-size: 13px; opacity: 0.8; }
  .widget strong {
    display: block;
    margin: 2px 0 4px;
    font-size: 48px;
    line-height: 1;
    letter-spacing: -0.05em;
  }
  .widget small { font-size: 14px; opacity: 0.86; }
  .apps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 6px;
    margin-top: 32px;
  }
  .icone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  }
  .globo {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  }
  .globo svg { width: 32px; height: 32px; }
  .globo.laranja { background: linear-gradient(180deg, #ff7433, #ff4800); color: #fff; }
  .globo.preto { background: linear-gradient(180deg, #3a3a3a, #111); color: #fff; }
  .globo.cinza { background: linear-gradient(180deg, #aeaeb2, #636366); color: #fff; }
  .globo.branco { background: linear-gradient(180deg, #fff, #ececf1); color: #111; }
  .dock {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    margin-top: auto;
    padding: 14px 10px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  .dock .globo { width: 58px; height: 58px; }
  .dock form { display: contents; }
  button.icone {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: #fff;
    font: inherit;
    cursor: pointer;
  }
}

@media print {
  .vidro-logo { display: none !important; }
  .sidebar, .voltar, .acoes, button, .testar, .token button, .tabbar, .iphone-bar, .springboard { display: none !important; }
  .shell { display: block; }
  .conteudo { max-width: none; }
  .conexao, .terminal { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
