:root {
    /* Paleta Refinada */
    --primary: #009EE3;
    --primary-rgb: 0, 158, 227;
    --dark: #0f172a;
    --gray-dark: #334155;
    --gray-med: #64748b;
    --gray-light: #94a3b8;
    --bg-page: #f8fafc;
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Sistema de Sombras (Layered Shadows) */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
    --shadow-float: 0 20px 40px -10px rgba(0, 158, 227, 0.15);
    
    /* Configurações Gerais */
    --radius: 20px;
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* --- Fundo Animado (Mesh) --- */
.mesh-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #f1f5f9;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: floatBlob 10s infinite alternate;
}
.blob-1 { top: -10%; right: -10%; width: 600px; height: 600px; background: rgba(0, 158, 227, 0.2); }
.blob-2 { bottom: -10%; left: -10%; width: 500px; height: 500px; background: rgba(16, 185, 129, 0.15); animation-delay: -5s; }
.blob-3 { top: 40%; left: 50%; width: 400px; height: 400px; background: rgba(255, 255, 255, 0.8); transform: translate(-50%, -50%); }

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -20px) scale(1.05); }
}

.checkout-container {
    width: 100%;
    max-width: 960px;
    position: relative;
    z-index: 10;
}

/* --- Header --- */
.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; color: var(--dark); }
.logo-icon {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,158,227,0.3);
}
.highlight { color: var(--primary); }

.secure-badge {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-med);
    display: flex; align-items: center; gap: 6px;
    box-shadow: var(--shadow-sm);
}
.secure-badge i { color: var(--success); font-size: 1.1rem; }

/* --- Grid Principal --- */
.checkout-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 24px;
    align-items: start;
}

/* Estilo Cartão Genérico (Glassmorphism) */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s var(--ease);
}

/* --- Resumo do Pedido (Esquerda) --- */
.order-summary { position: sticky; top: 20px; }
.card-header h2 { font-size: 1.1rem; color: var(--gray-dark); margin-bottom: 24px; font-weight: 700; }

.product-item { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.product-thumb {
    width: 56px; height: 56px;
    background: #f0f9ff;
    color: var(--primary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    box-shadow: inset 0 0 0 1px rgba(0,158,227,0.1);
}
.product-info h3 { font-size: 0.95rem; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.product-info p { font-size: 0.8rem; color: var(--gray-med); }
.product-price { font-weight: 700; font-size: 1rem; color: var(--dark); margin-left: auto; }

.divider { height: 1px; background: #e2e8f0; margin: 24px 0; }

.order-details { list-style: none; }
.order-details li { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.9rem; color: var(--gray-med); }
.text-green { color: var(--success); font-weight: 600; background: #dcfce7; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; }

.total-row { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #e2e8f0; align-items: center; }
.total-row span:first-child { font-size: 1rem; font-weight: 600; color: var(--dark); }
.total-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -1px; }

.guarantee-badge {
    margin-top: 24px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 0.8rem; font-weight: 600; color: var(--gray-med);
}

/* --- Card de Pagamento (Direita) --- */
.payment-card { 
    border-top: 4px solid var(--primary); /* Accent Top Border */
    position: relative;
    overflow: hidden;
}

.payment-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.pix-icon-wrapper { padding: 8px; border-radius: 10px; background: #f1f5f9; }
.pix-icon-wrapper img { display: block; height: 24px; }
.header-text h3 { font-size: 1.25rem; font-weight: 700; color: var(--dark); }
.header-text p { font-size: 0.85rem; color: var(--success); display: flex; align-items: center; gap: 4px; }
.header-text p::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 50%; display: inline-block; }

/* QR Code com Scanner */
.qr-wrapper { text-align: center; margin-bottom: 32px; }
.qr-frame {
    width: 200px; height: 200px;
    margin: 0 auto 16px;
    background: white;
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: relative;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.qr-frame canvas { display: block; width: 100% !important; height: 100% !important; }

/* Animação do Scanner */
.scanner-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--success);
    box-shadow: 0 0 10px var(--success), 0 0 20px var(--success);
    opacity: 0.6;
    animation: scan 2.5s ease-in-out infinite;
}
@keyframes scan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.scan-instruction { font-size: 0.9rem; color: var(--gray-med); font-weight: 500; }

/* Input Copia e Cola */
.copy-paste-section { margin-bottom: 32px; }
.copy-paste-section label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--gray-dark); margin-bottom: 8px; }

.input-wrapper {
    display: flex;
    position: relative;
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    transition: transform 0.2s;
}
.input-wrapper:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 60px; /* Space for button */
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--gray-dark);
    outline: none;
    transition: all 0.2s;
}
.input-wrapper input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(0,158,227,0.1); }

.input-wrapper button {
    position: absolute;
    right: 4px; top: 4px; bottom: 4px;
    width: 44px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-med);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.input-wrapper button:hover { border-color: var(--primary); color: var(--primary); background: #f0f9ff; }
.input-wrapper button.copied { background: var(--success); color: white; border-color: var(--success); }

/* Dados do Beneficiário */
.beneficiary-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 32px;
}
.b-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; }
.b-row:last-child { margin-bottom: 0; }
.b-label { color: var(--gray-med); }
.b-value { font-weight: 600; color: var(--dark); font-family: monospace; letter-spacing: -0.5px; }

/* --- Instrução de Ação (Aviso Premium) --- */
.action-required {
    background: #fffbeb; /* Amarelo muito suave */
    border: 1px solid #fcd34d; /* Borda amarela */
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.action-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.action-header i { color: #f59e0b; font-size: 1.2rem; }
.action-header h4 { color: #92400e; font-size: 0.95rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }

.action-required p { font-size: 0.9rem; color: #78350f; margin-bottom: 12px; }

.email-btn {
    display: flex; align-items: center; justify-content: space-between;
    background: white;
    border: 1px solid #fcd34d;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #b45309;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.email-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); border-color: #f59e0b; }

.back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--gray-med); text-decoration: none; font-size: 0.9rem; font-weight: 600;
    transition: color 0.2s;
}
.back-btn:hover { color: var(--dark); }

/* --- Responsividade --- */
@media (max-width: 800px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .order-summary { order: 2; position: static; }
    .payment-card { order: 1; border-top: none; }
    .checkout-container { padding-bottom: 40px; }
    .email-btn { font-size: 0.8rem; word-break: break-all; }
}