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

:root {
    /*Primary color*/
    --Green-400: hsl(172, 67%, 45%);
    /*Neutral color*/
    --Green-900: hsl(183, 100%, 15%);
    --Grey-500: hsl(186, 14%, 43%);
    --Grey-400: hsl(184, 14%, 56%);
    --Grey-200: hsl(185, 41%, 84%);
    --Grey-50: hsl(189, 47%, 97%);
    --White: hsl(0, 100%, 100%);
}

body {
    font-family: 'Space Mono', Arial, Helvetica, sans-serif;
    height: 100vh;
    font-size: 0.75rem;
    font-weight: 700;
}

button, input {
    cursor: pointer;
    padding: 5px 10px;
    border: none;
    outline: none;
    border-radius: 5px;
    font-family: 'Space Mono';
    font-size: 18px;
    font-weight: 700;
}

button:hover {
    background-color: var(--Grey-200) !important;
    color: var(--Green-900) !important;
}

input {
    text-align: right;
    width: 100%;
    background-color: var(--Grey-50);
    color: var(--Green-900);
}

input::placeholder {
    color: var(--Grey-400);
}

input:focus {
    outline: 2px solid var(--Green-400);
}

span {
    margin-bottom: 5px;
    color: hsl(4, 100%, 67%);
    visibility: hidden;
}

span.active {
    visibility: visible;
}


main {
    height: 100%;
    overflow: hidden;
    background-color: var(--Grey-200);
}

main > img {
    object-fit: cover;
    display: block;
    margin: 15px auto;
    height: 50px;
    transform-origin: bottom;
    animation: popUp 2s ease-in-out forwards;
}

main .calculator-container {
    background-color: var(--White);
    height: calc(100% -  80px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 15px;
    overflow: hidden;
    transform: translateY(200vh);
    animation: slideUp 1s ease-in 0.9s forwards;
}

.calculator-container .section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section.input h3{
    color: var(--Grey-500);
    margin-bottom: 5px;
}

.section.input .input-form {
    position: relative;
}

.input-form img {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}

.section.input .tip input,
.section.input .tip button {
    height: fit-content;
}

.tip .options .active {
    background-color: var(--Green-400);
}

.tip input::placeholder {
    color: var(--Grey-500);
    text-align: center;
}

.tip button {
    background-color: var(--Green-900);
    color: var(--Grey-50);
}

.tip .options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.section.input .headcount .title{
    display: flex;
    align-items: center;
    justify-content: space-between;
}

input.empty {
    outline: 2px solid hsl(4, 100%, 67%);
}

.calculator-container .section.result {
    background-color: var(--Green-900);
    padding: 20px;
    border-radius: 10px;
}

.section.result h1 {
    color: var(--Green-400);
}

.section.result h3 {
    color: var(--Grey-200);
}

.section.result p {
    color: var(--Grey-400);
}

.section.result .result {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section.result .result > * {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section.result button {
    background-color: var(--Green-400);
    color: var(--Green-900);
}

button.empty {
    opacity: 0.2;
    cursor: not-allowed;
}

@keyframes popUp {
  0% {
    transform: translateY(-200%) scale(0.8) rotate(-15deg);
  }

  15% {
    transform: translateY(50vh) rotate(0deg) scaleY(1.2) scaleX(1.8);
  }

  30% {
    transform: translateY(35vh) rotate(0deg) scaleY(1.8) scaleX(1.2);
  }

  45% {
    transform: translateY(50vh) rotate(0deg) scaleY(1.3) scaleX(1.7);
  }

  55% {
    transform: translateY(45vh) rotate(0deg) scaleY(1.7) scaleX(1.3);
  }

  65% {
    transform: translateY(50vh) scale(1.5) rotate(5deg);
  }

  80% {
    transform: translateY(50vh) scale(1.5) rotate(0deg);
  }

  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(200vh);
  }
  to {
    transform: translateY(0);
  }
}



@media screen and (min-width: 450px) {
  .tip .options {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .calculator-container .section {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

@media screen and (min-width: 742px) {
  main {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
  } 

  h1 {
    font-size: 3rem;
  }

  input, button {
    font-size: 24px;
  }

  main .calculator-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    max-width: 850px;
    height: fit-content;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.3);
  }

  main > img {
    margin-top: 0;
  }

  .calculator-container .section {
    height: unset;
    width: 50%;
    aspect-ratio: 1/1;
  }

}
