.formContainer > *:first-child { margin-top: 20px; } .formContainer > * { display: block; align-items: center; width: 400px; max-width: 80vw; margin: 10px auto; margin-bottom: 20px; } .formElementContainer label { width: 150px; display: block; font-weight: bold; margin-bottom: 8px; } .formElementContainer input { box-sizing: border-box; width: 100%; min-width: 0; padding: 10px; border: solid 1px rgba(0,0,0,.2); border-radius: 2px; transition-property: border-color,box-shadow; transition: .2s ease-in-out; } .formElementContainer span.hint { display: block; margin-top: 8px; color: red; opacity: 0; transition: .2s opacity; user-select: none; height: 18.5px; } .formElementContainer input.invalid { border: solid 1px red; box-shadow: red; } .formElementContainer input.invalid + span.hint { opacity: .5; } .formElementContainer button { width: 100%; min-height: 20px; background: rgb(156, 39, 176); color: white; padding: 10px 0; border: none; box-shadow: none; transition-property: opacity filter; transition-duration: .2s; } .formElementContainer button[type="submit"] { margin-top: 10px; } .formElementContainer button[disabled] { opacity: .4; filter: saturate(.2); }