/* =========================
   Botão "Checklist" na tela de login — mesma regra visual aplicada a
   #btn-guest-access (styles-base.css), pra ficar idêntico ao "Agendar /
   Importar sem login" (peso de fonte, altura, espessura de borda).
   ========================= */
#btn-checklist-guest {
  min-height: 46px;
  border-width: 1.5px;
  font-weight: 800;
}

/* Os modais de Parâmetro/Template envolvem header+body+footer num <form>
   (precisa pro botão "Salvar" disparar o submit nativo). Isso quebra o
   flex-column que o Bootstrap usa em .modal-dialog-scrollable pra fazer só
   o .modal-body rolar — o <form> vira um bloco normal no meio do flex,
   sem repassar a estrutura. Restaura a cadeia flex aqui. */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* =========================
   CHECKLIST — preenchimento público (tela cheia)
   ========================= */
#checklist-guest-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background: var(--page-bg);
  overflow-y: auto;
}

#checklist-guest-gate.d-none { display: none; }

/* Banner de topo — mesmo gradiente de marca do painel visual da tela de
   login (styles-base.css #login-gate .login-brand-panel), pra não entrar
   uma tela nova "sem identidade" no meio do fluxo. */
.checklist-guest-banner {
  width: 100%;
  flex: none;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px clamp(24px, 6vw, 64px);
  background: linear-gradient(150deg, var(--brand-blue) 0%, var(--brand-blue-2) 50%, var(--brand-purple) 100%);
  color: #fff;
}

.checklist-guest-banner-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  flex: none;
}

.checklist-guest-banner-kicker {
  font: 700 11px var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .8;
}

.checklist-guest-banner-title {
  font: 800 20px/1.2 var(--font-display);
}

/* Botão fixo no banner, sempre visível nas duas etapas — único caminho de
   volta pro login (o botão de "voltar" dentro do conteúdo é só contextual,
   entre lista <-> formulário). */
.checklist-guest-banner-login-btn {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: 700 13px var(--font-display);
  transition: background .15s ease, border-color .15s ease;
}

.checklist-guest-banner-login-btn:hover {
  background: rgba(255, 255, 255, .18);
  border-color: #fff;
  color: #fff;
}

.checklist-guest-inner {
  width: 100%;
  max-width: 960px;
  padding: 32px 24px 48px;
}

.checklist-guest-inner .section-card {
  padding: 28px 32px;
}

/* Botão "voltar" — mesma linguagem visual dos botões da tela de login
   (#btn-guest-access / #btn-checklist-guest: outline azul, peso 800). */
.checklist-guest-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  min-height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--brand-blue);
  background: #fff;
  color: var(--brand-blue);
  font: 800 13.5px var(--font-display);
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease;
}

.checklist-guest-back-btn:hover {
  background: #f5f8ff;
  box-shadow: 0 4px 12px rgba(21, 25, 42, .06);
  color: var(--brand-blue);
}

.checklist-guest-back-btn i {
  font-size: 14px;
}

/* Barra de progresso "X de Y campos preenchidos" — topo do formulário. */
.checklist-guest-progresso {
  margin-bottom: 18px;
}

.checklist-guest-progresso-linha {
  display: flex;
  justify-content: space-between;
  font: 700 12.5px var(--font-display);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.checklist-guest-progresso-trilha {
  height: 6px;
  border-radius: 999px;
  background: var(--divider);
  overflow: hidden;
}

.checklist-guest-progresso-barra {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
  transition: width .25s ease;
}

/* Seções numeradas ("02 — CELULAR CORPORATIVO"), campos empilhados. */
.checklist-secao {
  margin-bottom: 22px;
}

.checklist-secao:last-child {
  margin-bottom: 0;
}

.checklist-secao-titulo {
  font: 800 12px var(--font-display);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--brand-purple);
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}

.checklist-secao-numero {
  color: var(--text-muted-light);
}

.checklist-campo-item {
  margin-bottom: 14px;
}

.checklist-campo-item:last-child {
  margin-bottom: 0;
}

/* Caixa que aparece quando a condição do campo pai é satisfeita. */
.checklist-nested-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--surface);
}

