:root {
  --bg: #f3f4f1; --card: #ffffff; --ink: #1c2421; --muted: #5d6a65; --line: #dfe3df;
  --accent: #1f5b4a; --accent-ink: #ffffff; --accent-soft: #e5efeb; --err: #a3271e; --warn-bg: #fff4e0; --warn: #7a4a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614; --card: #1a201e; --ink: #e8ece9; --muted: #9aa7a2; --line: #2c3532;
    --accent: #5fb497; --accent-ink: #0d1412; --accent-soft: #1f2d28; --err: #ff8a80; --warn-bg: #2d2412; --warn: #f0c070;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
}
.card {
  width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 24px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
}
header { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.selo { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; flex: none; }
h1 { font-size: 18px; line-height: 1.3; margin: 0; font-weight: 650; }
h2 { font-size: 20px; margin: 10px 0 4px; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.passos { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: p; }
.passos li { flex: 1; font-size: 13px; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.passos li.ativo { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.passos li.feito { color: var(--accent); border-color: var(--accent); }

label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
input[type=text], input:not([type]), input[type=password] {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 12px; margin-bottom: 16px;
}
#codigo { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; font-size: 17px; }
input:focus-visible, button:focus-visible, .arquivo:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.arquivo { position: relative; display: block; border: 1.5px dashed var(--line); border-radius: 9px;
  padding: 16px 12px; text-align: center; color: var(--muted); font-weight: 500; cursor: pointer; margin-bottom: 16px; }
.arquivo.escolhido { border-style: solid; border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.arquivo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
#nome-arq { word-break: break-all; }

.senha { display: flex; gap: 8px; }
.senha input { margin-bottom: 0; }
.senha + .dica { margin-top: 8px; }

button { font: inherit; font-weight: 600; border: 0; border-radius: 9px; padding: 12px 16px; cursor: pointer;
  width: 100%; background: var(--accent); color: var(--accent-ink); }
button:disabled { opacity: .6; cursor: progress; }
button.fantasma { width: auto; background: transparent; color: var(--accent); border: 1px solid var(--line); flex: none; }

.dica { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.erro { color: var(--err); font-size: 14px; margin: 0 0 12px; min-height: 0; }
.erro:empty { display: none; }
.ola { margin: 0 0 16px; }
.aviso { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 8px; font-size: 14px; }

#pronto { text-align: center; padding: 8px 0 4px; }
.ok { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin: 0 auto; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; margin: 18px 0;
  background: var(--accent-soft); border-radius: 9px; padding: 12px 14px; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; word-break: break-word; }

footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
footer span { color: var(--accent); font-weight: 600; }
.oculto { display: none !important; }
