:root {
  --ink: #080b10;
  --ink-deep: #04060a;
  --panel: #11161f;
  --panel-raised: #161d29;
  --line: #232b38;
  --line-soft: #1a212c;
  --paper: #edf1f7;
  --muted: #8792a6;
  --muted-dim: #5c6577;

  /* Sinal do checkpoint — azul, a cor de marca do site */
  --signal: #2f7dff;
  --signal-dim: rgba(47, 125, 255, 0.12);
  --signal-line: rgba(47, 125, 255, 0.35);

  --good: #3ddc84;
  --good-dim: rgba(61, 220, 132, 0.12);
  --danger: #ff5a52;
  --danger-dim: rgba(255, 90, 82, 0.12);
  --warning: #f5a524;
  --warning-dim: rgba(245, 165, 36, 0.1);

  /* Marcas — mantidas fiéis às cores oficiais de cada etapa */
  --steam-ink: #1b2838;
  --steam-accent: #66c0f4;
  --discord: #5865f2;
  --discord-hover: #4752eb;
  --verify: #e8a020;
  --verify-hover: #c98818;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.6);

  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--paper);
  background:
    radial-gradient(circle at 18% -10%, rgba(47, 125, 255, 0.1), transparent 42%),
    radial-gradient(circle at 100% 110%, rgba(88, 101, 242, 0.07), transparent 45%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
}

#qr-code { display: block; }

a:link, a:visited {
  color: var(--signal);
  text-decoration: none;
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
}

/* ---------- Cartão (crachá de checkpoint) ---------- */
.card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__head {
  text-align: center;
  padding: 30px 28px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.card__subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  transition: all ease 0.3s;
}

.content {
  position: relative;
  padding: 26px 28px 32px;
  border-top: 1px solid var(--line);
}

/* ---------- Indicador de etapas ---------- */
.steps {
  list-style: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin-bottom: 30px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step::before {
  content: "0" attr(data-step-indicator);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--muted-dim);
  transition: color 0.35s ease;
}

.step__bullet {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink-deep);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.35s ease;
}

.step__label {
  font-size: 10px;
  color: var(--muted);
  transition: color 0.35s ease;
}

.step__line {
  flex: 1;
  max-width: 32px;
  height: 1px;
  background: var(--line);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.step__line::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--signal);
  transition: width 0.4s ease;
}

.step__line.is-filled::after { width: 100%; }

.step.is-active::before { color: var(--signal); }

/* Steam ativo */
.step.is-active .step__bullet.steam {
  color: var(--steam-accent) !important;
  background: rgba(27, 40, 56, 0.9) !important;
  border: 1px solid var(--steam-accent) !important;
  box-shadow: 0 0 0 4px rgba(102, 192, 244, 0.15);
}

/* Discord ativo */
.step.is-active .step__bullet.discord {
  color: #fff !important;
  background: var(--discord) !important;
  border: 1px solid var(--discord) !important;
  box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.15);
}

/* Verify ativo */
.step.is-active .step__bullet.verify {
  color: #fff !important;
  background: var(--verify) !important;
  border: 1px solid var(--verify) !important;
  box-shadow: 0 0 0 4px rgba(232, 160, 32, 0.15);
}

/* Conclusão ativo */
.step.is-active .step__bullet {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink-deep);
  box-shadow: 0 0 0 4px var(--signal-dim);
}

.step.is-active .step__label { color: var(--paper); }

.step.is-done .step__bullet {
  background: var(--panel-raised);
  border-color: var(--signal-line);
  color: var(--signal);
}
.step.is-done::before { color: var(--signal); opacity: 0.6; }

.step.is-done .step__bullet.steam,
.step.is-done .step__bullet.discord,
.step.is-done .step__bullet.verify {
  opacity: 0.55;
}

/* ---------- Painéis ---------- */
.panel {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fade-in 0.45s ease both;
  width: 100%;
}

.panel.is-active { display: flex; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel__icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: #fff;
}

.panel__icon--success { background: var(--good-dim); color: var(--good); }

.panel__title { font-size: 21px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.01em; }

.panel__text {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 340px;
  margin-bottom: 22px;
}

