/* ========================================
   PAYMENT MODAL STYLES
   Styles pour les modales de paiement Airwallex
======================================== */

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

/* Modal Header */
.modal-header {
    padding: 30px;
    border-bottom: 2px solid #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-header h2 i {
    color: #DC2626;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6B7280;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #F3F4F6;
    color: #DC2626;
}

/* Payment Content */
.payment-content {
    padding: 30px;
}

/* Service Summary */
.service-summary {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.summary-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #E5E7EB;
}

.summary-item:last-of-type {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #6B7280;
    font-size: 14px;
}

.summary-value {
    color: #1F2937;
    font-weight: 500;
    text-align: right;
    max-width: 60%;
}

.summary-value.small {
    font-size: 13px;
    color: #6B7280;
}

.summary-divider {
    height: 2px;
    background: #E5E7EB;
    margin: 15px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
}

.total-label {
    font-size: 18px;
    font-weight: 700;
    color: #1F2937;
}

.total-value {
    font-size: 24px;
    font-weight: 700;
    color: #DC2626;
}

/* Payment Form Section */
.payment-form-section {
    background: white;
}

.payment-form-title {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Wallet Payment Buttons */
/* Card Input */
.card-input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 10px;
    font-size: 14px;
}

#card-element {
    padding: 15px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    background: white;
    transition: border-color 0.3s ease;
}

#card-element:focus,
#card-element.StripeElement--focus {
    border-color: #DC2626;
    outline: none;
}

.card-input-help {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
}

#card-errors {
    color: #DC2626;
    font-size: 13px;
    margin-top: 10px;
    display: none;
}

/* Payment Security */
.payment-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: #F0FDF4;
    border-radius: 8px;
    margin: 20px 0;
    color: #059669;
    font-size: 14px;
    font-weight: 500;
}

.payment-security i {
    font-size: 18px;
}

/* Payment Actions */
.payment-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.payment-actions button {
    flex: 1;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.payment-actions .btn-primary {
    background: var(--gradient-red);
    color: white;
}

.payment-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

.payment-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.payment-actions .btn-secondary {
    background: #F3F4F6;
    color: #6B7280;
}

.payment-actions .btn-secondary:hover {
    background: #E5E7EB;
}

/* Confirmation Modal */
.confirmation-modal {
    text-align: center;
}

.confirmation-content {
    padding: 40px 30px;
}

.success-animation {
    margin-bottom: 20px;
}

.success-animation i {
    font-size: 80px;
    color: #10B981;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.confirmation-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    margin: 20px 0 15px 0;
}

.confirmation-content p {
    color: #6B7280;
    font-size: 16px;
    line-height: 1.6;
    margin: 10px 0;
}

.confirmation-content strong {
    color: #1F2937;
    font-weight: 600;
}

.confirmation-details {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
}

.detail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    color: #1F2937;
    font-weight: 500;
}

.detail-item i {
    color: #DC2626;
    font-size: 18px;
}

.confirmation-actions {
    padding: 0 30px 30px 30px;
}

