It is just the combination of bordered rectangle and a differently positioned box-shadow.
We repeat the same for the bottom element but this time the box-shadow has a different position.
I just insert a new bordered rectangle of different height in the middle.
Play around with the minified code: