@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");

* {
  font-family: "Space Mono", monospace;
}

body {
  background-color: hsl(185, 41%, 84%);
  height: 100vh;
}

.back {
  position: absolute;
  top: 0px;
  left: 0px;
  padding: 30px 80px;
  text-decoration: none;
  font-size: 24px;
  display: flex;
  align-items: center;
  color: black;
}
.back ion-icon {
  height: 32px;
  width: 32px;
  margin-right: 10px;
}


.container {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.box {
  background-color: hsl(0, 0%, 100%);
  width: 800px;
  height: 400px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  margin-bottom: 60px;
}

.input {
  flex-direction: column;
  width: 340px;
  height: 340px;
  margin: 25px;
  margin-right: 15px;
  padding: 10px;
}

.result {
  background-color: hsl(183, 100%, 15%);
  flex-direction: column;
  border-radius: 20px;
  width: 300px;
  height: 300px;
  margin: 20px;
  margin-left: 15px;
  padding: 30px;
}

.bill-input,
.people-input {
  display: flex;
  flex-direction: row;
  width: 340px;
  background-color: hsl(189, 41%, 97%);
  position: absolute;
  border-radius: 4px;
}

.bill-input:hover,
.people-input:hover,
.bill-input:active,
.people-input:active {
  border: 2px solid hsl(172, 67%, 45%);
}

.bill-amount,
.people-number {
  margin-left: auto;
  padding-right: 15px;
  margin-top: 5px;
  font-weight: bold;
  color: hsl(183, 68%, 23%);
  font-size: 20px;
  background-color: hsl(189, 41%, 97%);
  border: none;
  text-align: right;
  cursor: pointer;
  width: 100%;
  height: 36px;
}

.bill-amount:focus,
.people-number:focus,
.bill-amount:active,
.people-number:active {
  color: hsl(183, 68%, 23%);
  outline: none;
}

.error .people-input {
  border: 1px solid red;
}

.error .emsg-people {
  visibility: visible;
}

.emsg-people {
  color: red;
  font-size: 12px;
  visibility: hidden;
}

.brabra {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.error .bill-input {
  border: 1px solid red;
}

.error .emsg-bill {
  visibility: visible;
}

.emsg-bill {
  color: red;
  font-size: 12px;
  visibility: hidden;
  font-weight: bold;
}

.tip-button {
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 10px;
  margin-top: 10px;
}

.percent {
  background-color: hsl(183, 100%, 15%);
  border-radius: 4px;
  box-shadow: none;
  border: 1px solid;
  color: hsl(0, 0%, 100%);
  width: 107px;
  height: 45px;
  font-weight: bold;
  font-size: 20px;
  cursor: pointer;
}

.percent:hover,
.percent-active:focus,
.percent-active {
  background-color: hsl(172, 67%, 45%);
  color: hsl(183, 100%, 15%);
  border: none;
}

/* .bill-image, .people-image {
        background-color: hsl(189, 41%, 97%);
        border-radius: 2px;
        height: 25px;
        margin-bottom: 20px;
        color: hsl(183, 100%, 15%);
    } */

label {
  font-size: 12px;
  color: grey;
  margin-top: 5px;
  margin-bottom: 5px;
  font-weight: bold;
}

.result h2 {
  color: hsl(0, 6%, 90%);
  margin-bottom: 0px;
  margin-top: 20px;
  font-size: 12px;
  font-weight: bold;
}

.result p {
  font-size: 12px;
  color: hsl(184, 14%, 56%);
  margin-top: 0px;
  margin-bottom: 43px;
  font-weight: bold;
}

.result button {
  background-color: hsl(183, 68%, 23%);
  width: 300px;
  color: rgba(70, 67, 67, 0.356);
  border: none;
  margin-top: 70px;
  border-radius: 4px;
  box-shadow: none;
  height: 45px;
  font-weight: bold;
  font-size: 20px;
}

.reset:enabled {
  background-color: hsl(172, 67%, 45%);
  color: hsl(183, 100%, 15%);
  cursor: pointer;
}

.logo img {
  margin: 70px;
  height: 45px;
  justify-items: center;
  margin-top: 0px;
  position: static;
}

img {
  height: 15px;
  margin: 13px;
  position: absolute;
}

#tip-section {
  margin-top: 70px;
  margin-bottom: 20px;
}

#custom {
  background-color: hsl(189, 41%, 97%);
  border: none;
  width: 100px;
  height: 42px;
  font-weight: bold;
  font-size: 20px;
  border-radius: 4px;
  box-shadow: none;
  text-align: right;
  color: hsl(183, 68%, 23%);
  cursor: pointer;
}
#custom:hover,
#custom:active {
  border: 1px solid hsl(172, 67%, 45%);
  text-align: right;
  color: hsl(183, 68%, 23%);
  place-content: none;
}

#custom::placeholder {
  color: hsl(183, 68%, 23%);
  text-align: center;
}

#tip-amount,
#total {
  display: flex;
  flex-direction: row;
  width: 300px;
  height: 90px;
}

.amount {
  color: hsl(172, 67%, 45%);
  font-weight: bold;
  font-size: 40px;
  margin-left: auto;
  padding-top: 10px;
}

.total-amount {
  color: hsl(172, 67%, 45%);
  font-weight: bold;
  font-size: 40px;
  margin-left: auto;
  padding-top: 10px;
}

@media screen and (max-width: 840px) {
  .container {
    justify-content: end;
    margin-top: 120px;
  }
  .back{
    padding: 15px;
  }

  .box {
    display: flex;
    flex-direction: column;
    width: 375px;
    height: 720px;
    margin-bottom: 0px;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
  }

  .attribution {
    visibility: hidden;
  }

  .logo {
    display: none;
  }

  .input {
    width: 320px;
    margin-bottom: 70px;
    margin-top: 15px;
  }

  .result {
    width: 310px;
    height: 230px;
    padding: 10px;
    margin: 15px;
  }

  .bill-input,
  #tip-section,
  .people-input {
    width: 315px;
    margin-bottom: 20px;
  }

  .result p {
    font-size: 14px;
    margin-bottom: 0px;
  }

  h2 {
    font-size: 16px;
    margin: 0px;
    margin-bottom: 5px;
  }

  #tip-amount,
  #total {
    height: 70px;
    margin-left: 15px;
  }

  .amount,
  .total-amount {
    margin-right: 15px;
  }

  .result button,
  .reset:enabled {
    width: 280px;
    margin-left: 15px;
    margin-top: 30px;
  }

  .tip-button {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    column-gap: 15px;
    row-gap: 15px;
    margin-top: 15px;
  }

  .percent {
    width: 150px;
    height: 50px;
    border-radius: 5px;
    font-size: 24px;
  }

  img {
    height: 18px;
  }

  .bill-amount,
  .people-number {
    font-size: 26px;
  }

  #custom {
    width: 145px;
    height: 48px;
    font-size: 24px;
  }
}
