/* =================================================================
   ARQUIVO: checkout-pix.css
   DESCRIÇÃO: Estilos para o Checkout PIX inspirado no Mercado Livre.
   VERSÃO: 1.3.0
   ================================================================= */

/* --- 1. GERAL E FONTES --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Variáveis de Cor para fácil manutenção */
:root {
    --ml-blue: #3483fa;          /* Azul principal do Mercado Livre */
    --ml-blue-dark: #2968c8;     /* Azul para hover do botão */
    --ml-text-dark: #333333;     /* Cor de texto principal */
    --ml-text-light: #666666;    /* Cor de texto secundário */
    --ml-border: #e0e0e0;        /* Cor das bordas */
    --ml-background: #f5f5f5;    /* Cor de fundo da página */
    --ml-green-success: #00a650; /* Verde para ícones e mensagens de sucesso */
    --ml-pix-color: #00b1ea;       /* Cor oficial do logo do Pix */
    --ml-font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- 2. WRAPPER DE CENTRALIZAÇÃO --- */
/* Este container garante que o card de checkout fique sempre no centro da tela */
.ml-checkout-wrapper {
    font-family: var(--ml-font);
    background-color: var(--ml-background);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
}

/* --- 3. O CARTÃO DE CHECKOUT --- */
/* A caixa principal que contém todos os elementos */
.ml-checkout-card {
    background-color: white;
    max-width: 400px;
    width: 100%;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* --- 4. CABEÇALHO DO CARTÃO --- */
.ml-header {
    margin-bottom: 24px;
}
.ml-header .fa-pix {
    font-size: 32px;
    color: var(--ml-pix-color);
    margin-bottom: 12px;
}
.ml-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--ml-text-dark);
    margin: 0 0 4px 0;
}
.ml-header p {
    color: var(--ml-text-light);
    margin: 0;
    font-size: 15px;
}

/* --- 5. FORMULÁRIO --- */
.ml-form {
    margin-bottom: 16px;
}
.ml-input-group {
    text-align: left;
    margin-bottom: 20px;
}
.ml-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ml-text-dark);
    margin-bottom: 8px;
    display: block;
}
.ml-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--ml-border);
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ml-input-wrapper:focus-within {
    border-color: var(--ml-blue);
    box-shadow: 0 0 0 2px rgba(52, 131, 250, 0.2);
}
.ml-input-wrapper span { /* "R$" */
    font-size: 20px;
    font-weight: 500;
    color: var(--ml-text-light);
    padding: 0 16px;
}
.ml-input-amount {
    border: none;
    outline: none;
    background: none;
    width: 100%;
    height: 52px;
    font-size: 24px;
    font-weight: 600;
    color: var(--ml-text-dark);
}
/* Remove as setas do campo de número */
.ml-input-amount::-webkit-outer-spin-button,
.ml-input-amount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ml-input-amount {
  -moz-appearance: textfield;
}

/* --- 6. BOTÃO PRINCIPAL (SUBMIT) --- */
.ml-btn-primary {
    width: 100%;
    height: 52px;
    background-color: var(--ml-blue);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Espaço entre o ícone e o texto */
    transition: background-color 0.2s;
}
.ml-btn-primary:hover {
    background-color: var(--ml-blue-dark);
}
.ml-btn-primary .fa-qrcode {
    font-size: 20px;
}

/* --- 7. RODAPÉ DE SEGURANÇA --- */
.ml-footer .ml-security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ml-text-light);
    font-size: 13px;
    margin-top: 24px;
}
.ml-security-info .fa-shield-halved {
    color: var(--ml-green-success);
}

/* --- 8. JANELA MODAL (QR CODE) --- */
.ml-modal-overlay {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}
.ml-modal-content {
    position: relative;
    background-color: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ml-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--ml-text-light);
    cursor: pointer;
    line-height: 1;
}
.ml-modal-header {
    margin-bottom: 16px;
}
.ml-modal-header .fa-qrcode {
    color: var(--ml-text-dark);
    font-size: 24px;
    margin-bottom: 8px;
}
.ml-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--ml-text-dark);
}
.ml-qr-code-placeholder {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px auto;
    background-color: #f0f0f0;
    border: 1px solid var(--ml-border);
    border-radius: 6px;
}
.ml-modal-instructions {
    font-size: 14px;
    color: var(--ml-text-dark);
    margin: 16px 0 8px 0;
}
.ml-copy-wrapper {
    display: flex;
}
.ml-copy-wrapper input {
    width: 100%;
    border: 1px solid var(--ml-border);
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 10px;
    background-color: #f9f9f9;
    font-size: 14px;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ml-copy-wrapper button {
    border: 1px solid var(--ml-border);
    background-color: #f0f0f0;
    border-radius: 0 6px 6px 0;
    padding: 0 15px;
    cursor: pointer;
    color: var(--ml-text-dark);
    font-size: 16px;
}
.ml-copy-success {
    color: var(--ml-green-success);
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
}

/* --- 9. RESPONSIVIDADE PARA CELULARES --- */
@media (max-width: 480px) {
    .ml-checkout-wrapper {
        align-items: flex-start; /* Alinha no topo em vez de no centro */
        background-color: white;  /* Fundo branco para parecer um app nativo */
        padding: 0;

    }
    .ml-checkout-card {
        box-shadow: none;         /* Remove a sombra */
        border-radius: 0;         /* Remove cantos arredondados */
        padding: 24px 16px;       /* Ajusta o espaçamento interno */
        width: 100%;
        max-width: 100%;
    }
    .ml-modal-content {
        padding: 20px;
    }
}

/* --- 10. ESTILOS PARA MENSAGENS DE FEEDBACK --- */
#c3p-messages {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}
.c3p-error {
    color: #e53e3e; /* Vermelho para erros */
    background-color: #fff5f5;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #fed7d7;
}

/* --- 11. BARRA DE SUCESSO ELEGANTE --- */
#c3p-success-bar {
    display: none; /* Começa escondida */
    background-color: #e6f9f0; /* Um verde bem claro e suave */
    color: #00874c; /* Verde escuro para o texto, bom contraste */
    border: 1px solid #b2dfce;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    animation: slideDownFadeIn 0.5s ease-out forwards;
}

#c3p-success-bar .fa-check-circle {
    font-size: 20px;
}

@keyframes slideDownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}