/* ═══════════════════════════════════════════════════════════════════
   Prisma Stream — página de instalação (painel Fenix, v48)
   Tema: escuro azulado + laranja Fênix · painel único com abas
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0B0C10;             /* fundo da página */
  --painel: #16181F;          /* cartão principal */
  --cartao: #1E2025;          /* cartões internos */
  --cartao-off: #1B1D23;      /* cartão desligado */
  --campo: #14161C;           /* campo de endereço */
  --borda: #2A2D36;           /* borda neutra */
  --separador: #23262F;       /* linha entre cabeçalho/abas/corpo/rodapé */
  --laranja: #F68B1F;         /* acento */
  --laranja-claro: #F6A94A;   /* texto de chip/badge */
  --laranja-borda: rgba(246, 139, 31, .42);
  --laranja-fundo: rgba(246, 139, 31, .12);
  --quente: #2A1E10;          /* fundo do selecionado (marrom quente) */
  --verde: #22C55E;
  --ambar: #D97706;
  --vermelho: #EF4444;
  --texto: #F2F3F6;
  --texto-2: #8B90A0;
  --texto-3: #6B7280;
  --raio-painel: 18px;
  --raio-cartao: 12px;
  --raio-aba: 9px;
  --raio-chip: 6px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--texto);
  font: 15px/1.5 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: flex;
  justify-content: center;
  padding: 20px 14px 34px;
}

.moldura { width: 100%; max-width: 630px; }

.painel {
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: var(--raio-painel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  overflow: hidden;
}

/* ══════════════ Cabeçalho ══════════════ */
.cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 18px 22px;
}

.cab-esq { display: flex; align-items: center; gap: 13px; min-width: 0; }

.logo-caixa {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--quente);
  border: 1px solid var(--laranja-borda);
  display: grid;
  place-items: center;
}

.logo-fenix { width: 32px; height: 32px; display: block; }

.cab-titulos { min-width: 0; }

.cab-nome {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--texto);
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.badge-apoiador {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--laranja-claro);
  background: var(--laranja-fundo);
  border-radius: 999px;
  padding: 3px 10px;
  line-height: 1.4;
}

.cab-sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--texto-2);
}

.pill-sync {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--texto);
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 999px;
  padding: 7px 14px;
}

.dot-sync {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verde);
  box-shadow: 0 0 6px rgba(34, 197, 94, .7);
}
.dot-sync[data-live="off"] {
  background: var(--ambar);
  box-shadow: 0 0 6px rgba(217, 119, 6, .6);
}

/* ══════════════ Abas ══════════════ */
.abas {
  display: flex;
  gap: 6px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--separador);
  border-bottom: 1px solid var(--separador);
  overflow-x: auto;
  scrollbar-width: none;
}
.abas::-webkit-scrollbar { display: none; }

.aba {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 500 13px/1 'Roboto', system-ui, sans-serif;
  color: var(--texto-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--raio-aba);
  padding: 9px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}
.aba svg { width: 15px; height: 15px; }
.aba:hover { color: var(--texto); background: rgba(255, 255, 255, .04); }
.aba:focus-visible { outline: 2px solid var(--laranja); outline-offset: 1px; }

.aba.is-on {
  color: var(--laranja);
  background: var(--laranja-fundo);
  border-color: var(--laranja-borda);
  font-weight: 600;
}

/* ══════════════ Corpo ══════════════ */
.conteudos { padding: 22px; }
.conteudo { animation: surge .25s ease; }

@keyframes surge {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ── Cartões de estatística (Início) ── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: var(--raio-cartao);
  padding: 14px 15px;
  min-width: 0;
}

.stat-rotulo {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--texto-2);
}

