:root {
  --fundo: #0d1017;
  --fundo2: #141924;
  --card: #171d2b;
  --borda: #263043;
  --texto: #e8eef8;
  --texto2: #9aa8bf;
  --acento: #34d399;
  --acento2: #22d3ee;
  --erro: #f87171;
  --aviso: #fbbf24;
  --raio: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Ubuntu, sans-serif;
  background:
    radial-gradient(1200px 500px at 20% -10%, #16443c33, transparent),
    radial-gradient(900px 400px at 90% 0%, #0e3a4d33, transparent),
    var(--fundo);
  color: var(--texto);
  min-height: 100vh;
}

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--borda);
  background: #0d1017cc;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
}

.topo-conteudo { display: flex; align-items: center; gap: 16px; }

.logo {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-weight: 800; font-size: 20px; letter-spacing: 1px;
  color: #06251d;
  background: linear-gradient(135deg, var(--acento), var(--acento2));
  box-shadow: 0 6px 24px #34d39933;
}

h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.topo p { margin: 4px 0 0; color: var(--texto2); font-size: 14px; max-width: 720px; }

.status {
  font-size: 12px; color: var(--texto2);
  border: 1px solid var(--borda); border-radius: 999px;
  padding: 6px 12px; background: var(--card);
}
.status.ok { color: var(--acento); border-color: #34d39955; }
.status.erro { color: var(--erro); border-color: #f8717155; }
.topo-indicadores { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.contador-gcodes[hidden] { display: none !important; }
.contador-gcodes { display: inline-flex; align-items: baseline; gap: 7px; padding: 7px 11px; border: 1px solid #34d39955; border-radius: 999px; color: var(--texto2); background: #34d3990d; font-size: 11px; white-space: nowrap; }
.contador-gcodes strong { color: var(--acento); font-size: 15px; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px clamp(12px, 3vw, 24px) 60px;
  display: grid;
  gap: 20px;
}

.card {
  background: linear-gradient(180deg, #1a2130, var(--card));
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 22px clamp(14px, 2.5vw, 26px);
  box-shadow: 0 10px 30px #00000033;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 18px;
  display: flex; align-items: center; gap: 10px;
}

.num {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  background: #22d3ee1a; color: var(--acento2);
  border: 1px solid #22d3ee44;
}
.num.ok { background: #34d3991a; color: var(--acento); border-color: #34d39955; }

.ajuda { color: var(--texto2); font-size: 14px; line-height: 1.6; margin: 8px 0; }

.marcador { display: grid; gap: 12px; margin: 14px 0; }
.marcador label { display: block; font-size: 13px; color: var(--texto2); margin-bottom: 6px; }

.copiar {
  display: flex; align-items: center; gap: 10px;
  background: #0d1017; border: 1px solid var(--borda);
  border-radius: 10px; padding: 8px 10px;
}
.copiar code {
  flex: 1; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px; color: var(--acento2); overflow-x: auto; white-space: nowrap;
}
.copiar button {
  background: #22d3ee14; color: var(--acento2);
  border: 1px solid #22d3ee44; border-radius: 8px;
  padding: 5px 10px; cursor: pointer; font-size: 12px;
}
.copiar button:hover { background: #22d3ee26; }

.dica, .avancado { margin-top: 14px; }
details summary {
  cursor: pointer; color: var(--texto2); font-size: 14px;
  padding: 8px 0; user-select: none;
}
details summary:hover { color: var(--texto); }
details ul { color: var(--texto2); font-size: 14px; line-height: 1.7; }
details code {
  background: #0d1017; border: 1px solid var(--borda); border-radius: 6px;
  padding: 1px 6px; font-size: 12px; color: var(--acento2);
}

.grade {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; color: var(--texto2); }
.campo small { color: #6b7a94; font-size: 11px; }
.campo.caixa { justify-content: center; gap: 10px; }
.campo.caixa label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--texto); cursor: pointer;
}
input[type="number"], input[type="text"], select, textarea {
  background: #0d1017; color: var(--texto);
  border: 1px solid var(--borda); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; outline: none;
  font-family: inherit;
}
textarea {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px; line-height: 1.5; resize: vertical;
}
input:focus, select:focus, textarea:focus { border-color: #22d3ee88; box-shadow: 0 0 0 3px #22d3ee1a; }
input[type="checkbox"] { accent-color: var(--acento); width: 16px; height: 16px; }

.tag {
  font-size: 10px; color: var(--acento2);
  border: 1px solid #22d3ee33; border-radius: 999px; padding: 2px 8px;
  margin-left: 6px;
}

.solte {
  position: relative;
  border: 2px dashed #2f3d55;
  border-radius: var(--raio);
  padding: 26px;
  text-align: center;
  background: #0d101766;
  transition: .15s;
  margin-bottom: 16px;
  cursor: pointer;
}
.solte:hover, .solte.ativo { border-color: var(--acento); background: #34d3990f; }
.solte input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.solte-texto strong { display: block; font-size: 15px; }
.solte-texto span { display: block; color: var(--texto2); font-size: 13px; margin-top: 4px; }
.arquivo-nome { color: var(--acento) !important; font-weight: 600; }

.acoes { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

button.primario, a.primario {
  background: linear-gradient(135deg, var(--acento), var(--acento2));
  color: #05221b; font-weight: 700; font-size: 15px;
  border: none; border-radius: 12px; padding: 13px 22px;
  cursor: pointer; text-decoration: none; display: inline-block;
}
button.primario:hover, a.primario:hover { filter: brightness(1.08); }
button.primario:disabled { opacity: .5; cursor: not-allowed; }

button.secundario, a.secundario {
  background: transparent; color: var(--texto);
  border: 1px solid var(--borda); border-radius: 12px;
  padding: 13px 18px; cursor: pointer; font-size: 14px;
  text-decoration: none; display: inline-block;
}
button.secundario:hover, a.secundario:hover { border-color: #22d3ee88; color: var(--acento2); }

.barra {
  height: 8px; border-radius: 999px; background: #0d1017;
  border: 1px solid var(--borda); margin-top: 16px; overflow: hidden;
  display: none;
}
.barra.ativa { display: block; }
#barra-preenche {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--acento), var(--acento2));
  transition: width .2s;
}

.erro { color: var(--erro); font-size: 14px; margin: 12px 0 0; white-space: pre-wrap; }

.resultado.escondido { display: none; }
.metricas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.metrica {
  background: #0d1017; border: 1px solid var(--borda);
  border-radius: 12px; padding: 12px 14px;
}
.metrica span { display: block; color: var(--texto2); font-size: 12px; margin-bottom: 4px; }
.metrica strong { font-size: 18px; color: var(--acento); }

.subtitulo-resultado {
  color: var(--texto2); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; margin: 18px 0 10px; grid-column: 1 / -1;
}
.ejetor-resumo {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; padding-top: 2px;
}
.ejetor-metrica {
  background: #101722; border: 1px solid #2a4554;
  border-radius: 10px; padding: 10px 12px;
}
.ejetor-metrica span { display: block; color: var(--texto2); font-size: 11px; margin-bottom: 4px; }
.ejetor-metrica strong { color: var(--acento2); font-size: 15px; }
.faixas-detalhes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.faixa-detalhe {
  background: #0d1017; border: 1px solid var(--borda);
  border-radius: 12px; padding: 13px 14px;
}
.faixa-topo {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding-bottom: 9px; margin-bottom: 4px;
  border-bottom: 1px solid var(--borda);
}
.faixa-topo strong { color: var(--acento); font-size: 16px; }
.faixa-topo span { color: var(--acento2); font-size: 13px; }
.faixa-linha {
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 8px; font-size: 12px;
}
.faixa-linha span { color: var(--texto2); }
.faixa-linha strong { color: var(--texto); font-weight: 600; text-align: right; }

#avisos ul { margin: 0 0 16px; padding-left: 20px; }
#avisos li { color: var(--aviso); font-size: 13.5px; line-height: 1.6; margin-bottom: 6px; }
.baixar { width: 100%; text-align: center; margin-bottom: 10px; }
.pix-doacao[hidden], .pix-qr-area[hidden], .pix-tentar[hidden] { display: none !important; }
.pix-doacao {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid #34d39966;
  border-radius: 14px;
  background: linear-gradient(135deg, #0e2926, #111b2a 72%);
}
.pix-doacao-topo { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.pix-kicker { margin: 0 0 6px; color: var(--acento); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.pix-doacao h3 { margin: 0 0 6px; font-size: 19px; }
.pix-doacao-topo p:last-child { margin: 0; color: var(--texto2); font-size: 13px; line-height: 1.55; }
.pix-doacao-topo p strong { color: var(--acento); }
.pix-valor { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #34d39977; border-radius: 999px; color: var(--acento); font-weight: 800; white-space: nowrap; }
.pix-status { margin: 0; color: var(--texto2); font-size: 13px; }
.pix-qr-area { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); align-items: center; gap: 18px; }
.pix-imagem { display: block; width: 100%; max-width: 220px; aspect-ratio: 1; padding: 8px; border-radius: 12px; background: #fff; object-fit: contain; }
.pix-codigo-wrap { min-width: 0; display: grid; gap: 8px; }
.pix-codigo-wrap label { color: var(--texto); font-size: 12px; font-weight: 700; }
#pix-codigo { width: 100%; min-width: 0; color: var(--texto); background: #0d1017; border: 1px solid var(--borda); border-radius: 8px; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.pix-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pix-copiar, .pix-tentar { min-height: 40px; padding: 9px 14px; border: 1px solid #34d39988; border-radius: 9px; color: #071b17; background: var(--acento); font-size: 13px; font-weight: 750; cursor: pointer; }
.pix-copiar:hover, .pix-tentar:hover { filter: brightness(1.08); }
.pix-acoes span, .pix-copia-status { margin: 0; color: var(--texto2); font-size: 11px; }
.pix-copia-status { min-height: 1.2em; }

.fluxo {
  background: #0d1017; border: 1px solid var(--borda); border-radius: 12px;
  padding: 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.7;
  color: var(--texto2);
}

footer {
  text-align: center; color: #5b6a83; font-size: 12px;
  padding: 20px; border-top: 1px solid var(--borda);
}

@media (max-width: 560px) {
  .topo { position: static; }
  h1 { font-size: 19px; }
  .topo-indicadores { width: 100%; justify-content: space-between; }
  .contador-gcodes { white-space: normal; }
  .pix-doacao-topo { align-items: flex-start; }
  .pix-doacao-topo h3 { font-size: 17px; }
  .pix-valor { padding: 7px 9px; font-size: 12px; }
  .pix-qr-area { grid-template-columns: 1fr; }
  .pix-imagem { width: min(100%, 230px); margin: 0 auto; }
  .pix-copiar, .pix-tentar { width: 100%; }
}
