#formwrapper {
  display: flex; /* CHANGE TO FLEX */
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  justify-content: center;
}

.sidebar.main {
  flex: 2;
  background-color: #29387e;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 2rem;
}

.sidebar.container {
  justify-content: space-evenly;
  display: flex;
  flex-direction: column;
  padding: 15px;
  max-height: 35rem;
  height: 100%;
  margin: 0 auto;
  line-height: 1;
}

.sidebar.container h1 {
  font-weight: lighter;
}

.sidebar.container p {
  font-style: italic;
  font-weight: 500;
  text-align: center;
}

.sidebar.container img {
  width: 60%;
  max-width: 10rem;
  position: relative;
  margin: 0 auto;
}

.sidebar.container svg {
  width: 60%;
  left: 20%;
  fill: #fff;
  position: relative;
}

form {
  width: 330px;
}

#loginform {
  display: flex;
  position: relative;
  margin: 0 auto 3rem;
  flex: 4;
  align-self: center;
  justify-content: space-around;
}

.field {
  display: flex;
  position: relative;
}

.field label {
  width: 40%;
  padding: 4px 0 4px 15px;
  margin-bottom: 11px;
  color: #3b517e;
}

.field input[type=password], .field input[type=text], .field input[type=email] {
  width: 60%;
  border: none;
  top: -2px;
  margin-bottom: 11px;
  padding: 4px 15px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  border-bottom: 1px solid #4871aea0;
}

.field input::placeholder {
    visibility: hidden;
  }
  
.field textarea::placeholder {
    visibility: hidden;
  }

#remember {
  width: 0;
  height: 0;
}

#remember:hover {
  cursor: pointer;
}

#remember::after {
  content: '';
  border-radius: 4px;
  border: 1px solid #4871aea0;
  position: absolute;
  width: 18px;
  height: 18px;
  background-color: #fff;
  top: 1.1rem;
}

#remember:checked::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid #4871ae;
  background-color: #4871ae;
  border-radius: 4px;
  top: 1.1rem;
}

#remember:checked::after {
  content: '';
  position: absolute;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  background-color: transparent;
  border-radius: 0;
  width: 5px;
  height: 11px;
  transform: translate(6px, 1px) rotate(28deg);
  top: 1.1rem;
}

#rememberlabel {
  margin: 15px 0;
}

#rememberlabel:hover {
  cursor: pointer;
}

input[type=radio] {
  display: inline-block;
}

#login, #register {
  display: none;
}

#log, #reg {
  display: block;
  padding-top: 20px;
}

#logdiv, #regdiv {
  transition: opacity .35s;
}



#log {
  padding-top: 40px;
  border: 1px solid #4871aea0;
  border-top: none;
}

#login:checked #log {
  opacity: 1;
}

#login:checked #reg {
  opacity: 0;
}

#register:checked #log {
  opacity: 0;
}

#register:checked #reg {
  opacity: 1;
}

#login + label, #register + label {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  height: 2.6rem;
}

input[type=radio] + label:hover {
  cursor: pointer;
}

input[type=submit], input[type=button] {
  width: 100%;
  padding: 10px 30px;
  margin-top: 20px;
  margin-bottom: 20px;
  display: block;
  position: relative;
  border: none;
  border-radius: 4px;
  background-color: #4871ae;
  color: #eee;
}

input[type=submit]:hover, input[type=button]:hover {
  cursor: pointer;
  background-color: #486693;
}

hr {
  border: none;
  position: relative;
  height: 1px;
  width: 98%;
  left: 1%;
  background-color: #4871aea0;
}

#radios {
  display: flex;
}

#radios label {
  display: block;
  flex-direction: row;
  width: 50%;
  text-align: center;
  background-color: #fff;
  color: #29387e;
  padding: 10px 20px;
  border: 1px solid #4871aea0;
  border-bottom: none;
  transition: all .35s;
}

#radios input:not(:checked) + label {
  color: #4871aea0;
  border: none;
  border-bottom: 1px solid #4871aea0;
  font-size: .9rem;
}

#error {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  position: absolute;
  top: 0;
  bottom: 0;
  width: auto;
  min-width: 330px;
  margin: 0 auto;
  background-color: pink;
  font-size: 1.2rem;
  z-index: 100;
  opacity: 1;
  transition: opacity .35s;
}

#error input {
  margin: 0 15px;
  width: auto;
}

#error p {
  margin: 0 auto;
  color: rgb(230, 71, 71);
}

input:not([type=checkbox]) {
  margin-left: 15px;
  margin-right: 15px;
}

@media(max-width: 50rem) {
  #formwrapper {
    /* display: block;
    min-height: auto; */
  }

  .sidebar.main {
    flex: auto;
    margin-bottom: 3rem;
    padding: 2rem 0;
  }

  .sidebar.container {
    height: auto;
    line-height: 1.4;

  }

  label, input[type='button'], input[type='submit'] {
    font-size: 1.1rem;
    line-height: 1.1rem;
  }

  #radios input:not(:checked) + label {
    line-height: .9rem;
  }

  #radios label {
    text-transform: uppercase;
    line-height: 1.1rem;
    padding-top: 1rem;
  }

  #rememberlabel {
    margin-bottom: 10px;
  }

  .sidebar.container h1{
    font-size: 3rem;
  }
}