.confirmation-actions .btn-primary {
    width: 100%;
    padding: 15px 25px;
    background: var(--gradient-red);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.confirmation-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 60px;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 18px;
    font-weight: 600;
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 15px;
        align-items: flex-end;
    }

    .modal-overlay.active {
        align-items: flex-end;
    }

    .modal-content {
        margin: 0;
        max-height: 95vh;
        border-radius: 24px 24px 0 0;
        animation: modalSlideUp 0.3s ease-out;
    }

    @keyframes modalSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .modal-header {
        padding: 20px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-radius: 24px 24px 0 0;
    }

    .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #D1D5DB;
        border-radius: 2px;
    }

    .modal-header h2 {
        font-size: 18px;
        padding-top: 10px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
        margin-top: 10px;
    }

    .payment-content {
        padding: 20px;
        padding-bottom: 30px;
    }

    /* Service Summary Mobile */
    .service-summary {
        padding: 16px;
        margin-bottom: 20px;
        border-radius: 16px;
    }

    .summary-header h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 0;
    }

    .summary-label {
        font-size: 13px;
    }

    .summary-value {
        max-width: 100%;
        text-align: left;
        font-size: 15px;
    }

    .summary-value.small {
        font-size: 12px;
    }

    .summary-total {
        padding-top: 12px;
    }

    .total-label {
        font-size: 16px;
    }

    .total-value {
        font-size: 22px;
    }

    /* Payment Form Mobile */
    .payment-form-title {
        font-size: 16px;
        margin-bottom: 16px;
    }


    /* Card Input Mobile */
    .card-input-label {
        font-size: 13px;
    }

    #card-element {
        padding: 14px;
        font-size: 16px; /* Évite le zoom auto sur iOS */
    }

    .card-input-help {
        font-size: 11px;
    }

    /* Payment Security Mobile */
    .payment-security {
        padding: 12px;
        font-size: 13px;
        margin: 16px 0;
    }

    .payment-security i {
        font-size: 16px;
    }

    /* Payment Actions Mobile */
    .payment-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 16px;
    }

    .payment-actions button {
        width: 100%;
        padding: 16px 20px;
        font-size: 15px;
        border-radius: 14px;
    }

    /* Confirmation Modal Mobile */
    .confirmation-content {
        padding: 30px 20px;
    }

    .success-animation i {
        font-size: 60px;
    }

    .confirmation-content h3 {
        font-size: 20px;
        margin: 16px 0 12px 0;
    }

    .confirmation-content p {
        font-size: 14px;
    }

    .confirmation-details {
        padding: 16px;
        margin: 20px 0;
        border-radius: 14px;
    }

    .detail-item {
        padding: 8px;
        font-size: 14px;
    }

    .detail-item i {
        font-size: 16px;
    }

    .confirmation-actions {
        padding: 0 20px 20px 20px;
    }

    .confirmation-actions .btn-primary {
        padding: 16px 20px;
        font-size: 15px;
        border-radius: 14px;
    }

    /* Loading Overlay Mobile */
    .loading-spinner i {
        font-size: 50px;
        margin-bottom: 16px;
    }

    .loading-spinner p {
        font-size: 16px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE SMALL
======================================== */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        max-height: 100vh;
        max-height: 100dvh; /* Dynamic viewport height pour iOS */
        border-radius: 20px 20px 0 0;
    }

    .modal-header {
        padding: 16px;
        border-radius: 20px 20px 0 0;
    }

    .modal-header h2 {
        font-size: 16px;
        gap: 8px;
    }

    .modal-header h2 i {
        font-size: 18px;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .payment-content {
        padding: 16px;
        padding-bottom: 24px;
    }

    .service-summary {
        padding: 14px;
        border-radius: 12px;
    }

    .summary-header h3 {
        font-size: 15px;
    }

    .summary-item {
        padding: 10px 0;
    }

    .summary-label {
        font-size: 12px;
    }

    .summary-value {
        font-size: 14px;
    }

    .total-label {
        font-size: 15px;
    }

    .total-value {
        font-size: 20px;
    }

    .payment-form-title {
        font-size: 15px;
    }


    #card-element {
        padding: 12px;
    }

    .payment-security {
        padding: 10px;
        font-size: 12px;
        border-radius: 10px;
    }

    .payment-actions button {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 12px;
    }

    .confirmation-content {
        padding: 24px 16px;
    }

    .success-animation i {
        font-size: 50px;
    }

    .confirmation-content h3 {
        font-size: 18px;
    }

    .confirmation-content p {
        font-size: 13px;
    }

    .confirmation-details {
        padding: 14px;
        border-radius: 12px;
    }

    .detail-item {
        font-size: 13px;
        flex-direction: column;
        text-align: center;
    }

    .confirmation-actions {
        padding: 0 16px 16px 16px;
    }

    .confirmation-actions .btn-primary {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 12px;
    }
}

/* ========================================
   RESPONSIVE - LANDSCAPE MOBILE
======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-overlay {
        padding: 10px;
        align-items: center;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 12px 16px;
        border-radius: 16px 16px 0 0;
    }

    .modal-header::before {
        display: none;
    }

    .modal-header h2 {
        font-size: 16px;
        padding-top: 0;
    }

    .payment-content {
        padding: 12px 16px;
    }

    .service-summary {
        padding: 12px;
        margin-bottom: 12px;
    }

    .summary-item {
        flex-direction: row;
        padding: 6px 0;
    }


    .payment-actions {
        flex-direction: row;
        gap: 8px;
    }

    .payment-actions button {
        padding: 12px 16px;
    }
}

