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

body {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  background-color: hsl(185, 41%, 84%);
}

article {
  display: flex;
  justify-content: space-between;
  background-color: hsl(0, 100%, 100%);
  margin: 90px auto;
  max-width: 923px;
  padding: 32px 32px 32px 50px;
  border-radius: 20px;
}

main {
  padding-top: 168px;
  padding-bottom: 150px;
}

.logo {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  height: 56px;
}

form {
  width: 380px;
  margin-bottom: 17px;
}

form input {
  font-size: 24px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  background: hsl(189, 47%, 97%);
  border: none;
}

button {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  width: 100%;
  font-size: 20px;
  padding: 9px;
  border-radius: 5px;
  background-color: hsl(172, 67%, 45%);
  color: hsl(183, 100%, 15%);
}

button:disabled {
  background-color: hsla(172, 67%, 45%, 0.3);
  color: hsla(183, 100%, 15%, 0.3);
}

input[type=text], input[type=number] {
  display: block;
  text-align: end;
  color: hsl(183, 100%, 15%);
  padding: 5px 20px;
  height: 47px;
  border-radius: 5px;
  width: 100%;
  margin-top: 7px;
}
input[type=text]:invalid, input[type=number]:invalid {
  border: 3px solid #e6a795;
}

input[type=text]:focus, input[type=number]:focus {
  border: 3px solid hsl(172, 67%, 45%);
  outline: none;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

input[type=radio] {
  width: 0;
}

::-moz-placeholder {
  color: hsl(184, 14%, 56%);
  opacity: 70%;
}

::placeholder {
  color: hsl(184, 14%, 56%);
  opacity: 70%;
}

fieldset {
  border: none;
  margin-top: 40px;
  margin-bottom: 40px;
}

.bill-input {
  background-image: url("../images/icon-dollar.svg");
  background-repeat: no-repeat;
  background-position: 20px 15px;
}

.num-of-people-input {
  background-image: url("../images/icon-person.svg");
  background-repeat: no-repeat;
  background-position: 20px 15px;
}

input.percentage-input {
  width: 100%;
  margin-top: 0px;
  padding: 5px 10px;
}
input.percentage-input::-moz-placeholder {
  color: hsl(183, 100%, 15%);
  text-align: left;
}
input.percentage-input::placeholder {
  color: hsl(183, 100%, 15%);
  text-align: left;
}

ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
  margin-top: 17px;
}

li label {
  background-color: hsl(183, 100%, 15%);
  color: hsl(0, 100%, 100%);
  text-align: center;
  border-radius: 5px;
  font-size: 24px;
  padding: 5px 0 7px;
  margin-top: 0;
}

li label:hover, li label:focus {
  color: hsl(183, 100%, 15%);
  background-color: #9ee8df;
  outline: none;
}

.selected-tip {
  color: hsl(183, 100%, 15%);
  background-color: hsl(172, 67%, 45%);
}

label, legend {
  display: block;
  color: hsl(186, 14%, 43%);
  margin-top: 14px;
}

legend {
  width: 100%;
}

.tip-container {
  background-color: hsl(183, 100%, 15%);
  color: hsl(0, 100%, 100%);
  font-size: 16px;
  padding: 42px 40px 40px;
  border-radius: 15px;
  width: 415px;
}

.amount-container {
  display: flex;
  justify-content: space-between;
}

.amount-container:first-of-type {
  margin-bottom: 25px;
}

.amount-container p {
  color: hsl(172, 67%, 45%);
  font-size: 47px;
}

.tip-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.per-person {
  font-size: 13px;
  color: hsl(184, 14%, 56%);
}

.reset-button {
  border: none;
  margin-top: 123px;
}
.reset-button:not([disabled]):hover {
  color: hsl(183, 100%, 15%);
  background-color: #9ee8df;
  outline: none;
}

.error-msg {
  float: inline-end;
  color: #e48275;
}

@media screen and (max-width: 950px) {
  article {
    padding: 20px;
  }
  form {
    width: 47%;
  }
  .tip-container {
    padding: 35px 20px 25px;
    width: 50%;
  }
}
@media screen and (max-width: 711px) {
  main {
    padding-top: 50px;
    padding-bottom: 0px;
  }
  article {
    display: block;
    margin-top: 40px;
    margin-bottom: 0px;
    padding: 20px;
  }
  form {
    width: 100%;
    margin-bottom: 35px;
    padding-left: 8px;
    padding-right: 8px;
  }
  fieldset {
    margin: 30px 0;
  }
  ul {
    grid-template-columns: repeat(2, 1fr);
  }
  #percentageInput::-moz-placeholder {
    text-align: right;
  }
  #percentageInput::placeholder {
    text-align: right;
  }
  .tip-container {
    width: 100%;
    padding: 35px 20px 25px;
  }
  .amount-container p {
    font-size: 2rem;
  }
  .reset-button {
    margin-top: 30px;
  }
}