.stat-valor {
  font-size: 18px;
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-sub {
  font-size: 12px;
  color: var(--texto-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Cartão de instalação ── */
.cartao-instalar {
  margin-top: 16px;
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: var(--raio-cartao);
  padding: 24px 22px;
  text-align: center;
}

.instalar-titulo {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--texto);
}

.instalar-sub {
  margin: 8px auto 18px;
  max-width: 42ch;
  font-size: 14px;
  color: var(--texto-2);
}

.btn-instalar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  background: var(--laranja);
  color: #16181F;
  font: 700 15px/1.2 'Roboto', system-ui, sans-serif;
  border: none;
  border-radius: var(--raio-cartao);
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.btn-instalar:hover { filter: brightness(1.07); }
.btn-instalar:active { transform: translateY(1px); }
.btn-instalar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-instalar svg { width: 19px; height: 19px; fill: #16181F; }

.campo-url {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  background: var(--campo);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 6px 6px 6px 14px;
}

.campo-url code {
  flex: 1;
  min-width: 0;
  font: 400 12.5px/1.4 ui-monospace, 'Roboto Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  color: var(--texto-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.btn-copiar {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 500 12.5px/1 'Roboto', system-ui, sans-serif;
  color: #E5E7EB;
  background: #33333B;
  border: 1px solid #3D3D46;
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
  transition: background .15s;
}
.btn-copiar:hover { background: #3C3C46; }
.btn-copiar svg { width: 13px; height: 13px; }

.nota-tv {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--texto-3);
}
.nota-tv svg { flex: none; width: 14px; height: 14px; color: var(--texto-3); margin-top: 1px; }

/* ══════════════ Seções ══════════════ */
.cabeca-secao {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 2px 12px;
}
.cabeca-secao:first-child { margin-top: 2px; }

.secao-titulo {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--texto);
}

.secao-nota {
  font-size: 12px;
  color: var(--texto-3);
  text-align: right;
}

/* ══════════════ Linhas (toggles) ══════════════ */
.linhas { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.linha {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: var(--cartao);
  border: 1px solid var(--laranja-borda);
  border-radius: var(--raio-cartao);
  padding: 13px 16px;
  min-height: 58px;
  transition: border-color .15s, background .15s;
}
.linha[data-off="1"] { background: var(--cartao-off); border-color: var(--borda); }

.linha[hidden] { display: none; }

.chip {
  flex: none;
  min-width: 56px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--laranja-claro);
  border: 1px solid var(--laranja-borda);
  border-radius: var(--raio-chip);
  padding: 5px 8px;
}
.linha[data-off="1"] .chip { color: var(--texto-3); border-color: var(--borda); }

.badge-cat {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--laranja-claro);
  background: var(--laranja-fundo);
  border: 1px solid var(--laranja-borda);
  border-radius: var(--raio-chip);
  padding: 4px 8px;
  white-space: nowrap;
}
.linha[data-off="1"] .badge-cat { color: var(--texto-3); background: transparent; border-color: var(--borda); }

.linha-info { min-width: 0; display: grid; gap: 2px; }

.linha-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.linha[data-off="1"] .linha-nome { color: var(--texto-2); }

.linha-meta {
  font-size: 12px;
  color: var(--texto-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.linha-meta[data-st="aviso"] { color: var(--ambar); }
.linha-meta[data-st="fora"] { color: var(--vermelho); }

/* catálogos: borda NEUTRA (o laranja fica só nas resoluções, como no
   painel de referência) */
#fontes-lista .linha { border-color: var(--borda); }
#fontes-lista .linha[data-off="1"] { background: var(--cartao-off); }

.linha.is-dim { opacity: .5; }

/* ── Toggle ── */
.tgl {
  flex: none;
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: #363B47;
  cursor: pointer;
  transition: background .18s;
  padding: 0;
}
.tgl::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #9AA0AD;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: left .18s, background .18s;
}
.tgl.is-on { background: var(--laranja); }
.tgl.is-on::after { left: 23px; background: #fff; }
.tgl:focus-visible { outline: 2px solid var(--laranja); outline-offset: 2px; }

/* ══════════════ Radios (Avançado) ══════════════ */
.radios-entrega { display: grid; gap: 12px; }

.radio-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: var(--raio-cartao);
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.radio-card:hover { border-color: #3A3E49; }
.radio-card:focus-visible { outline: 2px solid var(--laranja); outline-offset: 1px; }

.radio-card.is-on {
  background: var(--quente);
  border-color: var(--laranja);
  border-width: 1.5px;
}

.radio-circ {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--texto-3);
  position: relative;
}
.radio-card.is-on .radio-circ { border-color: var(--laranja); }
.radio-card.is-on .radio-circ::after {
  content: '';
  position: absolute;
  inset: 3.5px;
  border-radius: 50%;
  background: var(--laranja);
}

.radio-corpo { display: grid; gap: 3px; min-width: 0; }

.radio-nome { font-size: 15px; font-weight: 600; color: var(--texto); }

.radio-meta { font-size: 13px; color: var(--texto-2); line-height: 1.45; }

/* ══════════════ Rodapé ══════════════ */
.rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--separador);
  background: rgba(0, 0, 0, .16);
}

.rodape-linha { font-size: 12px; color: var(--texto-2); min-width: 0; }

.rodape-versao { flex: none; font-size: 12px; color: var(--texto-3); }

/* ══════════════ Esqueleto (catálogos carregando) ══════════════ */
.linha-skel {
  height: 58px;
  border-radius: var(--raio-cartao);
  border: 1px solid var(--borda);
  background: linear-gradient(100deg, var(--cartao) 40%, #24272F 50%, var(--cartao) 60%);
  background-size: 200% 100%;
  animation: brilho 1.4s ease infinite;
}
@keyframes brilho {
  from { background-position: 120% 0; }
  to   { background-position: -20% 0; }
}

/* ══════════════ Toast ══════════════ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  max-width: min(88vw, 480px);
  background: #262933;
  border: 1px solid #383C48;
  color: var(--texto);
  font-size: 13px;
  line-height: 1.45;
  border-radius: 10px;
  padding: 11px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  text-align: center;
  z-index: 50;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ══════════════ Responsivo ══════════════ */
@media (max-width: 600px) {
  body { padding: 12px 8px 26px; }
  .conteudos { padding: 18px 14px; }
  .cabecalho { padding: 15px 16px; }
  .cab-nome { font-size: 18px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .cartao-instalar { padding: 20px 16px; }
  .linha { grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; padding: 12px 13px; }
  .chip { min-width: 46px; }
  .abas { padding: 8px 10px 11px; }
  .aba { padding: 8px 10px; }
  .rodape { flex-direction: column; gap: 3px; text-align: center; padding: 13px 14px; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .aba span { font-size: 12px; }
}
