https://codepen.io/yuheiy/pen/oNzKZOr

以下の記事に解説あり

垂直方向のマージンにはmargin-topを優先的に使う理由

.stack {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.stack > * + * {
	margin-top: 1.5rem;
}

.stack > :nth-child(2) {
	margin-bottom: auto;
}

末尾の要素の前にmargin-bottom: autoを指定すると、要素の高さに関わらず次に来る要素が下部に揃うようになる。