/*CSS Reset*/
*,
::before,
::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  -o-tab-size: 4;
     tab-size: 4;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

ol,
ul,
menu {
  list-style: none;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
}

img,
video {
  height: auto;
  max-inline-size: 100%;
}

legend {
  padding: 0;
  display: table;
}

fieldset {
  border: 0;
  padding: 0.01em 0 0 0;
  margin: 0;
}

input {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

input,
button {
  font-family: inherit;
  font-weight: inherit;
}

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

header {
  display: grid;
  place-items: center;
  height: 10em;
}

.container__all {
  background-color: hsl(0, 0%, 100%);
  padding: 2rem;
  border-radius: 1.5rem 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
form legend {
  font-size: 1rem;
  color: hsl(184, 14%, 56%);
  margin-bottom: 0.375em;
}
form input {
  background-color: hsl(189, 41%, 97%);
  color: hsl(183, 100%, 15%);
  border: none;
  padding: 0 1rem;
  font-size: 1.5rem;
  text-align: end;
  width: 100%;
  height: 3rem;
  border-radius: 5px;
}
form input::-moz-placeholder {
  opacity: 1;
  color: hsl(185, 41%, 84%);
}
form input::placeholder {
  opacity: 1;
  color: hsl(185, 41%, 84%);
}
form input:focus {
  outline-color: hsl(173, 61%, 77%);
}
form .tip__buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

#input__bill {
  background-image: url(./images/icon-dollar.svg);
  background-repeat: no-repeat;
  background-position-x: 0.75em;
  background-position-y: center;
}

#input__people {
  background-image: url(./images/icon-person.svg);
  background-repeat: no-repeat;
  background-position-x: 0.75em;
  background-position-y: center;
}

button {
  height: 3rem;
  width: 100%;
  border: none;
  border-radius: 5px;
  font-size: 1.5rem;
  background-color: hsl(183, 100%, 15%);
  color: hsl(0, 0%, 100%);
}
button:hover {
  background-color: hsl(173, 61%, 77%);
  color: hsl(183, 100%, 15%);
}

.active {
  background-color: hsl(172, 67%, 45%);
}

.container__result {
  background-color: hsl(183, 100%, 15%);
  padding: 1.5rem;
  border-radius: 1em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}
.container__result .result__group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.container__result #button__reset {
  background-color: hsl(172, 67%, 45%);
  color: hsl(183, 100%, 15%);
  cursor: pointer;
}
.container__result .disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.result__item {
  display: flex;
  justify-content: space-between;
}
.result__item p {
  color: hsl(0, 0%, 100%);
}
.result__item p span {
  color: hsl(184, 14%, 56%);
  font-size: 0.8rem;
  display: block;
}
.result__item h1 {
  color: hsl(172, 67%, 45%);
  font-size: 2rem;
}

.error {
  border: 2px solid red;
  outline: none;
}

@media (min-width: 600px) {
  form .tip__buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 960px) {
  body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4em;
  }
  header {
    height: auto;
  }
  .container__all {
    flex-direction: row;
    border-radius: 1.5rem;
    max-width: 920px;
    flex: 1 1;
  }
  .container__calculator,
  .container__result {
    flex-basis: 50%;
  }
  .result__item h1 {
    font-size: 3rem;
  }
}