.labeled-field {
  position: relative;
  margin-bottom: 35px;
}

.labeled-field__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.labeled-field__label-text {
  @include mainBodyText;
  margin-bottom: 25px;
}

.labeled-field__input {
  display: block;
  box-sizing: border-box;
  width: 300px;
  height: 50px;
  font-family: inherit;
  text-align: center;
  font-size: 17px;
  line-height: 36px;
  color: $text-main;
  background-color: $bg-accent;
  border: 1px solid rgba(208, 209, 209, 0.8);
  border-radius: 25px;
  transition: all 0.3s ease;

  &::placeholder {
    color: $gray-medium;
  }

  &:invalid:not(:placeholder-shown),
  .labeled-field--invalid & {
    color: $red;
    background-color: rgba(255, 0, 0, 0.1);
    border-color: $red;
  }

  &:hover {
    background-color: #F2F2F2;
    border-color: #D7D8D7;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
  }

  &:focus {
    background-color: $bg-accent;
    border-color: #D7D8D7;
    box-shadow: none;
    outline: none;

    &::placeholder {
      color: rgba(201, 199, 199, 0.5);
    }
  }
}

.labeled-field__error-message {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 5px);
  display: block;
  width: 800px;
  max-width: 100%;
  font-size: 16px;
  line-height: 30px;
  color: $red;
}
