/* --- GLOBAL --- */
body {
    font-family: Arial, sans-serif;
    background: #ffffff; 
    display: flex;
    justify-content: center;
    padding-top: 80px;
    margin: 0;
}

/* --- FORM WRAPPER --- */
.formGrid {
   position: relative;
    width: 90%;
    max-width: 540px;
    margin: 40px auto;
    aspect-ratio: 1.4 / 1;
}

/* --- SHARED CARD STYLES --- */
.cardFront, .cardBack {
    width: 80%;
    height: auto;
    aspect-ratio: 1.586 / 1; 
    
    background: #cfcfcf;
    border-radius: 2%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    padding: 5%;
    box-sizing: border-box;
    position: absolute;
}

/* --- FRONT CARD --- */
.cardFront {
   z-index: 2;
    top: 0;
    left: 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
        "total logo"
        "number number"
        "holder expiration";
    gap: 10px;
}

/* --- BACK CARD --- */
.cardBack {
    z-index: 1;
    top: 15%;
    left: 20%;
}

.total, label {
    font-family: "Times New Roman", Times, serif;
    font-weight: bold;
    color: #1a1a1a;
}

.total {
    grid-area: total;
    text-align: left;
    font-size: 18px;
}

label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

/* --- INPUTS --- */
input {
    width: 100%;
    padding: 4%;
    border-radius: 4px;
    border: 1px solid #a0a0a0;
    background: #ffffff;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* --- GRID AREAS & SPECIFICS --- */
.cardLogo {
    grid-area: logo;
    justify-self: end;
    width: 45px;
    height: 30px;
    background: linear-gradient(135deg, #e6c27a, #d4af37, #e6c27a); 
    border-radius: 4px;
    border: 1px solid #a88728;
}

.cardNumber { 
    grid-area: number; 
}

.cardHolder { 
    grid-area: holder; 
}

#cardExpiration {
    grid-area: expiration;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#expirationDate {
    grid-column: 1 / 3;
}

/* --- BACK CARD DETAILS --- */
.magStripe {
    height: 45px;
    background: black;
    margin: 20px -25px 0 -25px; 
}

.cvc {
    position: absolute;
    right: 25px;
    bottom: 30px;
    width: 80px;
}

/* --- BUTTON & MESSAGES --- */
.submitBtn {
    position: absolute;
    bottom: -10%;
    right: 0;
    width: 25%;
    min-width: 80px;
    padding: 10px 24px;
    border-radius: 8px;
    border: 2px solid #222;
    background: #f4f4f4;
    box-shadow: 2px 4px 6px rgba(0,0,0,0.2);
    font-size: 14px;
    cursor: pointer;
}

#message {
    position: absolute;
    bottom: -20px;
    width: 100%;
    text-align: center;
    font-weight: bold;
}