/**
 * WooCommerce RSP Gateway - Styles
 */

/* ============================================ */
/* SERVICE CAPTURE - CHAMPS DE CARTE */
/* ============================================ */

#rsp-capture-fields {
    margin-top: 15px;
}

#rsp-capture-fields .form-row {
    margin-bottom: 15px;
    padding: 0;
}

#rsp-capture-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

#rsp-capture-fields label .required {
    color: #e2401c;
}

#rsp-capture-fields input,
#rsp-capture-fields select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

#rsp-capture-fields input:focus,
#rsp-capture-fields select:focus {
    border-color: #5cb85c;
    outline: none;
    box-shadow: 0 0 5px rgba(92, 184, 92, 0.3);
}

#rsp-capture-fields .form-row-first {
    width: 47%;
    float: left;
    margin-right: 6%;
    clear: none;
}

#rsp-capture-fields .form-row-last {
    width: 47%;
    float: left;
    clear: none;
}

#rsp-capture-fields .form-row-wide {
    clear: both;
    width: 100%;
}

/* Style pour le type de carte détecté automatiquement */
#rsp-card-type.auto-detected {
    border-color: #5cb85c;
    background-color: #f0fff0;
}

/* Placeholders */
#rsp-card-number::placeholder,
#rsp-card-expiry-month::placeholder,
#rsp-card-expiry-year::placeholder,
#rsp-card-cvc::placeholder {
    color: #aaa;
    font-size: 14px;
}

/* ============================================ */
/* SERVICE PAYMENT - INFO */
/* ============================================ */

.rsp-payment-info {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin: 15px 0;
}

.rsp-payment-info p {
    margin: 0;
    color: #495057;
}

.rsp-payment-info p:before {
    content: "ℹ️ ";
    margin-right: 5px;
}

/* ============================================ */
/* PAGE DE REDIRECTION */
/* ============================================ */

.rsp-redirect-notice {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.rsp-redirect-notice p {
    margin-bottom: 20px;
    font-size: 16px;
}

.rsp-redirect-notice .button {
    padding: 12px 30px;
    font-size: 16px;
    background: #5cb85c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.rsp-redirect-notice .button:hover {
    background: #4cae4c;
}

/* ============================================ */
/* PAGE DE REMERCIEMENT */
/* ============================================ */

.rsp-thankyou-success,
.rsp-thankyou-pending,
.rsp-thankyou-failed {
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.rsp-thankyou-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.rsp-thankyou-pending {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.rsp-thankyou-failed {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.rsp-thankyou-success p,
.rsp-thankyou-pending p,
.rsp-thankyou-failed p {
    margin: 0 0 10px 0;
}

.rsp-thankyou-success p:last-child,
.rsp-thankyou-pending p:last-child,
.rsp-thankyou-failed p:last-child {
    margin-bottom: 0;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

@media (max-width: 768px) {
    #rsp-capture-fields .form-row-first,
    #rsp-capture-fields .form-row-last {
        width: 100%;
        float: none;
        margin-right: 0;
    }

    #rsp-card-expiry-month,
    #rsp-card-expiry-year {
        width: 80px !important;
    }
}

/* ============================================ */
/* COMPATIBILITÉ AVEC LES THÈMES */
/* ============================================ */

.payment_method_rsp_gateway img {
    max-height: 24px;
    vertical-align: middle;
    margin-left: 5px;
}

.woocommerce-checkout #payment ul.payment_methods li.payment_method_rsp_gateway {
    position: relative;
}

/* Icônes de cartes (optionnel) */
.rsp-card-icons {
    margin-top: 5px;
}

.rsp-card-icons img {
    height: 24px;
    margin-right: 5px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.rsp-card-icons img.active {
    opacity: 1;
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */

@keyframes rsp-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#rsp-capture-fields {
    animation: rsp-fade-in 0.3s ease;
}

/* ============================================ */
/* ÉTATS DE CHARGEMENT */
/* ============================================ */

.rsp-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.rsp-loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #5cb85c;
    border-radius: 50%;
    animation: rsp-spin 1s linear infinite;
}

@keyframes rsp-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