/* ---------- Botões ---------- */
.btn {
  width: 100%;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { cursor: default; opacity: 0.85; }

.btn--steam {
  background: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);
  border: 1px solid var(--steam-accent);
  box-shadow: 0 10px 24px rgba(102, 192, 244, 0.2);
  color: var(--steam-accent);
}
.btn--steam:hover:not(:disabled) {
  background: linear-gradient(135deg, #2a475e 0%, #1b2838 100%);
  box-shadow: 0 10px 28px rgba(102, 192, 244, 0.35);
}

.btn--discord { background: var(--discord); box-shadow: 0 10px 24px rgba(88, 101, 242, 0.3); }
.btn--discord:hover:not(:disabled) { background: var(--discord-hover); }

.btn--verify {
  background: var(--verify);
  box-shadow: 0 10px 24px rgba(232, 160, 32, 0.3);
  margin-top: 16px;
}
.btn--verify:hover:not(:disabled) { background: var(--verify-hover); }

.btn--primary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-top: 18px;
  height: 44px;
  font-size: 13px;
  font-weight: 600;
}
.btn--primary:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

/* Spinner */
.btn.is-loading [data-label] { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alertas ---------- */
.alert {
  width: 100%;
  margin-top: 18px;
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  text-align: left;
  background: var(--panel-raised);
  border: 1px solid var(--line);
}

.alert__icon { flex-shrink: 0; margin-top: 1px; }
.alert__text { font-size: 12.5px; line-height: 1.55; color: var(--muted); }

.alert--steam {
  border-color: rgba(102, 192, 244, 0.3);
  background: rgba(27, 40, 56, 0.5);
}
.alert--steam .alert__icon { color: var(--steam-accent); }

.alert--discord {
  border-color: rgba(88, 101, 242, 0.35);
  background: rgba(88, 101, 242, 0.08);
}
.alert--discord .alert__icon { color: var(--discord); }

.alert--warning {
  margin-top: 0;
  border-color: rgba(232, 160, 32, 0.35);
  background: var(--warning-dim);
}
.alert--warning .alert__icon { color: var(--verify); }

.alert--info {
  margin-top: 10px;
  border-color: var(--signal-line);
  background: var(--signal-dim);
}
.alert--info .alert__icon { color: var(--signal); }

/* ---------- Verificação de identidade ---------- */
.verify-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.doc-type-selector { width: 100%; margin-bottom: 16px; }

.doc-type-label {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--muted-dim);
  margin-bottom: 8px;
  text-align: left;
}

.doc-type-options { display: flex; gap: 10px; }

.doc-type-btn {
  flex: 1;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.doc-type-btn.is-selected {
  border-color: var(--verify);
  background: rgba(232, 160, 32, 0.12);
  color: var(--verify);
}

.doc-type-btn:hover:not(.is-selected) {
  border-color: var(--muted);
  color: var(--paper);
}

/* Grid de uploads */
.upload-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.upload-item--selfie { grid-column: 1 / -1; }

.upload-item--full { grid-column: 1 / -1; }
.upload-item--full .upload-preview { height: 160px; }

.upload-label { display: block; cursor: pointer; width: 100%; }

.upload-preview {
  width: 100%;
  height: 110px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.upload-item--selfie .upload-preview { height: 440px; }

.upload-label:hover .upload-preview,
.upload-label:active .upload-preview {
  border-color: var(--verify);
  background: rgba(232, 160, 32, 0.06);
}

.upload-icon { font-size: 22px; color: var(--muted); }

.upload-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}

.upload-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.upload-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--good);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-deep);
  font-weight: 700;
}

.upload-hint {
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.75;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---------- Relay: handoff PC → celular ---------- */
/* Etapa 3 no computador vira um posto de escaneamento — o QR é a moldura
   ativa e o status abaixo é a única fonte de verdade sobre o andamento no
   celular (nada aqui pode ser clicado, só observado). */
.relay {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.relay__frame {
  position: relative;
  width: 176px;
  height: 176px;
  padding: 14px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  background: var(--ink-deep);
}

.relay__frame img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  display: block;
}

.relay__corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--signal);
  opacity: 0.85;
}
.relay__corner--tl { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.relay__corner--tr { top: -1px; right: -1px; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.relay__corner--bl { bottom: -1px; left: -1px; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.relay__corner--br { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

.relay__scan {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--signal), transparent);
  box-shadow: 0 0 12px 1px var(--signal);
  animation: relay-scan 2.2s ease-in-out infinite;
}

@keyframes relay-scan {
  0%, 100% { top: 12px; opacity: 0; }
  10% { opacity: 1; }
  50% { top: calc(100% - 14px); opacity: 1; }
  90% { opacity: 1; }
}

.relay.is-active .relay__frame { box-shadow: 0 0 0 4px var(--signal-dim); }
.relay.is-sending .relay__scan { animation-duration: 0.9s; }
.relay.is-sending .relay__corner { border-color: var(--verify); }
.relay.is-sending .relay__frame { box-shadow: 0 0 0 4px var(--warning-dim); }
.relay.is-done .relay__scan { display: none; }
.relay.is-done .relay__corner { border-color: var(--good); }
.relay.is-done .relay__frame { box-shadow: 0 0 0 4px var(--good-dim); }

.relay__status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
}

.relay__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 var(--signal-dim);
  animation: relay-pulse 1.6s ease-in-out infinite;
}

