/**
 * CT PREPAIEMENT Manager - Frontend CSS
 */

/* Section de paiement */
.lpp-payment-section {
    background: linear-gradient(135deg,#F5F3FF 0%,#B6D9DD 100%);
    border: 2px solid #3F929B;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.lpp-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e40af;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #cbd5e1;
}

.lpp-section-title i {
    color: #16a34a;
    font-size: 20px;
}

/* Info paiement */
.lpp-payment-info {
    background: #dbeafe;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.lpp-payment-info p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
}

/* Wrapper de l'élément carte */
.lpp-card-element-wrapper {
    margin-bottom: 20px;
}

.lpp-card-element-wrapper label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Élément de carte Stripe */
.lpp-card-element {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
}

.lpp-card-element:hover {
    border-color: #3b82f6;
}

.lpp-card-element.StripeElement--focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.lpp-card-element.StripeElement--invalid {
    border-color: #ef4444;
}

/* Erreurs de carte - Style amélioré */
.lpp-card-errors {
    display: none;
    position: relative;
    margin-top: 15px;
    padding: 16px 45px 16px 16px;
    background: linear-gradient(135deg,#F5F3FF 0%,#B6D9DD 100%);
    border: 2px solid #3F929B;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.lpp-card-errors.lpp-error-visible {
    display: block;
    animation: lpp-slideIn 0.4s ease-out, lpp-shake 0.5s ease-in-out 0.4s;
}

.lpp-error-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.lpp-error-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.lpp-error-text {
    color: #b91c1c;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.lpp-error-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.lpp-error-close:hover {
    color: #ef4444;
}

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

@keyframes lpp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Montant à payer */
.lpp-payment-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e40af;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.lpp-amount-label {
    font-size: 14px;
    font-weight: 500;
}

.lpp-amount-value {
    font-size: 22px;
    font-weight: 700;
}

/* Bouton de paiement */
.lpp-pay-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 30px !important;
    background: linear-gradient(135deg,#F5F3FF 0%,#B6D9DD 100%) !important;
    color: white !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px 0 rgba(22, 163, 74, 0.4);
    margin-top: 20px;
}

/* ⭐ Cacher le bouton Stripe / l'encadré montant quand une autre méthode est sélectionnée */
.lpp-pay-button.lpp-hidden,
.lpp-stripe-pay-btn.lpp-hidden,
.lpp-mobile-pay-btn-wrapper.lpp-hidden,
#lpp-payment-amount-box.lpp-hidden {
    display: none !important;
}

.lpp-pay-button:hover {
    background: linear-gradient(135deg, #2c4e53 0%, #3f929b 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(22, 163, 74, 0.5);
}

.lpp-pay-button:active {
    transform: translateY(0);
}

.lpp-pay-button.loading {
    background: #9ca3af !important;
    pointer-events: none;
    box-shadow: none;
}

.lpp-pay-button .loadingspinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: lpp-spin 0.8s ease-in-out infinite;
}

.lpp-pay-button.loading .loadingspinner {
    display: block;
}

@keyframes lpp-spin {
    to { transform: rotate(360deg); }
}

.lpp-pay-button .lpp-btn-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpp-pay-button .lpp-btn-text i {
    font-size: 16px;
}

/* Message de succès */
.lpp-success-message {
    background: linear-gradient(135deg,#F5F3FF 0%,#B6D9DD 100%);
    border: 2px solid #3F929B;
    color: #166534;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    animation: lpp-fadeIn 0.3s ease-in-out;
}

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

/* Responsive */
@media (max-width: 768px) {
    .lpp-payment-section {
        padding: 20px 15px;
    }
    
    .lpp-section-title {
        font-size: 16px;
    }
    
    .lpp-payment-amount {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .lpp-amount-value {
        font-size: 20px;
    }
    
    .lpp-pay-button {
        padding: 15px 20px !important;
        font-size: 16px !important;
    }
}

/* Mode sombre (si thème le supporte) */
@media (prefers-color-scheme: dark) {
    .lpp-payment-section {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #3b82f6;
    }
    
    .lpp-section-title {
        color: #93c5fd;
        border-bottom-color: #475569;
    }
    
    .lpp-payment-info {
        background: #1e3a5f;
    }
    
    .lpp-payment-info p {
        color: #93c5fd;
    }
    
    .lpp-card-element-wrapper label {
        color: #e2e8f0;
    }
    
    .lpp-card-element {
        background: #1e293b;
        border-color: #475569;
    }
}

/* Badge de sécurité */
.lpp-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(22, 163, 74, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: #16a34a;
}

.lpp-security-badge img {
    height: 20px;
}

/* Icons de cartes acceptées */
.lpp-accepted-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    opacity: 0.7;
}

.lpp-accepted-cards img {
    height: 24px;
}

/* =========================================================================
   Virement bancaire (intégration native Listeo)
   Mise en page neutre : couleurs/typo héritées du thème.
   ========================================================================= */
.lpp-bank-transfer .lpp-bt-title {
    margin: 18px 0 10px;
    font-size: 16px;
}

.lpp-bank-transfer .lpp-bt-details {
    list-style: none;
    margin: 0 0 15px;
    padding: 0;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    overflow: hidden;
}

.lpp-bank-transfer .lpp-bt-details li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 11px 15px;
    margin: 0;
    border-bottom: 1px solid #e8e8e8;
}

.lpp-bank-transfer .lpp-bt-details li:last-child {
    border-bottom: none;
}

.lpp-bank-transfer .lpp-bt-details li:nth-child(even) {
    background: #f9f9f9;
}

.lpp-bank-transfer .lpp-bt-details li span {
    color: #808080;
    font-size: 14px;
}

.lpp-bank-transfer .lpp-bt-details li strong {
    text-align: right;
    word-break: break-word;
}

.lpp-bank-transfer .lpp-bt-mono {
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 1px;
}

.lpp-bank-transfer .button.fullwidth {
    width: 100%;
}

.lpp-bank-transfer .lpp-bt-details .lpp-bt-reference strong {
    font-size: 16px;
    font-weight: 700;
}

/* ── Confirmation virement inline (dans la modale LBP) ── */
.lpp-bt-inline-confirm {
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.lpp-bt-inline-confirm .lpp-bt-title {
    font-size: 15px;
    font-weight: 700;
    margin: 14px 0 8px;
    color: #1e293b;
}

.lpp-bt-inline-confirm .lpp-bt-details {
    list-style: none;
    margin: 0 0 6px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.lpp-bt-inline-confirm .lpp-bt-details li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13.5px;
    gap: 10px;
}

.lpp-bt-inline-confirm .lpp-bt-details li:last-child {
    border-bottom: none;
}

.lpp-bt-inline-confirm .lpp-bt-details li span {
    color: #64748b;
    flex-shrink: 0;
    min-width: 90px;
}

.lpp-bt-inline-confirm .lpp-bt-details li strong {
    word-break: break-all;
    text-align: right;
}

.lpp-bt-inline-confirm .lpp-bt-reference strong {
    font-size: 15px;
    color: #0f172a;
}

/* Page de confirmation (shortcode [lpp_bank_transfer]) */
.lpp-bank-transfer-page {
    max-width: 760px;
    margin: 0 auto;
}

.lpp-bank-transfer-page .lpp-bt-page-title {
    margin: 0 0 20px;
}

.lpp-bank-transfer-page .lpp-bt-proof-field {
    margin-bottom: 15px;
}

.lpp-bank-transfer-page .lpp-bt-proof-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}



/* LPP 1.8.1.7.2.5 — empêcher tout clic avant initialisation Stripe */
.lpp-pay-button[aria-disabled="true"],
.lpp-pay-button.lpp-payment-not-ready {
    pointer-events: none !important;
    opacity: .55;
    cursor: not-allowed !important;
}
