@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500&display=swap");

:root {
  --active-input-border: linear-gradient(
    90deg,
    hsl(249, 99%, 64%) 0%,
    hsl(278, 94%, 30%) 100%
  );
  --input-errors: hsl(0, 100%, 66%);
  --Light-grayish-violet: hsl(270, 3%, 87%);
  --Dark-grayish-violet: hsl(279, 6%, 55%);
  --Very-dark-violet: hsl(278, 68%, 11%);

  font-size: 10px;
}

* {
  margin: 0;
  padding: 0;
  line-height: 1em;
  box-sizing: border-box;
  font-family: "Space Grotesk", sans-serif;
}

body {
  font-size: 1.8rem;
  font-weight: 500;
  height: 100vh;
  background-image: url("./images/bg-main-mobile.png");
  background-repeat: no-repeat;
  background-size: 100% 24rem;
}

main {
  max-width: 37.5rem;
  padding: 3.2rem 1.6rem;
  margin: 0 auto;
}

img {
  display: block;
}

.card {
  position: relative;
  height: 25.2rem;
}

.card-back {
  position: relative;
  max-width: 28.6rem;
  margin: 0 0 0 auto;
}

.card-back img {
  width: 100%;
}

.card-back .cvc {
  position: absolute;
  top: 0;
  height: 100%;
  width: 100%;
  color: white;
  font-size: 1rem;
  letter-spacing: 0.065em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 3.6rem;
}

.card-front {
  max-width: 28.6rem;
  position: absolute;
  top: 9.4rem;
}

.card-front img {
  width: 100%;
}

.card-details {
  position: absolute;
  top: 0;
  padding: 1.8rem 2rem;
  width: 100%;
  height: 100%;
}

.card-details img {
  width: 5.4rem;
  margin-bottom: 4rem;
}

.card-Number {
  display: block;
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: white;
  margin-bottom: 2rem;
}

.info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  font-size: 1rem;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

form {
  margin-top: 5rem;
  padding: 0 0.8rem;
  display: block;
}

.form-group {
  margin-top: 2.2rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: inline-block;
  font-size: 1.2rem;
  letter-spacing: 0.165em;
  text-transform: uppercase;
  color: var(--Very-dark-violet);
  margin-bottom: 1rem;
}

.form-group input {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  font-weight: 500;
  width: 100%;
  outline: none;
  border: 1px solid var(--Light-grayish-violet);
  border-radius: 0.8rem;
  height: 4.5rem;
  padding: 0 1.6rem;
  color: var(--Very-dark-violet);
}

.form-group input:focus {
  border: 1px solid;
  border-color: var(--active-input-border) !important;
}

.info-err {
  display: none;
  margin-top: 1rem;
  font-size: 1.2rem;
  color: var(--input-errors);
}

.d-block {
  display: block !important;
}

.d-none {
  display: none !important;
}

.input-err {
  border-color: var(--input-errors) !important;
}

.form-exp-date {
  display: flex;
  gap: 1rem;
}

.date {
  display: flex;
  gap: 0.8rem;
}

#month,
#year {
  width: 7.2rem;
}

.btn {
  display: block;
  margin-top: 2.8rem;
  border: 0;
  background: var(--Very-dark-violet);
  color: white;
  width: 100%;
  height: 5.3rem;
  border-radius: 0.8rem;
  font-size: 1.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.btn:hover {
  background: hsla(278, 68%, 11%, 80%);
}

.complete {
  margin-top: 4.8rem;
  padding: 0 0.8rem;
  text-align: center;
  display: none;
}

.complete img {
  margin: 0 auto;
  margin-bottom: 3.8rem;
}

.complete h1 {
  font-size: 2.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--Very-dark-violet);
  margin-bottom: 2.4rem;
}

.complete p {
  color: var(--Dark-grayish-violet);
  margin-bottom: 5rem;
}

@media screen and (min-width: 1440px) {
  body {
    background-image: url("./images/bg-main-desktop.png");
    background-repeat: no-repeat;
    background-size: 33.5% 100%;
  }

  main {
    max-width: 111.2rem;
    margin: auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12.7rem;
    height: 100vh;
  }

  .card {
    height: 52.8rem;
    max-width: max-content;
    display: flex;
    flex-direction: column-reverse;
    gap: 3.8rem;
  }

  .card-back,
  .card-front {
    max-width: max-content;
  }

  .card-front {
    position: relative;
    top: 0;
  }

  .card-back {
    margin-left: 9.4rem;
  }

  .card-back .cvc {
    font-size: 1.4rem;
    letter-spacing: 0.14em;
    padding-right: 5.8rem;
  }

  .card-details {
    padding: 2.8rem 3.2rem;
  }

  .card-details img {
    width: max-content;
    margin-bottom: 6.8rem;
  }

  .card-Number {
    font-size: 2.8rem;
    margin-bottom: 3.2rem;
  }

  .info {
    font-size: 1.4rem;
    letter-spacing: 0.14em;
  }

  form {
    margin-top: 0.3rem;
    padding: 0;
    max-width: 38.1rem;
  }

  .form-group {
    margin: 0;
    margin-bottom: 2.8rem;
  }

  .form-exp-date {
    gap: 2rem;
  }

  .date {
    gap: 1rem;
  }

  #month,
  #year {
    width: 8rem;
  }

  .btn {
    margin: 0;
    margin-top: 1.2rem;
  }

  .complete {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 38.1rem;
  }
}

.form-title {
  font-size: 20px;
  text-align: center;
}
