/* ------------------------ */
/* |     Global reset     | */
/* ------------------------ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

button {
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
}

input {
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  border: none;
  outline: none;
}
/* ------------------------ */
/*





*/
/* ------------------------ */
/* |        Layout        | */
/* ------------------------ */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  color: hsl(0, 0%, 8%);
  font-size: 32px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  line-height: 1;
  background-color: hsl(0, 0%, 94%);
}

.wrap {
  width: 830px;
  max-width: 95%;
  padding: 36px;
  border-radius: 18px;
  border-bottom-right-radius: 96px;
  background-color: hsl(0, 0%, 100%);
}
/* ------------------------ */
/*





*/
/* ------------------------ */
/* |         Form         | */
/* ------------------------ */
.form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-item label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  transition: color 0.4s;
}

.form-item input {
  width: 140px;
  display: block;
  padding: 8px 16px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.75px;
  border: 1px solid hsl(0, 0%, 86%);
  border-radius: 12px;
  transition: border-color 0.4s;
}

.form-item input:focus {
  border-color: hsl(259, 100%, 65%);
}

.form-item.invalid input {
  border-color: hsl(0, 100%, 67%);
}

.form-item input::placeholder {
  color: hsl(0, 1%, 44%);
}

.form-item.invalid label {
  color: hsl(0, 100%, 67%);
}

.validation-msg {
  color: hsl(0, 100%, 67%);
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
}

.validation-msg.valid {
  display: none;
}
/* ------------------------ */
/*





*/
/* ------------------------ */
/* |        Divider       | */
/* ------------------------ */
.divider {
  position: relative;
}

.divider::before {
  content: '';
  width: 100%;
  height: 1px;
  position: absolute;
  background-color: hsl(0, 0%, 86%);
}

.btn-calculate {
  width: 72px;
  height: 72px;
  position: absolute;
  right: 0;
  border-radius: 50%;
  background-color: hsl(259, 100%, 65%);
  transition: background-color 0.4s;
  transform: translateY(-50%);
}

.btn-calculate:hover {
  background-color: hsl(0, 0%, 8%);
}
/* ------------------------ */
/*





*/
/* ------------------------ */
/* |      Calculation     | */
/* ------------------------ */
.calculation {
  padding-top: 36px;
}

.calculated-item {
  font-weight: 800;
  font-size: 56px;
  font-style: italic;
  line-height: 1.2;
}

.calculated-num {
  margin-right: 6px;
  color: hsl(259, 100%, 65%);
}
/* ------------------------ */
/*





*/
/* ------------------------ */
/* |        Footer        | */
/* ------------------------ */
.attribution {
  position: fixed;
  left: 50%;
  bottom: 12px;
  font-size: 11px;
  text-align: center;
  transform: translateX(-50%);
}

.attribution a {
  color: hsl(228, 45%, 44%);
}
/* ------------------------ */
/*





*/
/* ------------------------ */
/* |      Responsive      | */
/* ------------------------ */
@media screen and (max-width: 560px) {
  body {
    justify-content: flex-start;
  }

  .wrap {
    margin: 80px auto;
  }

  .form {
    display: flex;
    flex-wrap: wrap;
  }

  .form-item input {
    width: 130px;
  }

  .divider {
    padding: 48px 0;
  }

  .btn-calculate {
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
/* ------------------------ */
