/* Custom File Input - Essencial para Bootstrap 4 */

.custom-file {
  position: relative;
  display: inline-block;
  width: 100%;
  height: calc(2.25rem + 2px); /* Altura padrão de um input do Bootstrap */
  margin-bottom: 0;
}

.custom-file-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: calc(2.25rem + 2px);
  margin: 0;
  opacity: 0; /* Oculta o input real */
}

.custom-file-input:focus ~ .custom-file-label {
  border-color: #80bdff; /* Cor da borda ao focar */
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Sombra ao focar */
}

.custom-file-input:disabled ~ .custom-file-label {
  background-color: #e9ecef; /* Cor de fundo quando desabilitado */
}

.custom-file-label {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: calc(2.25rem + 2px);
  padding: 0.375rem 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  box-shadow: inset 0 0.2em 0.4em rgba(0, 0, 0, 0.05); /* Sombra interna */
}

.custom-file-label::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3; /* Para ficar acima do label */
  display: block;
  height: calc(2.25rem + 2px);
  padding: 0.375rem 0.75rem;
  line-height: 1.5;
  color: #495057;
  content: "Browse"; /* Texto do botão "Browse" */
  background-color: #e9ecef;
  border-left: 1px solid #ced4da;
  border-radius: 0 0.25rem 0.25rem 0;
}

/* Tradução para Português (opcional, mas recomendado) */
.custom-file-label[data-browse]::after {
  content: attr(data-browse);
}
/* Para usar a tradução, adicione data-browse="Localizar arquivo" ao label */
/* Ex: <label class="custom-file-label" for="pra_foto" data-browse="Localizar arquivo">Escolher arquivo</label> */