*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style-type: none;
}

:root{
  --purple: hsl(259, 100%, 65%);
  --light-red: hsl(0, 100%, 67%);
  --white: hsl(0, 0%, 100%);
  --off-white: hsl(0, 0%, 94%);
  --light-grey: hsl(0, 0%, 86%);
  --smokey-grey: hsl(0, 1%, 44%);
  --off-black: hsl(0, 0%, 8%);

  --font: "Poppins", sans-serif;
}

html, body{
  width: 100%;
  min-height: 100vh;
  height: auto;

  background-color: var(--light-grey);
  color: var(--off-black);
  font-family: var(--font);
}

body{
  display: flex;
  align-items: center;
  justify-content: center;
}

main{
  background-color: var(--white);
  border-radius: 1rem 1rem 6.5rem 1rem;

  width: 20rem;
  padding: 2rem 1.25rem;
}

.input-wrapper{
  display: flex;
  justify-content: center;
  gap: 1rem;

  & > .input-group{
    display: flex;
    flex-direction: column;
    gap: .25rem;

    & > label{
      color: var(--smokey-grey);
      font-weight: 700;
      font-size: .75rem;
      text-transform: uppercase;
      letter-spacing: .1875rem;

      &.label-error{
        color: var(--light-red);
      }
    }

    & > input[type="text"]{
      border-radius: .625rem;
      border: .0625rem solid var(--light-grey);
      color: var(--off-black);
      width: 5.25rem;
      height: 3rem;

      font-size: 1.25rem;
      font-weight: 700;
      vertical-align: middle;
      padding: .75rem;

      &:hover{
        border-color: var(--purple);
      }
      
      &:focus{
        outline: none;
        border-color: var(--smokey-grey);
      }

      &.input-error{
        border-color: var(--light-red);
      }
    }

    #error{
      color: var(--light-red);
      font-size: .625rem;
      font-style: italic;
      display: none;
      width: 5.25rem;

      &.show-error{
        display: block;
      }
    }
  }
}

.submit-wrapper{
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block: 2rem;

  & > .line{
    width: 50%;
    height: .0625rem;
    background-color: var(--light-grey);
  }

  & > button[type="submit"]{
    border: none;
    border-radius: 50%;
    background-color: var(--purple);
    cursor: pointer;
    padding: 1rem;

    transition: background-color .3s ease-in-out;
    &:hover{
      background-color: var(--off-black);
    }

    &:focus{
      outline-color: var(--off-black);
    }

    & > img{
      width: 1.25rem;
      height: 1.25rem;
      object-fit: cover;
      vertical-align: top;
    }
  }
}

.calculations{
  & > li{
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.25;
    font-style: italic;
    color: var(--off-black);

    & > span{
      color: var(--purple);
    }
  }
}

@media screen and (width >= 1024px) {
  main{
    width: 32.5rem;
    padding: 2.5rem 2.25rem;
  }

  .input-wrapper{
    justify-content: flex-start;
    gap: 1.25rem;

    & > .input-group{
      & > input[type="text"]{
        width: 6.25rem;
      }

      & > #error{
        width: 6.25rem;
      }
    }
  }

  .submit-wrapper{
    margin-block: 0;

    & > .line{
      flex-grow: 1;
    }

    & > button[type="submit"]{
      & > img{
        width: 1.75rem;
        height: 1.75rem;
      }
    }

    & > .mobile-only{
      display: none;
    }
  }

  .calculations{
    & > li{
      font-size: 3.75rem;
    }
  }
}