.relay.is-sending .relay__dot { background: var(--verify); }
.relay.is-sending .relay__status { color: var(--verify); border-color: rgba(232, 160, 32, 0.3); }
.relay.is-done .relay__dot { background: var(--good); animation: none; }
.relay.is-done .relay__status { color: var(--good); border-color: rgba(61, 220, 132, 0.3); }

@keyframes relay-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(86, 224, 201, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(86, 224, 201, 0); }
}

/* ---------- Sucesso ---------- */
.check__circle {
  stroke: var(--good);
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw-circle 0.6s ease forwards;
}
.check__mark {
  stroke: var(--good);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: draw-mark 0.4s 0.5s ease forwards;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-mark { to { stroke-dashoffset: 0; } }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast--visible { transform: translateY(0); opacity: 1; }
.toast--success { border-left-color: var(--good); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast--info { border-left-color: var(--signal); }

.toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-weight: 800;
  border-radius: 50%;
  font-size: 0.8rem;
}

.toast--success .toast__icon { background-color: var(--good-dim); color: var(--good); }
.toast--error .toast__icon { background-color: var(--danger-dim); color: var(--danger); }
.toast--warning .toast__icon { background-color: var(--warning-dim); color: var(--warning); }
.toast--info .toast__icon { background-color: var(--signal-dim); color: var(--signal); }

.toast__body { flex: 1; font-size: 0.88rem; }
.toast__title { font-weight: 700; margin-bottom: 2px; }
.toast__message { color: var(--muted); font-size: 0.82rem; }

.toast__close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}
.toast__close:hover { color: var(--paper); }

/* ---------- Rodapé ---------- */
.footer-note {
  cursor: default;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--muted-dim);
  text-align: center;
}

/* ---------- Alerta de erro ---------- */
.alert__error {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  cursor: default;
  margin-bottom: 20px;
}
.alert__error .fa-brands, .alert__error .mark {
  color: var(--paper);
  text-transform: uppercase;
}

/* ---------- Utilitários ---------- */
.brand .logo { width: 160px; margin-bottom: 4px; }

.loading { animation: spin 2s ease-in-out infinite; color: var(--signal); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ink-deep); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 50px; }
::-webkit-scrollbar-thumb:hover { background: var(--signal); }

::-moz-selection { color: var(--ink-deep); background: var(--signal); }
::selection { color: var(--ink-deep); background: var(--signal); }

.captcha {
  width: 100%;
  max-width: 100%;
  display: none;
  justify-content: center;
  margin-bottom: 20px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 480px) {
  .card__head { padding: 26px 20px 20px; }
  .content { padding: 22px 20px 26px; }
  .step__line { max-width: 22px; }
  .step__label { font-size: 9px; }
}

.panel__text .username { font-weight: bold; color: var(--paper); }

/* ---------- Câmera Customizada ---------- */
.camera-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#camera-video {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
}
#camera-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
}
.camera-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.contour {
  border: 3px dashed #fff;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
  transition: border-color 0.3s;
}
.contour.success {
  border-color: var(--good);
  border-style: solid;
}
.contour.doc {
  width: 85%;
  height: 55%;
  max-width: 400px;
  max-height: 250px;
}
.contour.selfie {
  width: 85%;
  height: 55%;
  max-width: 360px;
  max-height: 480px;
  border-radius: 45% 45% 50% 50% / 42% 42% 58% 58%;
}
.camera-instructions {
  margin-top: 35px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  padding: 0 20px;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
  z-index: 10;
}
.btn-close-camera {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}
.btn-manual-capture {
  position: absolute;
  bottom: 40px;
  background: var(--signal);
  color: var(--ink-deep);
  border: none;
  padding: 16px 32px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-manual-capture:active { transform: scale(0.95); }
