form {
  text-align:center;
  margin-left: 28%;
  margin-right: 28%;
}

input,
label,
textarea {
  font-family: "Lato", sans-serif;
  display: block;
  margin: 10px;
  padding: 5px;
  border: none;
  font-size: 22px;
}

textarea:focus,
input:focus {
  outline: 0;
}
/* Question */

input.question,
textarea.question {
  font-size: 36px;
  font-weight: 300;
  border-radius: 2px;
  margin: 0;
  border: none;
  width: 100%;
  background: rgba(0, 0, 0, 0);
  transition: padding-top 0.2s ease, margin-top 0.2s ease;
  overflow-x: hidden; /* Hack to make "rows" attribute apply in Firefox. */
}
/* Underline and Placeholder */

input.question + label,
textarea.question + label {
  display: block;
  position: relative;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  width: 10%;
  border-top: 1px solid #28a745;
  -webkit-transition: width 0.4s ease;
  transition: width 0.4s ease;
  height: 0px;
}

input.question:focus + label,
textarea.question:focus + label {
  width: 100%;
}

input.question:focus,
input.question:valid {
  padding-top: 35px;
}

textarea.question:valid,
textarea.question:focus {
  margin-top: 35px;
}

input.question:focus + label > span,
input.question:valid + label > span {
  top: -85px;
  font-size: 22px;
  color: #333;
}

input.question:valid + label,
textarea.question:valid + label {
  border-color: green;
}

input.question:invalid,
textarea.question:invalid {
  box-shadow: none;
}

input.question + label > span,
textarea.question + label > span {
  font-weight: 300;
  margin: 0;
  position: absolute;
  color: #8F8F8F;
  font-size: 36px;
  top: -56px;
  left: 0px;
  z-index: -1;
  -webkit-transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease;
  transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease;
}

input[type="submit"] {
  -webkit-transition: opacity 0.2s ease, background 0.2s ease;
  transition: opacity 0.2s ease, background 0.2s ease;
  display: block;
  opacity: 0;
  margin: 10px 0 0 0;
  padding: 10px;
  cursor: pointer;
}

input[type="submit"]:hover {
  background: #EEE;
}

input[type="submit"]:active {
  background: #999;
}

input.question:valid ~ input[type="submit"], textarea.question:valid ~ input[type="submit"] {
  -webkit-animation: appear 1s forwards;
  animation: appear 1s forwards;
}

input.question:invalid ~ input[type="submit"], textarea.question:invalid ~ input[type="submit"] {
  display: none;
}

@media (min-width: 576px) {
  input.question,
  textarea.question {
    font-size: 18px;
    width: 100%;
  }

  input.question + label > span,
  textarea.question + label > span {
    font-size: 18px;
    top: -24px;
  }

  input.question:focus + label > span,
  input.question:valid + label > span {
    top: -48px;
    font-size: 14px;
    color: #333;
  }
}

@media (min-width: 768px) {
  input.question,
  textarea.question {
    font-size: 24px;
    width: 100%;
  }

  input.question + label > span,
  textarea.question + label > span {
    font-size: 24px;
    top: -36px;
  }

  input.question:focus + label > span,
  input.question:valid + label > span {
    top: -56px;
    font-size: 16px;
    color: #333;
  }
}

@media (min-width: 992px) {
  input.question,
  textarea.question {
    font-size: 30px;
    width: 100%;
  }

  input.question + label > span,
  textarea.question + label > span {
    font-size: 30px;
    top: -46px;
  }

  input.question:focus + label > span,
  input.question:valid + label > span {
    top: -65px;
    font-size: 18px;
    color: #333;
  }
}


@media (min-width: 1200px) {
  input.question,
  textarea.question {
    font-size: 36px;
    width: 100%;
  }

  input.question + label > span,
  textarea.question + label > span {
    font-size: 36px;
    top: -56px;
  }

  input.question:focus + label > span,
  input.question:valid + label > span {
    top: -85px;
    font-size: 22px;
    color: #333;
  }
}


.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

@-webkit-keyframes appear {
  100% {
    opacity: 1;
  }
}

@keyframes appear {
  100% {
    opacity: 1;
  }
}

