html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}


/* START OF CSS */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500&display=swap');

:root{
    --gradient: Lineargradient(hsl(249, 99%, 64%) 0%, hsl(278, 94%, 30%) 100%);
    --red: 0, 100%, 66%;

    --white: 0, 0%, 100%;
    --light-grayish-violet: 270, 3%, 87%;
    --dark-grayish-violet: 279, 6%, 55%;
    --very-dark-violet: 278, 68%, 11%;

    --safe-space: 1rem;
    --card-radius: 0.5rem;
}

body{
    position: relative;
    width: 100%;
    min-height: 100svh;
    font-size: 18px;
    font-family: 'Space Grotesk', sans-serif;
    color: hsl(var(--very-grayish-violet));
}

main{
    width: 100%;
    min-height: 100svh;
}

div.start{
    display: flex;
    flex-direction: column;
    gap: 8rem;
    min-height: 100svh;
}

div.top{    
    position: relative;
    background-image: url(../images/bg-main-mobile.png);
    aspect-ratio: 2/1;
    background-repeat: no-repeat;
    background-size: cover;
    color: hsl(var(--white));
    z-index: 2;
}

div.top div.back{
    top: 1rem;
    right: var(--safe-space);
    background-image: url(../images/bg-card-back.png);    
    aspect-ratio: 11/6;  
}

div.top div.front{
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    background-image: url(../images/bg-card-front.png);
    left: var(--safe-space);
    bottom: calc(var(--safe-space) * 4 * -1);
    padding: 1rem;      
    z-index: 2;
    box-shadow: -20px 30px 72px -17px rgba(0,0,0,0.5);
    aspect-ratio: 11/5;
}

div.top div.back, div.top div.front{
    position: absolute;
    border-radius: var(--card-radius);
    width: 70%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

div.front div.display{    
    display: grid;
    grid-template-areas: 
    "numbers numbers"
    "holder exp";
    gap: 1rem;
    width: 100%;
    text-transform: uppercase;
}

#numbers{
    font-family: 'Space Grotesk', sans-serif;
    width: 100%;
    font-size: 1.3rem;
    letter-spacing: 0.2rem;
    grid-area: numbers;
}

#holder{
    grid-area: holder;
}

#holder, #exp{
    font-size: 0.6rem;
    letter-spacing: 0.1rem;
}

#exp{
    justify-self: end;
    grid-area: exp;
}

#cvc{
    position: absolute;
    right: 12%;
    top: 46%;
    font-size: 0.8rem;
}

div.top div.front::before{
    content: '';
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-image: url(../images/card-logo.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    width: 5rem;
    aspect-ratio: 2/1;
}

#inputs{
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 var(--safe-space);
    flex-grow: 1;
    justify-content: space-evenly;
    background-color: hsl(var(--white));
}

#inputs label{
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    color: hsl(var(--very-dark-violet));
    font-weight: 600;
}

#inputs input{
    height: 2.5rem;
    padding: 0rem 0.5rem;
    color: hsl(var(--very-grayish-violet));
    border: 1px solid hsl(var(--light-grayish-violet));
    border-radius: 0.25rem;
}

#inputs label, #inputs input{
    font-family: 'Space Grotesk', sans-serif;
}

#inputs .line{
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

#inputs .cols{
    display: grid;
    grid-template-columns: 1fr 1fr;
}

#inputs .col{
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

#inputs .col2{
    display: grid;
    gap: 0.1rem;
    grid-template-areas: 
    "label label"
    "mm yy";
}

#inputs .col2 label{
    grid-area: label;
}

#inputs .col2 input{
    width: 70%;
    grid-area: yy;
}

#inputs .col2 input:first-of-type{
    grid-area: mm;
}

#inputs .line button{
    background-color: hsl(var(--very-dark-violet));
    color: hsl(var(--white));
    border: none;
    border-radius: 0.5rem;
    height: 3rem;
    font-size: 1rem;
    letter-spacing: 0.1rem;
    cursor: pointer;
}

#inputs.completed{
    position: absolute;
    bottom: 0;
    width: 90%;
    height: 100%;
    transform: translateY(-100svh);
    transition: transform 1s ease-in-out;
}

.thankYou::before{
    content: '';
    position: relative;
    background-image: url(../images/icon-complete.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 5rem;
    aspect-ratio: 1/1;
}

.start:has(#inputs.completed){
    gap: 2rem;
}

.thankYou{
    display: none;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-direction: column;
    flex-grow: 1;
    padding: var(--safe-space);
}

.thankYou h2{
    font-size: 1.6rem;
    letter-spacing: 0.1rem;
    color: hsl(var(--very-dark-violet));
    text-transform: uppercase;
    font-weight: 600;
}

.thankYou h5{
    font-size: 1.2rem;
    color: hsl(var(--dark-grayish-violet));
    font-weight: 500;
}

.thankYou button{
    height: 3.5rem;
    background-color: hsl(var(--very-dark-violet));
    color: hsl(var(--white));
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    letter-spacing: 0.05rem;
    cursor: pointer;
    margin-top: 1rem;
    width: 100%;
}

#inputs.completed+.thankYou{
    display: flex;
}

@media (min-width: 675px) {
    div.start{
        flex-direction: row;
        gap: 2rem;
    }

    div.top{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
        height: 100svh;
        width: 50%;
        gap: 2rem;
        background-image: url(../images/bg-main-desktop.png);
        background-position: left;
        background-repeat: no-repeat;
        background-size: contain;
    }

    div.top div.front, div.top div.back{
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 20rem;
        height: 10rem;
        padding: 0.5rem;
        box-shadow: -20px 30px 72px -17px rgba(0,0,0,0.5);
    }

    div.top div.front{
        padding: 2rem;
        width: 16rem;
        height: 8rem;
        margin-right: 15%;
    }

    #inputs{
        padding: 0rem 6rem;
        justify-content: center;
        gap: 3rem;
    }

    #inputs.completed{
        display: none;
    }
}