/**
 * CheckToBuild Payment Modal CSS - Sistema Unificado
 * Integrado completamente con variables de main.css
 */

/* ========================================
   PAYMENT MODAL - VARIABLES ESPECÍFICAS
======================================== */
:root {
    --ctb-modal-z-index: 999999;
    --ctb-modal-backdrop: rgba(0, 0, 0, 0.7);
    --ctb-modal-blur: 10px;
}

/* ========================================
   PAYMENT MODAL CORE
======================================== */

/* Modal container */
.ctb-payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--ctb-modal-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ctb-space-8);
}

/* Modal overlay */
.ctb-payment-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ctb-modal-backdrop);
    backdrop-filter: blur(var(--ctb-modal-blur));
    -webkit-backdrop-filter: blur(var(--ctb-modal-blur));
}

/* Modal content */
.ctb-payment-modal-content {
    position: relative;
    background: var(--ctb-white);
    border-radius: var(--ctb-radius-2xl);
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--ctb-shadow-2xl);
    animation: ctbModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button */
.ctb-payment-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.ctb-payment-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.ctb-payment-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

/* Modal header */
.ctb-payment-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.ctb-payment-modal-logo {
    text-align: left;
    margin-bottom: 20px;
    min-height: 38px;
}

.ctb-payment-modal-logo svg {
    max-width: 180px;
    height: auto;
    display: inline-block;
    min-height: 38px;
}

.ctb-payment-modal-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #1561B2;
    margin: 0 0 10px;
}

.modal-subtitle {
    color: #666;
    font-size: 15px;
    margin: 0;
}

/* Modal body */
.ctb-payment-modal-body {
    padding: 30px;
}

/* Product info section */
.ctb-payment-product-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.product-badge {
    display: inline-block;
    background: #004aad;
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-price {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
}

.product-price .currency {
    font-size: 20px;
    color: #666;
    font-weight: 600;
}

.product-price span:last-child {
    font-size: 42px;
    font-weight: 800;
    color: #004aad;
    line-height: 1;
}

/* Form section */
.ctb-payment-form-section {
    margin-bottom: 20px;
}

.form-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(21, 97, 178, 0.08);
    border: 1px solid rgba(21, 97, 178, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.form-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.form-notice p {
    margin: 0;
    color: #004aad;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.form-group {
    margin-bottom: 0px!important;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #1561B2;
    box-shadow: 0 0 0 3px rgba(21, 97, 178, 0.1);
}

.form-group input.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.form-group input.success {
    border-color: #28a745;
    background: #f8fff9;
}

.form-help {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.form-error {
    display: none;
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    font-weight: 500;
}

.form-error.show {
    display: block;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-info {
    background: #fff9e6;
    border: 1px solid #ffd666;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.form-info p {
    margin: 0;
    color: #7c6800;
    font-size: 13px;
    line-height: 1.5;
}

/* Submit button */
.ctb-payment-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    margin-top:1rem;
    padding: 16px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ctb-payment-submit-btn:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.ctb-payment-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.ctb-payment-submit-btn.loading .btn-arrow {
    animation: spin 1s linear infinite;
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.ctb-payment-submit-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Security badge */
.ctb-payment-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.ctb-payment-security svg {
    flex-shrink: 0;
}

.ctb-payment-security span {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Create account prompt */
.create-account-prompt {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
}

.create-account-prompt p {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
}

.btn-create-account {
    background: #004aad;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-create-account:hover {
    background: #1561B2;
    transform: translateY(-2px);
}

/* Notification */
.ctb-payment-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    z-index: 1000000;
    animation: notificationSlide 0.3s ease;
}

@keyframes notificationSlide {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

.ctb-payment-notification.success {
    border-left: 4px solid #28a745;
}

.ctb-payment-notification.error {
    border-left: 4px solid #dc3545;
}

.notification-message {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Body modal open state */
body.ctb-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .ctb-payment-modal {
        padding: 10px;
        overflow:auto;
    }
    
    .ctb-payment-modal-content {
        border-radius: 10px
    }
    
    .ctb-payment-modal-header {
        padding: 25px 20px 15px;
    }
    
    .ctb-payment-modal-logo {
        margin-bottom: 15px;
    }
    
    .ctb-payment-modal-logo svg {
        max-width: 140px;
    }
    
    .ctb-payment-modal-header h2 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .modal-subtitle {
        font-size: 13px;
    }
    
    .ctb-payment-modal-body {
        padding: 20px;
    }
    
    .ctb-payment-product-info {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
        margin-bottom: 20px;
        align-items: center;
        text-align: center;
    }
    
    .product-badge {
        font-size: 11px;
        padding: 5px 14px;
    }
    
    .product-price {
        justify-content: center;
    }
    
    .product-price .currency {
        font-size: 18px;
    }
    
    .product-price span:last-child {
        font-size: 38px;
    }
    
    .ctb-payment-submit-btn {
        font-size: 14px;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .ctb-payment-modal-content {
        border-radius: 10px
    }
    
    .ctb-payment-modal-close {
        top: 15px;
        right: 15px;
    }
    
    .ctb-payment-notification {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 20px;
    }
}