:root {
    --dark-bg: #0a101e;
    --primary-color: #00f5c3;
    --secondary-color: #7a5af8;
    --text-color: #c5cde0;
    --text-highlight: #ffffff;
    --card-bg: #121a2d;
    --input-bg: #1a243b;
    --border-color: #2a344a;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

.checkout-container {
    width: 100%;
    max-width: 500px;
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    margin-left: auto;
    margin-right: auto;
}

h1, h2 {
    text-align: center;
    color: var(--text-highlight);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 30px;
    opacity: 0.8;
}

.order-summary {
    background-color: var(--input-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}
.order-summary .item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.order-summary .total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-highlight);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input, .form-group select {
    width: 93%;
    padding: 15px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-highlight);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group select {
    width: 100%;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23c5cde0" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 8px 10px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 245, 195, 0.2);
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.payment-method {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.payment-method:hover {
    background-color: var(--input-bg);
}

.payment-method.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 245, 195, 0.15);
}
.payment-method.active svg {
    fill: var(--primary-color);
}
.payment-method svg {
    width: 24px;
    height: 24px;
    fill: var(--text-color);
    transition: fill 0.3s;
}

.payment-details {
    margin-top: 20px;
}

.hidden {
    display: none;
}

#pix-info {
    text-align: center;
}

#qr-code-placeholder {
    width: 250px;
    height: 250px;
    background-color: white;
    margin: 0 auto 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-weight: 600;
    font-size: 0.9rem;
}

.pix-copy-paste {
    display: flex;
    width: 100%;
}
.pix-copy-paste input {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pix-copy-paste button {
    padding: 15px;
    border: none;
    background-color: var(--primary-color);
    color: var(--dark-bg);
    font-weight: 700;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pix-copy-paste button:hover {
    background-color: #00d1a1;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.full-width {
    grid-column: 1 / -1;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: var(--dark-bg);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 30px;
}
.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 245, 195, 0.2);
}

#card-expiry, #card-cvv {
    width: 85%;
}

/* --- RESPONSIVIDADE (AQUI ESTÃO AS CORREÇÕES) --- */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 0; /* Remove padding do body para o container controlar */
    }
    .checkout-container {
        padding: 30px 20px; /* Aumenta o padding vertical, define o horizontal */
        margin: 20px; /* Adiciona margem para não colar nas bordas */
        border-radius: 20px;
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1rem; margin-bottom: 20px; }

    .order-summary { padding: 15px; margin-bottom: 20px; }
    .order-summary .total { font-size: 1rem; }

    .form-group { margin-bottom: 15px; }
    .form-group label { margin-bottom: 5px; }
    .form-group input { padding: 12px; font-size: 0.95rem; }
    .form-group select { padding: 12px; font-size: 0.95rem; }

    .payment-methods {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .payment-method {
        padding: 12px;
        font-size: 0.95rem;
    }

    .card-grid {
        grid-template-columns: 1fr; /* << ESSA É A REGRA PRINCIPAL PARA EMPILHAR */
        gap: 15px; /* Define o espaçamento entre os campos empilhados */
    }
    #qr-code-placeholder {
        width: 200px;
        height: 200px;
        font-size: 0.8rem;
    }
    .pix-copy-paste input {
        font-size: 0.9rem;
    }

    .pix-copy-paste button {
        padding: 12px;
        font-size: 0.9rem;
    }
    .submit-btn {
        padding: 15px;
        font-size: 1rem;
        margin-top: 20px;
    }

    #card-expiry, #card-cvv {
        width: 93%;
    }
}
