/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;600&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  /*========== Colors ==========*/
  /* Color mode HSL & RGB */
  --first-color: hsl(79, 100%, 49%);
  --white-color: #fff;
  --black-color: #000;

  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Poppins", sans-serif;
  --normal-font-size: 0.938rem;
  --tiny-font-size: 0.563rem;
}

/* Responsive typography */
@media screen and (min-width: 968px) {
  :root {
    --normal-font-size: 1rem;
  }
}

/*=============== BASE ===============*/

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--white-color);
}

/*=============== MODERN INPUT ===============*/

.form {
  height: 100vh;
  display: grid;
  place-items: center;
  margin: 0 1.5rem;
}
.form__content {
  display: grid;
  row-gap: 1.5rem;
}

.form__input,
.form__label,
.form__submit {
  border: 0;
  outline: none;
  font-size: var(--normal-font-size);
  font-family: var(--body-font);
}

.form__box {
  width: 312px;
  height: 59px;
  position: relative;
}

.form__shadow {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--black-color);
}

.form__input {
  position: absolute;
  border: 2.5px solid var(--black-color);
  background-color: var(--white-color);
  width: 100%;
  height: 100%;
  z-index: 10;
  padding: 18px;
  transition: transform 0.3s;
}

.form__input::placeholder {
  transition: opacity 0.5s;
}

.form__label {
  z-index: 100;
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: var(--tiny-font-size);
  font-weight: 600;
  transition: 0.2s;
  pointer-events: none;
  opacity: 0;
}

.form__button {
  justify-self: flex-end;
  background-color: var(--black-color);
}

.form__submit {
  padding: 0.875rem 1.5rem;
  color: var(--black-color);
  background-color: var(--first-color);
  cursor: pointer;
  transition: transform 0.3s;
}

.form__submit:hover {
  transform: translate(-6px, -6px);
}

/* Opaque placeholder */
.form__input:focus::placeholder {
  opacity: 0;
  transition: 0.3s;
}
/* Move input and sticky input up */
.form__input:focus,
.form__input:not(:placeholder-shown).form__input:not(:focus) {
  transform: translate(-8px, -8px);
  padding: 28px 18px 18px;
  animation: input-animation 0.5s;
}
/* Move label and sticky label up */
.form__input:focus + .form__label,
.form__input:not(:placeholder-shown).form__input:not(:focus) + .form__label {
  opacity: 1;
  top: 2px;
  left: 12px;
  transition: 0.3s;
}
/* Input bounce animation */
@keyframes input-animation {
  0% {
    transform: translate(0);
  }
  40% {
    transform: translate(-9px, -9px);
  }
  60% {
    transform: translate(-7px, -7px);
  }
}
/*=============== BREAKPOINTS ===============*/
/* For small devices */
@media screen and (max-width: 340px) {
  .from__content,
  .from__box {
    width: 100%;
  }
}
/* For large devices */
@media screen and (max-width: 968px) {
  .form__content {
    zoom: 1.1;
  }
}
