/* 
The designs were created to the following widths:
- Mobile: 375px
- Desktop: 1440px 
*/

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

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

  --font-size: 18px;
  --input-height: 40px;
}

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

body {
  font-family: "Space Grotesk", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

.split-container {
  display: flex;
  height: 100vh;

  position: relative;
}

.left-side {
  flex: 3;
  background-color: #21092f;
  display: flex;
  justify-content: center;
  align-items: center;
}

.right-side {
  flex: 7;
  background-color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--Very-dark-violet);
  font-size: 24px;
}

.image {
  background: url(./assets/bg-main-desktop.png) no-repeat center center / cover;
}

/*
=======
form
=======
*/
form {
  width: 500px;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

label {
  text-transform: uppercase;
  font-size: var(--font-size);
  margin-bottom: 5px;
  font-size: 14px;
  letter-spacing: 2px;
}

input {
  height: var(--input-height);
  font-size: 18px;

  border-radius: 5px;
  border: 1px solid var(--Light-grayish-violet);
  outline: none;
  padding-left: 10px;

  width: 100%;
  color: var(--active-input);
}

input::placeholder {
  color: var(--Light-grayish-violet);
}

.input-name-number {
  margin-bottom: 15px;

  display: flex;
  flex-direction: column;
}

/*
=======
expiration
=======
*/

.last-3-box {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.left-exp,
.right-cvc {
  flex: 1;
}

.month-year {
  display: flex;
  gap: 10px;
}

/*
=======
Button
=======
*/

.button {
  margin-top: 20px;
  border: none;
  padding: 10px;
  cursor: pointer;
  background-color: var(--Very-dark-violet);
  color: var(--white);

  text-align: center;
  border-radius: 5px;
  font-size: 1.1rem;
  width: 100%;
  height: 50px;
}

.error-message {
  color: var(--error);
  font-size: 12px;
}

/*
=======
cards
=======
*/
.bck-front,
.bck-back {
  border-radius: 10px;
  height: 200px;
  width: 380px;
  position: absolute;
}

.bck-front {
  background: url(./assets/bg-card-front.png) no-repeat center center / cover;

  top: 15%;
  left: 12%;
}

.bck-back {
  background: url(./assets/bg-card-back.png) no-repeat center center / cover;

  top: 48%;
  left: 16%;
}

.logo {
  height: 50px;
  width: 100px;
  background: url(./assets/card-logo.svg) no-repeat center;

  top: 5%;
  left: 5%;
  position: absolute;
}

.credit-name,
.credit-date,
.credit-cvc {
  color: var(--white);
  font-size: 16px;
  position: absolute;
}

.credit-number {
  top: 50%;
  left: 10%;

  color: var(--white);
  font-size: 24px;
  position: absolute;

  letter-spacing: 3px;
}

.credit-name {
  top: 78%;
  left: 5%;
}

.credit-date {
  top: 78%;
  left: 78%;
}

.credit-cvc {
  top: 43%;
  left: 78%;
}

.overlay {
  position: absolute;

  background-color: var(--white);
  overflow: hidden;

  transition: 0.5s ease;

  display: none;

  width: 500px;
  height: 400px;
}

.active {
  width: 500px;
  height: 400px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.checkmark {
  height: 100px;
  width: 100px;
  background: url(./assets/icon-complete.svg) no-repeat center center / cover;

  margin-bottom: 30px;
}

.greeting {
  color: var(--active-input);
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.message {
  color: var(--Dark-grayish-violet);
  margin-bottom: 15px;
  font-size: var(--font-size);
}

/* Responsive Design */
@media (min-width: 315px) and (max-width: 480px) {
  .overlay {
    width: 95%;
    height: 350px;
  }

  .split-container {
    flex-direction: column;
  }

  .left-side {
    flex: 3;
  }

  .right-side {
    flex: 7;
  }

  .image {
    background: url(./assets/bg-main-mobile.png) no-repeat center center / cover;
  }

  .bck-front {
    top: 13%;
    left: 15%;
    z-index: 100;
  }

  .bck-back {
    top: 2%;
    left: 28%;
  }

  .bck-front,
  .bck-back {
    border-radius: 10px;
    position: absolute;

    width: 50%;
    height: auto;
    aspect-ratio: 1.9;
  }

  .logo {
    height: 25px;
    width: 45px;
    background: url(./assets/card-logo.svg) no-repeat center center / cover;

    top: 5%;
    left: 5%;
    position: absolute;
  }

  .credit-name {
    top: 75%;
    left: 5%;
  }

  .credit-number {
    left: 8%;
    font-size: 12px;
    letter-spacing: 1px;
  }

  .credit-name,
  .credit-date,
  .credit-cvc {
    font-size: 12px;
  }

  #reset-button {
    width: 70%;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .overlay {
    width: 93%;
    height: 380px;
  }

  .split-container {
    flex-direction: column;
  }

  .left-side {
    flex: 3;
  }

  .right-side {
    flex: 7;
  }

  .image {
    background: url(./assets/bg-main-mobile.png) no-repeat center center / cover;
  }

  .bck-front {
    top: 13%;
    left: 14%;
    z-index: 100;
  }

  .bck-back {
    top: 2%;
    left: 28%;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .split-container {
    flex-direction: column;
  }

  .left-side {
    flex: 3;
  }

  .right-side {
    flex: 7;
  }

  .image {
    background: url(./assets/bg-main-mobile.png) no-repeat center center / cover;
  }

  .bck-front {
    top: 13%;
    left: 25%;
    z-index: 100;
  }

  .bck-back {
    top: 2%;
    left: 35%;
  }
}

@media (min-width: 1201px) and (max-width: 1600px) {
  .bck-front {
    top: 15%;
    left: 8%;
  }

  .bck-back {
    top: 48%;
    left: 10%;
  }
}

@media (min-width: 1601px) {
  .bck-front {
    top: 20%;
    left: 17%;
  }

  .bck-back {
    top: 52%;
    left: 20%;
  }
}
