/* ==========================================================================
   ESTILIZAÇÃO DOS INPUTS COM VALIDAÇÃO (GERAL & MODAIS)
   ========================================================================== */

.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper input,
.input-wrapper textarea {
  width: 100%;
  padding: 10px 40px 10px 10px;
  border: 1.8px solid #ced4da;
  border-radius: 6px;
  outline: none;
  transition: 0.2s;
  background-color: #fff;
  font-family: inherit;
  box-sizing: border-box;
}

/* FOCUS estilo Bootstrap */
.input-wrapper input:focus,
.input-wrapper textarea:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* SUCCESS */
.input-wrapper.success input,
.input-wrapper.success textarea {
  border-color: #198754;
}

.input-wrapper.success input:focus,
.input-wrapper.success textarea:focus {
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* ERROR */
.input-wrapper.error input,
.input-wrapper.error textarea {
  border-color: #dc3545;
}

.input-wrapper.error input:focus,
.input-wrapper.error textarea:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ==========================================================================
   MÁSCARA DA ESTRUTURA DO ÍCONE (PREVINE O FORMATO OVAL)
   ========================================================================== */

.input-wrapper .icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  
  /* Mantém as proporções da caixinha do ícone 100% quadradas */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
  pointer-events: none;
}

/* Alinhamento no topo específico para o campo textarea (Descrição) */
.input-wrapper textarea + .icon {
  top: 18px;
  transform: none; 
}

/* Estabiliza e centraliza o desenho real do Font Awesome injetado no before */
.input-wrapper.success .icon::before,
.input-wrapper.error .icon::before {
  display: inline-block;
  text-align: center;
  width: 1em;
  height: 1em;
  line-height: 1;
}

/* INJEÇÃO DO ÍCONE: SUCCESS */
.input-wrapper.success .icon::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f058"; /* fa-circle-check */
  color: #198754;
}

/* INJEÇÃO DO ÍCONE: ERROR */
.input-wrapper.error .icon::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f057"; /* fa-circle-xmark */
  color: #dc3545;
}

