/**
 * Estilos para el Sistema de Pagos - Tribu Infomercado
 */

/* Modal de Pago */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.payment-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.payment-modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.payment-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    z-index: 1;
}

.payment-modal-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.payment-header {
    padding: 40px 40px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.payment-header h2 {
    margin: 0 0 20px;
    color: #2c3e50;
    font-size: 28px;
}

.selected-plan-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
}

.plan-badge {
    font-size: 18px;
    font-weight: 600;
}

.plan-price {
    margin-left: auto;
    font-size: 24px;
    font-weight: bold;
}

.plan-period {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.9;
}

/* Formulario */
.payment-form {
    padding: 30px 40px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4CAF50;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    flex: 1;
    color: #333;
    line-height: 1.5;
}

.checkbox-label a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* Botones de acción */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
    color: #333;
}

.btn-submit {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mensaje de error */
.payment-error {
    margin: 20px 40px;
    padding: 15px 20px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
    line-height: 1.5;
}

/* Validación de campos */
.form-group input:invalid:not(:placeholder-shown),
.form-group select:invalid:not(:placeholder-shown) {
    border-color: #f44336;
}

.form-group input:valid:not(:placeholder-shown),
.form-group select:valid:not(:placeholder-shown) {
    border-color: #4CAF50;
}

/* Scrollbar personalizado para el modal */
.payment-modal-content::-webkit-scrollbar {
    width: 8px;
}

.payment-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.payment-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.payment-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .payment-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .payment-header {
        padding: 30px 25px 20px;
    }
    
    .payment-header h2 {
        font-size: 24px;
    }
    
    .payment-form {
        padding: 20px 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .selected-plan-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .plan-price {
        margin-left: 0;
    }
    
    .payment-error {
        margin: 20px 25px;
    }
}

@media (max-width: 480px) {
    .payment-modal-content {
        border-radius: 0;
        width: 100%;
        max-height: 100vh;
    }
    
    .payment-header {
        padding: 25px 20px 15px;
    }
    
    .payment-header h2 {
        font-size: 20px;
    }
    
    .payment-form {
        padding: 15px 20px;
    }
    
    .form-section h3 {
        font-size: 16px;
    }
    
    .payment-modal-close {
        top: 15px;
        right: 15px;
        font-size: 28px;
    }
}

/* Estados de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
