/**
 * ARM Pagarme PIX - Estilos CSS
 * Estilos para interface de pagamento PIX
 * 
 * @package ARMember Pagar.me
 * @since 1.6
 */

/* ========================================
   SELETOR DE MÉTODO DE PAGAMENTO
   ======================================== */

#arm_pagarme_payment_method_selector {
    margin: 20px 0;
    padding: 20px;
    background: transparent;
    border-radius: 8px;
    border: none;
}

#arm_pagarme_payment_method_selector label {
    display: block;
    padding: 15px 20px;
    margin-bottom: 12px;
    background: transparent;
    border: 2px solid #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    position: relative;
}

#arm_pagarme_payment_method_selector label:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: translateX(5px);
}

#arm_pagarme_payment_method_selector label:last-child {
    margin-bottom: 0;
}

#arm_pagarme_payment_method_selector input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    cursor: pointer;
}

#arm_pagarme_payment_method_selector input[type="radio"]:checked + span,
#arm_pagarme_payment_method_selector label:has(input[type="radio"]:checked) {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

/* ========================================
   CAMPOS PIX
   ======================================== */

#arm_pix_fields {
    padding: 20px;
    background: transparent;
    border-radius: 8px;
    border: none;
    margin: 20px 0;
}

#arm_pix_fields .arm_form_group {
    margin-bottom: 15px;
}

#arm_pix_fields .arm_form_group:last-child {
    margin-bottom: 0;
}

#arm_pix_fields label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
}

#arm_pix_fields input[type="text"],
#arm_pix_fields input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ffffff;
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: transparent;
    color: #ffffff;
}

#arm_pix_fields input[type="text"]::placeholder,
#arm_pix_fields input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#arm_pix_fields input[type="text"]:focus,
#arm_pix_fields input[type="email"]:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.05);
}

#arm_pix_fields input[type="text"].error,
#arm_pix_fields input[type="email"].error,
input[name="pix_cpf"].arm_pix_field_error,
input[name="pix_name"].arm_pix_field_error,
input[name="pix_email"].arm_pix_field_error {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.1);
    animation: shakeError 0.3s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#arm_pix_fields input[type="text"].success,
#arm_pix_fields input[type="email"].success {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

/* Mensagem de erro inline */
.arm_pix_inline_error {
    color: #ff6b6b;
    font-size: 12px;
    display: block;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
}

/* Autocomplete do navegador com fundo transparente */
#arm_pix_fields input[type="text"]:-webkit-autofill,
#arm_pix_fields input[type="email"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 2px solid #ffffff;
    transition: background-color 5000s ease-in-out 0s;
}

#arm_pix_fields input[type="text"]:-webkit-autofill:focus,
#arm_pix_fields input[type="email"]:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px rgba(0, 212, 255, 0.05) inset !important;
    border-color: #00d4ff;
}

/* ========================================
   TELA DE PAGAMENTO PIX
   ======================================== */

#arm_pix_payment_screen {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: slideInUp 0.4s ease-out;
}

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

#arm_pix_payment_screen h2 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
}

#arm_pix_payment_screen > p {
    color: #666;
    margin: 0 0 30px 0;
    font-size: 16px;
}

/* ========================================
   QR CODE
   ======================================== */

.arm_pix_qr_code {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.arm_pix_qr_code img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border: 3px solid #00d4ff;
    border-radius: 8px;
    padding: 10px;
    background: white;
    transition: transform 0.3s ease;
}

.arm_pix_qr_code img:hover {
    transform: scale(1.02);
}

.arm_pix_qr_code p {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* ========================================
   CÓDIGO COPIA E COLA
   ======================================== */

.arm_pix_copy_paste {
    margin: 30px 0;
}

.arm_pix_copy_paste > p {
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
}

.arm_pix_copy_paste > div {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

#arm_pix_code {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    background: #f9f9f9;
    color: #333;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

#arm_pix_code:focus {
    outline: none;
    border-color: #00d4ff;
    background: white;
}

/* ========================================
   BOTÃO COPIAR CÓDIGO
   ======================================== */

.arm_btn_copy_pix,
#arm_copy_pix_code {
    padding: 12px 24px;
    background: #00d4ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.arm_btn_copy_pix:hover,
#arm_copy_pix_code:hover {
    background: #00b8e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.arm_btn_copy_pix:active,
#arm_copy_pix_code:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 212, 255, 0.3);
}

