
.mat-form-field {
  position: relative;
  font-family: Arial, sans-serif;
  margin-bottom: 16px;
  color: black;
}

/* before */
.mat-form-field label {
  display: block;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 12px;
  color: #0047AB;
  font-size: 14px;
  transition: top 0.2s, font-size 0.2s, color 0.2s;
  pointer-events: none;
  background-color: white !important; 
  padding: 0 4px; 
}

.mat-form-field .mat-input {
  width: 100%;
  padding: 15px 16px 5px 16px; /* <-- */
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.mat-form-field .mat-input:focus {
  outline: none;
  border-color: #0096FF;
}

.mat-form-field .mat-input:focus + label,
.mat-form-field .mat-input:not(:placeholder-shown) + label {
  top: 0% !important; /* keep it positioned use !important*/
  font-size: 12px;
  color: #007bff;
  display: block;
}

.mat-form-field .mat-input:valid:not(:focus) + label {
  top: 50%; 
  /* font-size: 16px; */
  color: #5F8575; /* done input */
  background-color: white;
}

/* SELECT CSS */
.mat-form-field select {
  top: 50%;
  width: 100%;
  padding: 16px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.mat-form-field select:focus {
  outline: none;
  border-color: #0437F2;
}

/* Adjust label position when select is focused or has a value */
.mat-form-field select:focus + label {
  top: 0%;
  font-size: 12px;
  color: #0047AB ;
}
.mat-form-field select:not(:focus) + label {
  top: 50%;
  font-size: 14px;
  color: #0047AB;
}

/* Adjust label position when select has a value */
.mat-form-field select:not(:focus):valid + label {
  top: 0%;
  font-size: 12px;
  color: #5F8575; /* done input */
}

.mat-input.invalid-border {
  border-color: red ; /* Border color for invalid email */
}