/* Sistema visual do console e das paginas de entrada.
   Mesma paleta das telas de TV: escuro, azul como acao. */
:root {
  --bg: #0b0e14;
  --bg-2: #0f131b;
  --surface: #141a25;
  --surface-2: #1a2130;
  --line: #222c3d;
  --line-2: #2d3950;
  --ink: #eef2f8;
  --ink-2: #a3afc2;
  --ink-3: #6b7890;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --r: 12px;
  --r-s: 8px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; }

/* Marca */
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--ink); }
.logo i { width: 22px; height: 16px; border-radius: 4px; background: var(--accent); position: relative; display: inline-block; }
.logo i::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: -4px; height: 2px; background: var(--accent); border-radius: 2px; }

/* Formularios */
label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 6px; }
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-s);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; min-height: 72px; }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.erro { color: #fca5a5; font-size: 13.5px; margin-top: 10px; min-height: 20px; }

/* Botoes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; font: inherit; font-weight: 600; font-size: 14px;
  border-radius: var(--r-s); border: 1px solid transparent; cursor: pointer;
  background: var(--surface-2); color: var(--ink); border-color: var(--line-2);
  transition: background .12s, border-color .12s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: #202a3b; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: #fca5a5; }
.btn.danger:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; width: 34px; height: 34px; }

/* Cartoes e layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Estados */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.dot.rev { background: var(--danger); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.tag.ok { color: #86efac; border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); }
.tag.warn { color: #fcd34d; border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.08); }
.tag.rev { color: #fca5a5; border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.08); }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #1c2434; color: var(--ink); border: 1px solid var(--line-2);
  padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 100; max-width: min(92vw, 520px);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.erro { border-color: rgba(239,68,68,.5); color: #fecaca; }
#toast.ok { border-color: rgba(34,197,94,.5); }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(4,6,10,.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.modal-bg.on { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  transform: translateY(8px); transition: transform .12s;
}
.modal-bg.on .modal { transform: none; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal .body { padding: 18px 22px 22px; }
.modal footer { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 22px; }

/* Codigo de pareamento grande */
.codigo-input {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 30px; font-weight: 700;
  letter-spacing: .32em; text-align: center; text-transform: uppercase; padding: 14px;
}

/* Passos */
.passos { display: grid; gap: 12px; }
.passo { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.passo b { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-size: 13px; }
.passo p { color: var(--ink-2); font-size: 14px; }
.passo p strong { color: var(--ink); font-weight: 600; }

kbd, code.inline {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; color: var(--ink);
}
pre {
  margin: 0; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-s);
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; overflow-x: auto; color: #c9d4e5;
}