#arm_copy_feedback {
    margin-top: 10px;
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   INFORMAÇÕES DO PAGAMENTO
   ======================================== */

.arm_pix_info {
    margin: 30px 0;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #00d4ff;
}

.arm_pix_info > div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.arm_pix_info > div:last-child {
    margin-bottom: 0;
}

.arm_pix_info span:first-child {
    color: #666;
    font-size: 14px;
}

.arm_pix_info span:last-child {
    font-weight: bold;
}

/* ========================================
   STATUS DO PAGAMENTO
   ======================================== */

.arm_pix_status {
    margin: 30px 0;
    padding: 20px;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffc107;
}

.arm_pix_status p {
    margin: 0;
    color: #856404;
}

.arm_pix_status p:first-of-type {
    font-weight: bold;
    font-size: 16px;
}

.arm_pix_status p:last-of-type {
    font-size: 14px;
    margin-top: 10px;
}

/* ========================================
   LOADER / SPINNER
   ======================================== */

.arm_pix_loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffc107;
    border-radius: 50%;
    animation: arm_spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes arm_spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#arm_pix_loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#arm_pix_loader > div {
    text-align: center;
    color: white;
}

.arm_loader_img {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #00d4ff;
    border-radius: 50%;
    animation: arm_spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* ========================================
   MENSAGENS DE ERRO
   ======================================== */

.arm_pix_error_message {
    background: #f44336;
    color: white;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    text-align: center;
    animation: slideInDown 0.3s ease-out;
}

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

.arm_pix_error_message strong {
    font-size: 16px;
}

/* ========================================
   BOTÃO GERAR NOVO CÓDIGO
   ======================================== */

.arm_btn_generate_new_pix,
#arm_generate_new_pix {
    padding: 12px 30px;
    background: #00d4ff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.arm_btn_generate_new_pix:hover,
#arm_generate_new_pix:hover {
    background: #00b8e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

/* ========================================
   PÁGINA DE RENOVAÇÃO
   ======================================== */

.arm_pix_renewal_container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
}

.arm_pix_renewal_info {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.arm_pix_renewal_info h2 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 24px;
}

#arm_pix_renewal_btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #00d4ff 0%, #00b8e6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

#arm_pix_renewal_btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

#arm_pix_renewal_btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.arm_pix_renewal_btn_icon {
    margin-right: 8px;
}

#arm_pix_renewal_loader {
    display: none;
    text-align: center;
    padding: 20px;
}

#arm_pix_renewal_qrcode_container {
    display: none;
}

.arm_pix_renewal_qrcode_wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.arm_pix_renewal_error_message {
    background: #f44336;
    color: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.3s ease-out;
}

/* ========================================
   COMPATIBILIDADE COM FUNDOS ESCUROS
   ======================================== */

/* Garantir legibilidade em qualquer fundo */
#arm_pagarme_payment_method_selector label,
#arm_pix_fields label,
#arm_pix_fields input[type="text"],
#arm_pix_fields input[type="email"] {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Melhorar contraste dos botões */
.arm_btn_copy_pix,
#arm_copy_pix_code,
.arm_btn_generate_new_pix,
#arm_generate_new_pix,
#arm_pix_renewal_btn {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Suporte para fundos claros (opcional) */
.arm_light_background #arm_pagarme_payment_method_selector label,
.arm_light_background #arm_pix_fields label {
    color: #333333;
    text-shadow: none;
}

.arm_light_background #arm_pagarme_payment_method_selector label {
    border-color: #333333;
}

.arm_light_background #arm_pix_fields input[type="text"],
.arm_light_background #arm_pix_fields input[type="email"] {
    border-color: #333333;
    color: #333333;
    text-shadow: none;
}