/* Toggle Sim/Não/opções em formato de botão (padrão pesquisa.grupogarbo.com.br). */
.checklist-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checklist-toggle-btn {
  border-radius: 10px !important;
  border: 1.5px solid var(--card-border) !important;
  color: var(--text-secondary) !important;
  background: #fff !important;
  font: 700 13.5px var(--font-display);
  padding: 8px 20px;
}

.btn-check:checked + .checklist-toggle-btn {
  border-color: var(--brand-blue) !important;
  color: var(--brand-blue) !important;
  background: #eef3ff !important;
}

/* Stepper numérico -/valor/+ */
.checklist-stepper {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.checklist-stepper-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--brand-blue);
  background: #fff;
  color: var(--brand-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}

.checklist-stepper-btn:hover {
  background: #eef3ff;
}

.checklist-stepper-valor {
  min-width: 24px;
  text-align: center;
  font: 800 16px var(--font-display);
  color: var(--text-dark);
}

.checklist-card-clickable,
.checklist-resposta-card-clickable {
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}

.checklist-resposta-card-clickable:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  transform: translateY(-1px);
}

/* Miniaturas de anexos-imagem no modal de detalhe da resposta. */
.checklist-anexo-imagens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.checklist-anexo-imagem-thumb {
  width: 100%;
  height: 100px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.checklist-anexo-imagem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity .15s ease;
}

.checklist-anexo-imagem-img:hover {
  opacity: .85;
}

.checklist-lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.checklist-anexo-imagem-nome {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.checklist-card-clickable .ger-card-icon {
  background: var(--brand-blue);
  font-size: 18px;
}

.checklist-card-clickable:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  transform: translateY(-1px);
}

/* =========================
   CHECKLIST — aba admin (Respostas / Parâmetros / Novo Checklist)
   ========================= */
#checklist-template-campos-wrap [data-checklist-campo-row]:last-child,
#checklist-parametro-valores-wrap [data-checklist-valor-row]:last-child {
  margin-bottom: 0;
}

/* Imagens de referência do campo, no editor de template (até 4, lado a lado). */
.checklist-campo-imagens-admin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checklist-campo-imagem-admin-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  flex: none;
}

.checklist-campo-imagem-admin-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: opacity .15s ease;
}

.checklist-campo-imagem-admin-item img:hover {
  opacity: .85;
}

.checklist-campo-imagem-admin-remover {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.checklist-campo-imagem-admin-remover:hover {
  background: rgba(178, 58, 32, .9);
}

.checklist-campo-imagem-admin-add {
  width: 72px;
  height: 72px;
  flex: none;
  border: 1.5px dashed var(--card-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  margin: 0;
  transition: border-color .15s ease, color .15s ease;
}

.checklist-campo-imagem-admin-add:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

/* Widget do campo tipo "arquivo" no formulário público (e no preview do
   admin): lista os arquivos já escolhidos (nome + extensão) com botão de
   remover cada um; "Escolher" acrescenta à lista em vez de substituir. */
.checklist-arquivo-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-arquivo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}

.checklist-arquivo-item-nome {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checklist-arquivo-item-remover {
  flex: none;
  /* 32px visual, mas a área de toque real chega a 44px (padrão mínimo de
     toque em mobile) via ::after invisível — o checklist é preenchido no
     campo, no celular, então o alvo de toque importa mais que no admin. */
  position: relative;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.checklist-arquivo-item-remover::after {
  content: "";
  position: absolute;
  inset: -6px;
}

.checklist-arquivo-item-remover:hover {
  background: #FDE4DC;
  color: #B23A20;
}

/* Imagens de referência exibidas no formulário público (lado a lado, acima do controle do campo). */
.checklist-campo-imagens-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.checklist-campo-imagem-ref {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  cursor: pointer;
}

.checklist-campo-imagem-ref img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .15s ease;
}

.checklist-campo-imagem-ref:hover img {
  opacity: .85;
}

/* Lightbox do formulário público — overlay simples sem depender de
   bootstrap.bundle.js (a página standalone /checklist não o carrega). */
.checklist-guest-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 20, .9);
}

.checklist-guest-lightbox.d-none {
  display: none;
}

.checklist-guest-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
  display: block;
}

.checklist-guest-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.checklist-guest-lightbox-close:hover {
  background: rgba(255, 255, 255, .18);
  border-color: #fff;
}
