body {
  background-image: linear-gradient(to right, #0f0c29, #302b63, #24243e);
  font-family: "Lato", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  font-size: 18px;
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main {
  display: grid;
  grid-template-columns: 32% 1fr;
  min-height: 100vh;
  max-width: 2000px;
  margin-inline: auto;
}

form {
  padding: 30px;
  background: white;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-radius: 15px;
}

.left {
  display: grid;
  place-content: center;
  gap: 2rem;
}

.right {
  display: grid;
  place-items: center;
  margin-left: 5rem;
  padding: 3rem 1rem;
  background: linear-gradient(to right, #d5dee7, #e8ebf2, #e2e7ed);
}

.cta {
  background-image: linear-gradient(to right, #0f0c29, #302b63, #24243e);
  color: white;
  font-family: inherit;
  padding: 0.7rem;
  grid-column: span 4;
  border-radius: 0.5rem;
  margin-top: 1rem;
  cursor: pointer;
  text-align: center;
}

.success {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 300px;
  width: 90%;
  text-align: center;
  gap: 1rem;
}

.success img {
  width: 70px;
  margin-inline: auto;
  padding-bottom: 1rem;
}

.success > * {
  grid-column: span 4;
}

.success p {
  color: hsl(279, 6%, 55%);
}

.alphanumeric {
  display: flex;
  gap: 0.15em;
  height: 1.2em;
  position: relative;
  overflow: hidden;
}

.alphanumeric ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 0.9em;
  flex-shrink: 0;
  text-align: center;
}

.alphanumeric li:not(.active) {
  position: absolute;
  transform: translateY(100%);
}

.alphanumeric li.active {
  animation: slideUp 0.5s ease-out;
}

.card {
  font-size: 1.5rem;
  width: 25rem;
  border-radius: 0.5em;
  aspect-ratio: 16/9;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.cvv-container {
  width: 25rem;
  background-color: rgb(216, 216, 216);
  height: 50px;
  position: absolute;
  top: 45%;
}

.card-front {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    45deg,
    #2b2b2b 5%,
    #242424 10%,
    #3b3b3b 30%,
    #414141 50%,
    #444444 70%,
    #575757 80%,
    #999 95%
  );
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
  transform: translateX(25%);
}

.card-back {
  background: linear-gradient(
    45deg,
    #2b2b2b 5%,
    #242424 10%,
    #5e5e5e 30%,
    #414141 50%,
    #444444 70%,
    #575757 80%,
    #585858 95%
  );
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
  position: relative;
  transform: translateX(35%);
}

.card__logo {
  width: 20%;
  height: auto;
}
.card__number {
  font-size: 0.8em;
  display: flex;
  gap: 0.6em;
  color: white;
  margin-block: auto 2rem;
}

.card__footer {
  color: white;
  display: flex;
  font-size: 0.5em;
  display: flex;
  justify-content: space-between;
}

.card__holderName {
  display: flex;
  gap: 0.75em;
}

.card__expiry {
  display: flex;
  gap: 0.2em;
  align-items: center;
}

.cvv {
  position: absolute;
  color: rgb(27, 27, 27);
  right: 12%;
  top: 35%;
  font-size: 0.55em;
}

.card__details {
  width: min(70%, 40rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.card__details .card__details__input {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  position: relative;
}

.card__details input {
  font-family: inherit;
  width: 100%;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  outline: none;
  border-radius: 0.5rem;
  border: 1px solid hsl(276, 4%, 78%);
}

.card__details input.error {
  border: 1px solid rgb(238, 61, 16);
}

.card__details input::placeholder {
  color: hsl(276, 4%, 78%);
}

.card__details__input div.error {
  color: rgb(238, 61, 16);
  font-size: 0.6rem;
  margin-left: 0.2rem;
  bottom: -1rem;
  position: absolute;
}

.card__details__input:nth-of-type(3) {
  grid-column: span 2;
}
.card__details__input:nth-of-type(4) {
  grid-column: span 2;
}

.card__details__input .expiry {
  display: flex;
  gap: 1rem;
}

@media (max-width: 768px) {
  .main {
    grid-template-columns: 1fr;
    grid-template-rows: 250px 1fr;
  }
  .left {
    padding: 1rem;
  }
  .right {
    margin-left: 0;
  }
}

@media (max-width: 415px) {
  :root {
    font-size: 16px;
  }
  .card__details {
    width: 100% !important;
  }
  .main {
    grid-template-rows: 300px 1fr;
  }
  .left {
    overflow-x: hidden;
  }
}

@media (min-width: 1400px) {
  .card {
    font-size: 1.6rem;
    width: 27rem;
  }
  .cvv-container {
    width: 27rem;
  }
}
@media (max-width: 1200px) {
  .card {
    font-size: 1rem;
    width: 20rem;
  }
  .cvv-container {
    width: 20rem;
  }
}
@media (max-width: 1000px) {
  .card {
    font-size: 1rem;
    width: 18rem;
  }
  .cvv-container {
    width: 18rem;
  }
  .card-front {
    transform: translateX(20%);
  }
  .card-back {
    transform: translateX(35%);
  }
}
@media (max-width: 850px) {
  .card-front {
    transform: translateX(20%);
  }
  .card-back {
    transform: translateX(20%);
  }
}

@media (max-width: 768px) {
  .card-front {
    transform: translate(-15%, -10%);
    grid-row: 2/3;
    z-index: 1;
  }
  .card-back {
    transform: translateX(15%);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.lato-thin {
  font-family: "Lato", sans-serif;
  font-weight: 100;
  font-style: normal;
}

.lato-light {
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.lato-regular {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.lato-bold {
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-style: normal;
}

.lato-black {
  font-family: "Lato", sans-serif;
  font-weight: 900;
  font-style: normal;
}

.lato-thin-italic {
  font-family: "Lato", sans-serif;
  font-weight: 100;
  font-style: italic;
}

.lato-light-italic {
  font-family: "Lato", sans-serif;
  font-weight: 300;
  font-style: italic;
}

.lato-regular-italic {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-style: italic;
}

.lato-bold-italic {
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-style: italic;
}

.lato-black-italic {
  font-family: "Lato", sans-serif;
  font-weight: 900;
  font-style: italic;
}

.loaderContainer {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.loader {
  width: 35px;
  height: 80px;
  position: relative;
}
.loader:after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 3px 5px;
  border-top: 1px solid #bbb6aa;
  border-bottom: 4px solid #bbb6aa;
  background: 
    linear-gradient(#302b63 0 0) bottom no-repeat content-box, 
    #e4e0d7;
  mix-blend-mode: darken;
  animation: l1 1.5s infinite linear;
}
.loader:before {
  content: "";
  position: absolute;
  inset: -18px calc(50% - 2px) 8px;
  background: #eb6b3e;   
  transform-origin: bottom;
  transform: rotate(8deg);
}
@keyframes l1 {
 0%   {background-size: 100% 100%}
 100% {background-size: 100% 5%}
}