/* Tela de entrar do GoatFlow. Mesma identidade da tela principal
   (interface/web/style.css): escuro quente, dourado, vidro. */

:root {
  --bg-0: #08070a;
  --gold-0: #b8860b;
  --gold-1: #d4af37;
  --gold-2: #f5d76e;
  --gold-3: #fff3a0;
  --ouro-vivo: #f4c430;
  --ouro-texto: #f7d665;
  --red-1: #b91c1c;
  --red-2: #ef4444;
  --text-0: #f5f5f0;
  --text-1: #d4d4d0;
  --text-2: #9ca3af;
  --text-3: #6b7280;
  --borda: rgba(255, 230, 150, 0.12);
  --borda-forte: rgba(255, 230, 150, 0.25);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(212, 175, 55, 0.35); color: #fff; }

html, body { min-height: 100%; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  color: var(--text-0);
  background:
    radial-gradient(ellipse 900px 600px at 50% 18%, rgba(212, 175, 55, 0.075), transparent 62%),
    radial-gradient(ellipse 1200px 700px at 20% -10%, rgba(212, 175, 55, 0.05), transparent 60%),
    radial-gradient(ellipse 900px 600px at 80% 100%, rgba(212, 161, 74, 0.025), transparent 60%),
    linear-gradient(180deg, #0a0805 0%, #050403 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.so-leitor {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- palco e painel ---------------------------------------------------- */

.palco {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 16px;
}

.painel {
  position: relative;
  width: min(410px, 100%);
  padding: 30px 30px 26px;
  border: 1px solid rgba(244, 196, 48, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(29, 27, 22, 0.97), rgba(10, 10, 13, 0.98) 55%);
  box-shadow:
    0 28px 85px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.025),
    0 0 42px rgba(212, 175, 55, 0.07);
}

/* fio dourado no topo, igual aos modais do GoatFlow */
.painel::before {
  content: "";
  position: absolute;
  inset: 0 12% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ouro-vivo) 42%, #ffe795 58%, transparent);
  box-shadow: 0 0 15px rgba(244, 196, 48, 0.55);
}

/* ---- marca ------------------------------------------------------------- */

.marca {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--borda);
}

.marca-logo {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-0));
  box-shadow: 0 4px 18px -4px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 243, 160, 0.4);
}
.marca-logo img {
  width: 26px; height: 26px; object-fit: contain;
  filter: brightness(0) invert(0.08);
}

