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

:root {
    --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%);
    --Red-input-errors: hsl(0, 100%, 66%);
    --input-border: hsl(249, 99%, 64%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
}

button {
    padding: 10px;
    border: none;
    background-color: var(--Very-dark-violet);
    color: var(--White);
    border-radius: 7px;
    font-size: 1.07rem;
    font-weight: 500;
    height: 45px;
    width: 100%;
    margin-top: 0.6rem;
}

button:hover {
    background-color:  hsl(278, 68%, 11%, 0.8);
}

.red-outline {
    outline: 1px solid var(--Red-input-errors) !important;
}

.width-100 {
    width: 100%;
}

.hidden {
    display: none;
}

#interactive-card-section {
    display: flex;
    justify-content: space-between;
    max-width: 1300px;
}

.interactive-card-bg {
    background: url(../images/bg-main-desktop.png) no-repeat;
    background-size: cover;
    width: 37%;
    height: 100vh;
}

.interactive-card {
    display: flex;
    align-items: center;  
    justify-content: flex-end; 
}

/* form section starts*/
.interactive-card form {
    padding: 1rem;
    max-width: 450px;
}

.card-holder,
.cardNumber,
.card-expiry-and-cvc-section {
    margin-bottom: 1.4rem;
}

.interactive-card label {
    display: block;
    font-size: 1.125rem;
    font-weight: 500;
}

.interactive-card input {
    border: 1px solid var(--Light-grayish-violet);
    border-radius: 7px;
    font-size: 1.05rem;
    margin: 0.6rem 0 0;
    padding: 10px 15px;
    height: 45px;
    outline: none;
}

.interactive-card input:focus {
    border: 1px solid var(--input-border);
}

.interactive-card span {
    margin-top: 0.5rem;
    color: var(--Red-input-errors);
    display: none;
    font-size: 1rem;
    font-weight: 400;
}

.card-expiry-and-cvc-section {
    display: flex;
    justify-content: space-between;
}

.card-expiry-date {
    margin-right: 1.2rem;
}

.card-expiry-date input {
    width: 5.19rem;
    margin-right: 0.5rem;
}

.cvc {
    width: 50%;
}

.cvc input {
    width: 100%;
}

/* form section ends*/

/* card display section */
#cards {
    padding: 0 1rem;
    position: absolute;
    top: 17%;
    left: 10%;
}

.card-back,
.card-front {
    border-radius: 10px;
    width: 400px;
    height: 220px;
    color: var(--White);
    box-shadow: 0 0 7px rgba(0, 0, 0, 0.5);
}

.card-front {
    background: url(../images/bg-card-front.png) no-repeat;   
    background-size: cover;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.card-front img {
    margin-bottom: 2.5rem;
}

.card-number {
    font-size: 1.9rem;
}

.card-front .card-details {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin: 1.2rem 0 1rem;
} 

.card-front .card-details p {
    font-size: 1.2rem;
}

.card-back {
    background: url(../images/bg-card-back.png) no-repeat;
    background-size: cover;
    margin-left: 5rem;
    position: relative;
}

.card-back .cvc-number {
    position: absolute;
    top: 43.5%;
    right: 11%;
    font-size: 1.3rem;
}

/* completed card section */
.completed {
    max-width: 430px;
    width: 430px;
    padding: 1rem;
    text-align: center; 
}

.completed img {
    margin-bottom: 1.5rem;
}

.completed h2 {
    font-weight: 500;
}

.completed p {
    margin: 1rem 0 2.5rem;
    opacity: 80%;
}

@media(max-width: 1050px) {
    #cards {
        left: 1%;
    }
}

@media(max-width: 950px) {
     #interactive-card-section {
        flex-direction: column;
    }
   
    .interactive-card-bg {
        width: 100%;
        height: 40vh;
        margin-bottom: 5.3rem;
    }

    .interactive-card {
        justify-content: center;
        margin-top: 2rem;
    }

    #cards {
        top: 1.8%;
        width: 100%;
        left: 0;
        display: flex;
        justify-content: center;
    }

     .card-back {
        position: absolute;
    }
   
    .card-front {
        z-index: 2;
        position: relative;
        margin-top: 7.9rem;    
    }
}

@media(max-width: 500px) {
    html {
        font-size: 14px;
    }

    #cards {
        justify-content: flex-start;
    }

    .card-back,
    .card-front {
        height: 195px;
    }

    .card-back {
        margin-left: 2.5rem;
        background-position: center center;
    }
}

@media(max-width: 450px) {
    .interactive-card-bg {
        margin-bottom: 3rem;
        height: 36vh;
    }

    .card-back,
    .card-front {
        width: 310px;
        height: 175px;
    }

     .card-number {
        font-size: 1.7rem;
    }

    .card-front {
        margin-top: 7rem;    
    }

    .card-front img {
        width: 60px;
    }

    .card-front .card-details {
        margin: 1rem 0;
     } 

     .card-expiry-date {
        margin-right: 0.3rem;
     }

     .card-expiry-date input {
        width: 4.95rem;
    }
}

@media (max-width: 350px) {
    .card-back,
    .card-front {
        width: 280px;
        height: 175px;
    }

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

    .card-number {
        font-size: 1.5rem;
    }
    .card-expiry-date input {
        width: 4.3rem;
    }

}