.arm_light_background #arm_pix_fields input[type="text"]::placeholder,
.arm_light_background #arm_pix_fields input[type="email"]::placeholder {
    color: rgba(51, 51, 51, 0.6);
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

@media (max-width: 768px) {
    #arm_pix_payment_screen {
        margin: 20px auto;
        padding: 20px;
    }

    #arm_pix_payment_screen h2 {
        font-size: 24px;
    }

    #arm_pix_payment_screen > p {
        font-size: 14px;
    }

    .arm_pix_qr_code {
        padding: 15px;
    }

    .arm_pix_qr_code img {
        max-width: 250px;
    }

    .arm_pix_copy_paste > div {
        flex-direction: column;
    }

    #arm_pix_code {
        width: 100%;
        min-width: auto;
        font-size: 11px;
    }

    .arm_btn_copy_pix,
    #arm_copy_pix_code {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }

    .arm_pix_info {
        padding: 15px;
    }

    .arm_pix_info > div {
        font-size: 14px;
    }

    .arm_pix_status {
        padding: 15px;
    }

    #arm_pagarme_payment_method_selector {
        padding: 15px;
    }

    #arm_pagarme_payment_method_selector label {
        padding: 12px 15px;
        font-size: 15px;
    }

    #arm_pix_fields {
        padding: 15px;
    }

    .arm_pix_renewal_container {
        padding: 15px;
    }

    .arm_pix_renewal_info {
        padding: 20px;
    }

    #arm_pix_renewal_btn {
        width: 100%;
        padding: 15px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #arm_pix_payment_screen {
        margin: 10px;
        padding: 15px;
    }

    #arm_pix_payment_screen h2 {
        font-size: 20px;
    }

    .arm_pix_qr_code img {
        max-width: 200px;
    }

    #arm_pix_code {
        font-size: 10px;
        padding: 10px;
    }

    .arm_btn_copy_pix,
    #arm_copy_pix_code {
        font-size: 14px;
        padding: 12px 16px;
    }

    .arm_pix_info span:first-child,
    .arm_pix_info span:last-child {
        font-size: 13px;
    }

    #arm_pagarme_payment_method_selector label {
        padding: 10px 12px;
        font-size: 14px;
    }

    #arm_pix_fields input[type="text"],
    #arm_pix_fields input[type="email"] {
        font-size: 16px; /* Evita zoom no iOS */
        padding: 10px 12px;
    }
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */

/* Melhorar foco para navegação por teclado */
#arm_pagarme_payment_method_selector input[type="radio"]:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

#arm_pix_fields input:focus,
#arm_pix_code:focus,
.arm_btn_copy_pix:focus,
#arm_copy_pix_code:focus,
#arm_generate_new_pix:focus,
#arm_pix_renewal_btn:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Garantir contraste adequado */
.arm_pix_status {
    color: #856404;
}

/* Suporte para modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
    #arm_pix_payment_screen {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    #arm_pix_payment_screen h2 {
        color: #e0e0e0;
    }

    #arm_pix_payment_screen > p {
        color: #b0b0b0;
    }

    .arm_pix_qr_code {
        background: #3d3d3d;
    }

    #arm_pix_code {
        background: #3d3d3d;
        color: #e0e0e0;
        border-color: #555;
    }

    .arm_pix_info {
        background: #3d3d3d;
        border-left-color: #00d4ff;
    }

    .arm_pix_info span {
        color: #e0e0e0;
    }
}

/* ========================================
   ANIMAÇÕES SUAVES
   ======================================== */

/* Transição suave ao mostrar/ocultar campos */
#arm_pix_fields,
#arm_card_fields {
    transition: all 0.3s ease;
}

/* Efeito de pulso no loader */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.arm_pix_loader {
    animation: arm_spin 1s linear infinite, pulse 2s ease-in-out infinite;
}

/* ========================================
   IMPRESSÃO
   ======================================== */

@media print {
    #arm_pix_loader,
    .arm_pix_status,
    .arm_btn_copy_pix,
    #arm_copy_pix_code,
    #arm_copy_feedback {
        display: none !important;
    }

    #arm_pix_payment_screen {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .arm_pix_qr_code img {
        border-color: #000;
    }
}
