@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");
:root {
  --ff-body: "Space Mono", monospace;
  --fs-body: 24rem;
  /* Primary */
  --clr-strongCyan: rgb(38, 192, 171);
  /* Neutral */
  --clr-veryDarkCyan: hsl(183, 100%, 15%);
  --clr-darkGrayishCyan: hsl(186, 14%, 43%);
  --clr-darkGrayishCyan2: hsl(184, 14%, 56%);
  --clr-lightGrayishCyan: hsl(185, 41%, 84%);
  --clr-lightGrayishCyan2: hsl(189, 41%, 97%);
  --clr-white: hsl(0, 0%, 100%);
  scroll-behavior: smooth;
}

* {
  padding: 0;
  margin: 0;
  border: 0;
}

*,
*::before,
*::after {
  margin: 0;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

img {
  display: block;
  width: 100%;
  -webkit-user-drag: none;
}

ul,
li {
  list-style-type: none;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--ff-body-s);
}

html {
  font-size: 6.25%;
  min-width: 320px;
}

body {
  font-size: var(--fs-body);
  font-weight: 400;
  font-family: var(--ff-body);
  color: var(--clr-veryDarkCyan);
  background: var(--clr-lightGrayishCyan);
  line-height: 1.4;
  -webkit-transition: 0.5s;
  transition: 0.5s;
}

main {
  padding: 40rem 30rem;
  background: var(--clr-white);
  border-radius: 25px;
  max-width: 1000rem;
  margin-inline: auto;
}

.logo {
  max-width: 90rem;
  margin-inline: auto;
  padding-block: 50rem;
}

h1,
h2,
h3 {
  font-size: 17rem;
  margin-bottom: 5rem;
  color: var(--clr-darkGrayishCyan);
}

h2:nth-of-type(1) {
  margin-bottom: 15rem;
}

.calc__data {
  padding-inline: 15rem;
}

.calc__data .block__error {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
}

.calc__data .zero__error {
  color: red;
  opacity: 0;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}

.calc__data .zero__error.show {
  opacity: 1;
}

.bill__total,
.number__people {
  position: relative;
  margin-bottom: 30rem;
  border-radius: 5rem;
}

.bill__total .input,
.number__people .input {
  width: 100%;
  height: 50rem;
  padding: 8rem 15rem;
  background: var(--clr-lightGrayishCyan2);
  border-radius: 5rem;
  font-size: 28rem;
  font-family: inherit;
  color: var(--clr-veryDarkCyan);
  font-weight: 700;
  text-align: right;
  caret-color: var(--clr-strongCyan);
}

.bill__total img,
.number__people img {
  content: "";
  position: absolute;
  height: 18rem;
  width: 10rem;
  top: 50%;
  left: 22rem;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
}

.bill__total img.person,
.number__people img.person {
  height: 18rem;
  width: 14rem;
}

.tip__percent {
  display: -ms-grid;
  display: grid;
  gap: 15rem;
  -ms-grid-columns: 1fr 1fr;
      grid-template-columns: 1fr 1fr;
  margin-bottom: 30rem;
}

.tip__percent input {
  background: var(--clr-lightGrayishCyan2);
  padding-inline: 15rem;
  width: 100%;
  height: 100%;
  color: var(--clr-veryDarkCyan);
  font-family: var(--ff-body);
  font-size: 23rem;
  text-align: right;
  caret-color: var(--clr-strongCyan);
}

.tip__percent > * {
  text-align: center;
  background: var(--clr-veryDarkCyan);
  color: var(--clr-white);
  border-radius: 5rem;
  font-weight: 700;
  padding-block: 8rem;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}

.tip__percent > div:hover {
  background: var(--clr-lightGrayishCyan);
  color: var(--clr-veryDarkCyan);
}

.tip__percent > div._active {
  background: var(--clr-strongCyan);
}

