/* Checkout Payment Gateway - Design Premium & Conversão */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00BA88;
    --primary-hover: #00966D;
    --secondary: #667eea;
    --text-main: #1A1A1A;
    --text-muted: #6C757D;
    --bg-light: #F8F9FA;
    --white: #FFFFFF;
    --error: #FF4D4F;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

body {
    background: #F0F2F5;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.5;
}

.checkout-pg-container {
    max-width: 850px;
    margin: 2rem auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Header Style */
.checkout-pg-header {
    padding: 1rem 2rem;
    background: #fdfdfd;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.header-security {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
}

.header-security .icon {
    font-size: 1rem;
}

/* Progress Bar */
.checkout-pg-progress {
    display: flex;
    padding: 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid #EEE;
    justify-content: space-between;
    align-items: center;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #DDD;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 5px rgba(0, 186, 136, 0.2);
}

.progress-step.completed .step-number {
    background: var(--primary);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-step.active .step-label {
    color: var(--primary);
}

.progress-line {
    flex: 1;
    height: 2px;
    background: #DDD;
    margin: 0 10px;
    margin-top: -20px;
}

/* Form Styles */
.checkout-pg-form {
    padding: 2.5rem;
}

.checkout-pg-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.checkout-pg-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.checkout-pg-step h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 186, 136, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Product Summary */
.product-summary {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.product-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.product-details {
    flex: 1;
}

.product-name {
    font-weight: 700;
    font-size: 1rem;
}

.product-qty {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-price {
    font-weight: 700;
    color: var(--primary);
}

/* Payment Methods */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.payment-option {
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-content {
    padding: 1.5rem;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.payment-option input:checked + .payment-content {
    border-color: var(--primary);
    background: rgba(0, 186, 136, 0.05);
}

.payment-icon {
    font-size: 1.5rem;
}

.payment-name {
    font-weight: 700;
    display: block;
}

.payment-badge {
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

/* Buttons */
.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-next, .btn-submit {
    background: var(--primary);
    color: white;
}

.btn-next:hover, .btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 186, 136, 0.2);
}

.btn-back {
    background: #EDF2F7;
    color: #4A5568;
}

/* PIX Modal Aprimorado */
.pix-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: flex-start; /* Alinha ao topo para permitir rolagem */
    justify-content: center;
    backdrop-filter: blur(8px);
    overflow-y: auto; /* Permite rolagem no overlay */
    padding: 20px 0;
}

.pix-modal-overlay.active {
    display: flex;
}

.pix-modal {
    background: white;
    width: 95%;
    max-width: 480px;
    border-radius: 24px;
    overflow: visible; /* Permite que o conteúdo interno defina a altura */
    position: relative;
    margin: auto; /* Centraliza verticalmente se couber */
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pix-modal-header {
    background: #F8FAFC;
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #E2E8F0;
    position: relative;
}

.pix-modal-header h3 {
    font-weight: 800;
    font-size: 1.25rem;
    color: #1E293B;
}

.close-modal {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer;
    color: #94A3B8;
}

.pix-modal-body {
    padding: 2rem;
}

/* Escassez / Timer */
.pix-urgency-bar {
    background: #FFF5F5;
    border: 1px solid #FED7D7;
    padding: 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.pix-timer-clock {
    font-weight: 800;
    color: #E53E3E;
    font-size: 1.1rem;
}

.pix-urgency-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #C53030;
}

/* QR Code */
.pix-qr-wrapper {
    background: white;
    border: 2px solid var(--primary);
    padding: 1rem;
    border-radius: 16px;
    width: fit-content;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 186, 136, 0.1);
}

.pix-qr-wrapper img {
    display: block;
    width: 200px;
    height: 200px;
}

/* Copy Code */
.pix-copy-box {
    margin-bottom: 1.5rem;
}

.pix-input-group {
    display: flex;
    background: #F1F5F9;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.pix-input-group input {
    flex: 1;
    background: none;
    border: none;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 0.8rem;
    color: #475569;
}

.btn-copy-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-action:hover {
    background: var(--primary-hover);
}

/* Instructions */
.pix-steps {
    text-align: left;
    background: #F8FAFC;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.pix-step-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.pix-step-item:last-child { margin-bottom: 0; }

.step-bullet {
    width: 20px; height: 20px;
    background: #E2E8F0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800; color: #64748B;
    flex-shrink: 0;
}

/* Footer Security */
.checkout-pg-footer {
    padding: 1.5rem 2.5rem;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #555;
}

.footer-item:last-child {
    margin-bottom: 0;
}

.footer-item .icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.pix-modal-footer {
    padding: 1rem;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #94A3B8;
}

.security-item i { color: #22C55E; }

/* Responsive */
@media (max-width: 600px) {
    .checkout-pg-trust-badges { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .payment-methods { grid-template-columns: 1fr; }
    .form-actions { grid-template-columns: 1fr; }
    .btn-back { order: 2; }
    .btn-next { order: 1; }
}
