* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Poppins', sans-serif;
  font-style: normal;

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  justify-items: center;
  align-items: center;
  height: 100dvh;

  background-image: url('./images/bg-intro-desktop.png');
  background-color: hsl(0, 100%, 74%);
}

/* left container */

.left-container {
  padding-left: 15rem;
}

.left-container-text {
  display: flex;
  flex-direction: column;

  justify-content: space-between;
  align-items: center;

  height: 180px;
  width: 480px;
}

.left-container-heading {
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 2.6rem;

  margin-right: 8rem;
}

.left-container-description {
  color: white;
  font-size: 0.8rem;

  letter-spacing: 0.01rem;
  line-height: 1.4rem;
  opacity: 0.8;
  font-weight: 400;

  margin-right: 2rem;
}

/* right container, the form */

.right-container {
  padding-right: 15rem;

  /* this flex is applying to all the input boxes */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

/* call to action bar */

.right-container-cta {
  height: 50px;
  width: 450px;

  border-radius: 8px;

  background-color: hsl(248, 32%, 49%);
  color: white;

  display: flex;
  justify-content: center;
  align-items: center;

  font-size: 0.8rem;
  box-shadow: 0px 6px 0px rgba(0, 0, 0, 0.2);
}

.right-container-cta span:first-of-type {
  font-weight: 600;
}

.right-container-cta span:last-of-type {
  opacity: 0.8;
}

/* form */

.right-container-form {
  width: 450px;

  padding: 30px;
  border-radius: 8px;

  background-color: white;
  box-shadow: 0px 6px 0px rgba(0, 0, 0, 0.2);
}

/* this is inside the form element */
/* and it arranges the input boxes with flex */
.input-boxes-container {
  height: 350px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.right-container-form input {
  height: 55px;
  width: 100%;
  display: block;

  border-radius: 5px;
  text-indent: 1rem;

  border-width: 1px;
  border-color: hsl(246, 25%, 90%);
  border-style: solid;

  font-family: 'Poppins', sans-serif;
  font-style: normal;
  font-weight: 500;
}

.right-container-form input:focus {
  outline: solid hsl(248, 32%, 90%);
}

/* note: managing via js */
/* .right-container-form input.invalid:focus {
  outline: 0.125rem solid hsl(0, 100%, 74%);
} */

.right-container-form button {
  height: 45px;

  background-color: hsl(154, 59%, 51%);
  border-color: hsl(154, 59%, 45%);
  border-width: 2px;
  border-radius: 5px;
  border-style: solid;

  text-transform: uppercase;
  color: white;
  font-weight: 600;

  cursor: pointer;
}

/* terms of service */

.tiny-text-tos {
  font-size: 8px;
  font-weight: 600;

  text-align: center;

  margin-top: 10px;
}

.tiny-text-tos span:first-of-type {
  opacity: 0.3;
}

.tiny-text-tos span:last-of-type {
  color: hsl(0, 100%, 74%);
}

/* form error styling */

.first-name-container {
  position: relative;
}

.last-name-container {
  position: relative;
}

.email-address-container {
  position: relative;
}

.password-container {
  position: relative;
}

.error-text {
  display: none;
  font-size: 0.65rem;
  font-weight: 500;
  font-style: italic;
  text-align: end;

  position: absolute;
  top: 55px;
  right: 0px;

  color: hsl(0, 100%, 74%);
}

.error-icon {
  display: none;
  position: absolute;
  top: 50%;
  right: 0%;
  transform: translate(-50%, -50%);
}

.show {
  display: block;
}

@media (max-width: 500px) {
  html {
    font-size: 12px;
  }

  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    justify-content: center;
    align-content: center;
    background-image: url('./images/bg-intro-mobile.png');
    background-repeat: no-repeat;
    gap: 2rem;

    min-height: 100dvh;
    height: auto;
  }

  /* left container */

  .left-container {
    margin-top: 2rem;
    padding-left: 0;
  }

  .left-container-text {
    width: 300px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 30px;
  }

  .left-container-heading {
    font-size: 2rem;
    text-align: center;
    margin: 0;
  }

  .left-container-description {
    font-size: 1.1rem;
    text-align: center;
    width: 260px;
    margin: 0;
  }

  .right-container {
    padding-right: 0;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
  }

  /* call to action bar */

  .right-container-cta {
    height: 80px;
    width: 300px;

    display: block;
    text-align: center;
    padding: 20px;

    font-size: 1.1rem;
  }

  .right-container-cta span:first-of-type {
    font-weight: 600;
  }

  .right-container-cta span:last-of-type {
    opacity: 0.8;
  }

  /* form */

  .right-container-form {
    width: 300px;

    padding: 20px;
    border-radius: 8px;

    background-color: white;
  }

  /* this is inside the form element */
  /* and it arranges the input boxes with flex */
  .input-boxes-container {
    height: 300px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .right-container-form input {
    height: 45px;
    width: 100%;
    display: block;

    border-radius: 5px;
    text-indent: 1rem;

    border-width: 1px;
    border-color: hsl(246, 25%, 90%);
    border-style: solid;

    font-family: 'Poppins', sans-serif;
    font-style: normal;
    font-weight: 500;
  }

  .right-container-form input:focus {
    outline: solid hsl(248, 32%, 90%);
  }

  /* note: managing via js */
  /* .right-container-form input.invalid:focus {
  outline: 0.125rem solid hsl(0, 100%, 74%);
} */

  .right-container-form button {
    height: 42px;

    background-color: hsl(154, 59%, 51%);
    border-color: hsl(154, 59%, 45%);
    border-width: 2px;
    border-radius: 5px;
    border-style: solid;

    text-transform: uppercase;
    color: white;
    font-weight: 600;

    cursor: pointer;
  }

  .error-text {
    font-size: 0.65rem;
    font-weight: 500;
    font-style: italic;
    text-align: end;

    position: absolute;
    top: 45px;
    right: 0px;

    color: hsl(0, 100%, 74%);
  }
}
