/* ==========================================================================
   style.css — visual de todo o app (tela de captura + painel admin)
   Mobile-first: pensado primeiro para o celular, depois adaptado ao desktop.
   ========================================================================== */

:root {
  --azul: #2563eb;
  --azul-escuro: #1d4ed8;
  --cinza: #e5e7eb;
  --cinza-texto: #6b7280;
  --verde: #16a34a;
  --vermelho: #dc2626;
  --raio: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f3f4f6;
  color: #111827;
  -webkit-tap-highlight-color: transparent; /* tira o flash azul ao tocar no celular */
}

.escondido { display: none !important; }

/* ---------- Tela de captura ---------- */
.tela {
  max-width: 480px;
  margin: 0 auto;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  text-align: center;
}

/* ---------- Logo da empresa ---------- */
/* Logo na tela de captura (topo, acima do título). */
.logo {
  max-width: 220px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* Logo na caixa de login do admin. */
.logo-login { max-width: 200px; max-height: 80px; margin: 0 auto 4px; }
/* Logo no cabeçalho do admin: pequena e alinhada ao lado do texto. */
.logo-cabecalho {
  max-height: 32px;
  max-width: 120px;
  vertical-align: middle;
  margin-right: 8px;
}

.titulo { font-size: 1.6rem; }
.instrucao { color: var(--cinza-texto); font-size: 1.1rem; }

.etapa {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ---------- Botões ---------- */
.botao {
  border: none;
  border-radius: var(--raio);
  padding: 14px 22px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}
.botao:active { transform: scale(0.97); }
.botao:disabled { opacity: 0.6; cursor: not-allowed; }

.botao-grande { width: 100%; padding: 22px; font-size: 1.4rem; }

.botao-primario { background: var(--azul); color: #fff; }
.botao-primario:hover { background: var(--azul-escuro); }

.botao-secundario { background: var(--cinza); color: #111827; }

.linha-botoes { display: flex; gap: 12px; width: 100%; }
.linha-botoes .botao { flex: 1; }

/* ---------- Pré-visualização ---------- */
.preview {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--raio);
  border: 2px solid var(--cinza);
  background: #fff;
}

/* ---------- Mensagens ---------- */
.mensagem {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: var(--raio);
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.mensagem.sucesso { background: var(--verde); }
.mensagem.erro { background: var(--vermelho); }

.rodape { text-align: center; padding: 16px; }
.rodape a { color: var(--cinza-texto); font-size: 0.9rem; }

/* ==========================================================================
   Painel administrativo
   ========================================================================== */
.admin { background: #f9fafb; }

.login-box {
  max-width: 360px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: var(--raio);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.campo {
  padding: 12px;
  border: 1px solid var(--cinza);
  border-radius: 8px;
  font-size: 1rem;
}

.cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--cinza);
}
.link-voltar { color: var(--azul); text-decoration: none; font-weight: 600; }

.barra-ferramentas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
}
.campo-inline { padding: 8px; border: 1px solid var(--cinza); border-radius: 8px; }
.barra-ferramentas .botao { padding: 8px 14px; font-size: 0.95rem; }
.separador { flex: 1; }

.contador { padding: 0 24px 8px; color: var(--cinza-texto); }

/* ---------- Galeria ---------- */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 0 24px 40px;
}

.card {
  position: relative;
  background: #fff;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 4px;
}
.card-check input { width: 20px; height: 20px; cursor: pointer; }
.card-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: var(--cinza-texto);
}
.card-info strong { color: #111827; font-size: 0.85rem; }

/* ---------- Modal (imagem ampliada) ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  z-index: 50;
}
.modal-img { max-width: 95%; max-height: 80vh; object-fit: contain; border-radius: 8px; }
.modal-fechar {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}
.modal-download { text-decoration: none; }
