html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex; /* Make main a flex container */
  flex-direction: column;
}

footer {
  margin-top: auto;
}

.content-hidden {
  display: none;
}

#preloader {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  border: 8px solid #f3f3f3; /* Light grey */
  border-top: 8px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Esconde o contador por padrão */
#contador {
    display: none;
}

/* Estilos para a página de login */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1; /* Faz o container ocupar o espaço disponível na tag <main> */
}

.login-box {
  width: 100%;
  max-width: 450px;
  background: #ffffff;
  /* Opcional: border: 1px solid #dee2e6; */
}

/* Estilos para os inputs de código */
.code-input {
  width: 45px;
  height: 45px;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  -moz-appearance: textfield; /* Remove spinners in Firefox */
}

/* Remove setas de incremento/decremento em Chrome/Safari/Edge */
.code-input::-webkit-outer-spin-button,
.code-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Ajustes para Toastr */
#toast-container > div {
    opacity: 1; /* Ligeiramente menos opaco que o padrão, ou ajuste conforme necessário */
    -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
    filter: alpha(opacity=100);
}

#toast-container > .toast-success {
    background-color: rgba(92, 184, 92, 1); /* Verde de sucesso do Bootstrap com opacidade */
    color: #fff;
}

#toast-container > .toast-error {
    background-color: rgba(217, 83, 79, 1); /* Vermelho de erro do Bootstrap com opacidade */
    color: #fff;
}

#toast-container > .toast-info {
    background-color: rgba(91, 192, 222, 1); /* Azul de informação do Bootstrap com opacidade */
    color: #fff;
}

#toast-container > .toast-warning {
    background-color: rgba(240, 173, 78, 1); /* Laranja de aviso do Bootstrap com opacidade */
    color: #fff;
}

/* Estilos para o card de candidato */
.candidato-card {
    cursor: pointer;
    transition: all 0.3s ease-in-out; /* Transição suave para todas as propriedades */
    border: 1px solid #dee2e6; /* Borda padrão */
}

/* Card selecionado */
.candidato-card.selected {
  border: 3px solid #007bff; /* Borda azul */
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
  transform: scale(1.03); /* Aumenta um pouco o tamanho */
}

/* Cards não selecionados (apenas quando há uma seleção ativa) */
#candidatos-list.selection-active .candidato-card:not(.selected) {
  filter: grayscale(100%); /* Preto e branco */
  opacity: 0.7; /* Diminui a opacidade */
  transform: scale(0.97); /* Diminui um pouco o tamanho */
}

/* Estilos para o container de agradecimento */
.agradecimento-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1; /* Faz o container ocupar o espaço disponível na tag <main> */
}

.agradecimento-box {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Download preloader "fofo" */
#download-preloader {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.92);
  z-index: 11000;
  display: none;
  justify-content: center;
  align-items: center;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.download-box {
  background: linear-gradient(135deg,#fff 0%, #fff 60%);
  padding: 20px 28px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.download-emoji {
  font-size: 44px;
  line-height: 1;
}

.download-spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #ff6b6b;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: spin 1s linear infinite;
}

.download-text {
  font-weight: 600;
  color: #333;
  text-align: center;
  font-size: 14px;
}

@media (max-width:480px){
  .download-box{ min-width: 200px; padding:16px }
  .download-emoji{ font-size:36px }
}