.marca-texto { display: flex; flex-direction: column; gap: 2px; }
.marca-nome {
  font-weight: 800; font-size: 17px; letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.marca-sub { font-size: 10px; color: var(--text-3); letter-spacing: 1.2px; text-transform: uppercase; }

/* ---- passos ------------------------------------------------------------ */

.passo { display: flex; flex-direction: column; gap: 18px; }
.passo.entrando { animation: entrar 320ms var(--ease) both; }

@keyframes entrar {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.titulo { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.titulo h1, .titulo p { text-wrap: balance; }
.titulo h1 { font-size: 21px; font-weight: 700; color: #fff; letter-spacing: -0.2px; }
.titulo p { font-size: 13px; line-height: 1.55; color: var(--text-2); }

.titulo-compacto h1 { display: none; }
.titulo-compacto p { font-size: 12.5px; color: var(--text-1); }
#passo-qr + #passo-codigo:not([hidden]) { margin-top: 18px; }

.etiqueta {
  padding: 3px 9px;
  border: 1px solid rgba(244, 196, 48, 0.3);
  border-radius: 999px;
  background: rgba(244, 196, 48, 0.08);
  color: var(--ouro-texto);
  font-size: 10px; font-weight: 700; letter-spacing: 0.9px; text-transform: uppercase;
}

/* ---- campo da chave ---------------------------------------------------- */

.campo { display: flex; flex-direction: column; gap: 8px; }
.campo-topo { display: flex; align-items: baseline; justify-content: space-between; }
.campo label { font-size: 12px; font-weight: 600; color: var(--text-1); }
.contador {
  font: 600 11px 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color: var(--text-3);
  transition: color 180ms ease;
}
.contador.completo { color: var(--ouro-texto); }
.dica { font-size: 11.5px; color: var(--text-2); }

.caixa-chave {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(6, 6, 9, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.caixa-chave:focus-within {
  border-color: rgba(244, 196, 48, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}
.caixa-chave.erro, .digitos.erro input { border-color: rgba(239, 68, 68, 0.6); }

.caixa-chave input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 4px 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-0);
  font: 600 14px 'JetBrains Mono', ui-monospace, Consolas, monospace;
  letter-spacing: 0.04em;
  caret-color: var(--gold-2);
}
.caixa-chave input::placeholder { color: #4b4a45; }

.botao-olho {
  width: 44px; height: 44px;
  margin-right: 2px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.botao-olho:hover { color: var(--gold-2); background: rgba(212, 175, 55, 0.07); }
.botao-olho svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.botao-olho .olho-fechado { display: none; }
.botao-olho[aria-pressed="true"] .olho-aberto { display: none; }
.botao-olho[aria-pressed="true"] .olho-fechado { display: block; }


/* ---- digitos do codigo ------------------------------------------------- */

.digitos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
}
.digitos input {
  width: 46px; height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(6, 6, 9, 0.72);
  color: #fff;
  text-align: center;
  font: 700 22px 'JetBrains Mono', ui-monospace, Consolas, monospace;
  caret-color: var(--gold-2);
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.digitos input:focus {
  border-color: rgba(244, 196, 48, 0.6);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}
.digitos input.preenchido { border-color: rgba(244, 196, 48, 0.3); background: rgba(244, 196, 48, 0.05); }
.digitos-meio { width: 8px; height: 2px; border-radius: 2px; background: var(--text-3); opacity: 0.5; }
.digitos.tremer { animation: tremer 360ms ease; }

@keyframes tremer {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ---- QR (mesmo estilo do QR de pagamento do GoatFlow) ------------------ */

.qr-cartao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 12px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.038), transparent 36%),
    rgba(6, 6, 9, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.qr-moldura {
  width: min(100%, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(154, 107, 8, 0.2);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38), 0 0 28px rgba(212, 175, 55, 0.09);
}
.qr-moldura canvas, .qr-moldura img { display: block; width: 100%; height: 100%; }

.qr-manual { width: 100%; font-size: 12px; color: var(--text-2); }
.qr-manual summary {
  list-style: none;
  cursor: pointer;
  text-align: center;
  color: var(--text-2);
  padding: 4px;
  border-radius: 6px;
  transition: color 160ms ease;
}
.qr-manual summary::-webkit-details-marker { display: none; }
.qr-manual summary:hover, .qr-manual[open] summary { color: var(--ouro-texto); }
.qr-segredo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 8px 8px 12px;
  border: 1px dashed rgba(244, 196, 48, 0.28);
  border-radius: 9px;
  background: rgba(244, 196, 48, 0.04);
}
.qr-segredo code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font: 600 12.5px 'JetBrains Mono', ui-monospace, Consolas, monospace;
  letter-spacing: 0.08em;
  color: var(--ouro-texto);
}

/* ---- botoes ------------------------------------------------------------ */

.botao {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease), opacity 180ms ease;
}

.botao-ouro {
  width: 100%;
  height: 48px;
  color: #1a1a0a;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-0));
  border-color: rgba(255, 243, 160, 0.4);
  box-shadow: 0 4px 18px -4px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 243, 160, 0.5);
}
.botao-ouro:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px -4px rgba(212, 175, 55, 0.65), inset 0 1px 0 rgba(255, 243, 160, 0.6);
}
.botao-ouro:active:not(:disabled) { transform: translateY(0); }
.botao:disabled { cursor: default; box-shadow: none; }
.botao-ouro:disabled:not(.carregando) {
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
}
.botao.carregando { opacity: 1; }
.botao.carregando .botao-texto { opacity: 0.75; }

.botao-fantasma {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.botao-fantasma:hover { color: var(--ouro-texto); border-color: rgba(244, 196, 48, 0.35); }
.botao-mini { height: 30px; padding: 0 12px; font-size: 11.5px; font-weight: 600; flex: 0 0 auto; }

.giro {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(26, 26, 10, 0.25);
  border-top-color: #1a1a0a;
  border-radius: 50%;
  animation: girar 700ms linear infinite;
}
.carregando .giro { display: inline-block; }
@keyframes girar { to { transform: rotate(360deg); } }

.link {
  align-self: center;
  margin-top: -6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease;
}
.link:hover { color: var(--ouro-texto); }

:focus-visible { outline: 2px solid rgba(244, 196, 48, 0.75); outline-offset: 2px; }
.caixa-chave input:focus-visible, .digitos input:focus-visible { outline: 0; }

/* ---- PC em uso --------------------------------------------------------- */

.alerta-ico {
  align-self: center;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: 1px solid rgba(244, 196, 48, 0.36);
  border-radius: 14px;
  background: rgba(244, 196, 48, 0.095);
  color: var(--ouro-texto);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 0 26px rgba(212, 175, 55, 0.12);
}
.alerta-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- aviso ------------------------------------------------------------- */

.aviso {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  background: rgba(185, 28, 28, 0.1);
  color: #fca5a5;
  font-size: 12.5px;
  line-height: 1.5;
  animation: entrar 260ms var(--ease) both;
}
.aviso svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---- rodape ------------------------------------------------------------ */

.rodape {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.3px;
}
.rodape svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---- telas pequenas e movimento reduzido ------------------------------- */

@media (max-width: 420px) {
  .painel { padding: 24px 18px 20px; }
  .caixa-chave input { font-size: 13px; padding-left: 12px; }
  .digitos { gap: 6px; }
  .digitos input { width: 40px; height: 50px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* App, nao navegador: o texto da tela nao se seleciona com o mouse; so os campos de
   digitar (busca, formularios, anotacoes) e o que a tela marca para copiar. */
html, body { -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable]:not([contenteditable="false"]) {
  -webkit-user-select: text;
  user-select: text;
}