.calc__result {
  background: var(--clr-veryDarkCyan);
  color: var(--clr-strongCyan);
  padding: 40rem 25rem 25rem;
  border-radius: 15rem;
}

.calc__result .reset__btn {
  height: 50rem;
  width: 100%;
  border-radius: 5rem;
  background: var(--clr-strongCyan);
  opacity: 0.15;
  font-family: inherit;
  text-transform: uppercase;
  font-size: 21rem;
  font-weight: 700;
  color: var(--clr-veryDarkCyan);
  -webkit-transition: 0.3s;
  transition: 0.3s;
  pointer-events: none;
}

.calc__result .reset__btn p {
  letter-spacing: 1.4rem;
}

.calc__result .reset__btn._active {
  pointer-events: visible;
  opacity: 1;
}

.calc__result .reset__btn._active:hover {
  background: var(--clr-lightGrayishCyan);
}

.result__block {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  margin-bottom: 20rem;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

.result__block h3 {
  color: var(--clr-darkGrayishCyan2);
  font-size: 14rem;
  letter-spacing: 1.2;
}

.result__block span {
  color: var(--clr-white);
  font-size: 17rem;
}

.result__block .sum {
  font-weight: 700;
  font-size: 32rem;
}

.result__block:nth-of-type(2) {
  margin-bottom: 30rem;
}

.hidden {
  position: absolute;
  height: 0;
  opacity: 0;
  visibility: hidden;
}

input:focus::-webkit-input-placeholder {
  color: transparent;
  -webkit-transition: color 0.3s ease;
  transition: color 0.3s ease;
}

input:focus:-moz-placeholder {
  /* Firefox 18- */
  color: transparent;
  -webkit-transition: color 0.2s ease;
  transition: color 0.2s ease;
}

input:focus::-moz-placeholder {
  /* Firefox 19+ */
  color: transparent;
  -webkit-transition: color 0.2s ease;
  transition: color 0.2s ease;
}

input:focus:-ms-input-placeholder {
  color: transparent;
  -webkit-transition: color 0.2s ease;
  transition: color 0.2s ease;
}

input[type="text"] {
  outline: none;
}

input[type="text"]:focus,
input[type="text"]:hover {
  -webkit-box-shadow: 0px 0px 5px #26c0ab;
          box-shadow: 0px 0px 5px #26c0ab;
}

.number__people._red {
  -webkit-box-shadow: 0px 0px 5px #c02626;
          box-shadow: 0px 0px 5px #c02626;
}

.number__people._red input[type="text"]:focus,
.number__people._red input[type="text"]:hover {
  -webkit-box-shadow: 0px 0px 5px #c02626;
          box-shadow: 0px 0px 5px #c02626;
}

.number__people._red input[type="text"] {
  caret-color: red;
}

input[type="text"]._error {
  -webkit-box-shadow: 0px 0px 5px #c02626;
          box-shadow: 0px 0px 5px #c02626;
}

@media (min-width: 850px) {
  main {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 30rem;
    -webkit-box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px;
            box-shadow: rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px;
  }
  main h2:nth-of-type(1) {
    margin-bottom: 7rem;
  }
  main > * {
    -webkit-box-flex: 1;
        -ms-flex: 1 1 100%;
            flex: 1 1 100%;
  }
  .bill__total {
    margin-bottom: 40rem;
  }
  .logo {
    max-width: 100rem;
    padding-top: 100rem;
    padding-bottom: 60rem;
  }
  .tip__percent {
    gap: 12rem;
    -ms-grid-columns: 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr;
    margin-bottom: 40rem;
  }
  .number__people {
    margin-bottom: 15rem;
  }
  .result__block .sum {
    font-size: 40rem;
  }
  .result__block:nth-of-type(1) {
    margin-bottom: 40rem;
  }
  .result__block:nth-of-type(2) {
    margin-bottom: 113rem;
  }
  .calc__result {
    padding-inline: 40rem;
  }
  .calc__result h3 {
    margin-bottom: 0;
  }
}
